![JAR search and dependency download from the Maven repository](/logo.png)
com.pulumi.azurenative.sql.kotlin.ServerSecurityAlertPolicyArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-azure-native-kotlin Show documentation
Show all versions of pulumi-azure-native-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azurenative.sql.kotlin
import com.pulumi.azurenative.sql.ServerSecurityAlertPolicyArgs.builder
import com.pulumi.azurenative.sql.kotlin.enums.SecurityAlertsPolicyState
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.jvm.JvmName
/**
* A server security alert policy.
* Azure REST API version: 2021-11-01. Prior API version in Azure Native 1.x: 2020-11-01-preview.
* Other available API versions: 2017-03-01-preview, 2022-11-01-preview, 2023-02-01-preview, 2023-05-01-preview, 2023-08-01-preview.
* ## Example Usage
* ### Update a server's threat detection policy with all parameters
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using AzureNative = Pulumi.AzureNative;
* return await Deployment.RunAsync(() =>
* {
* var serverSecurityAlertPolicy = new AzureNative.Sql.ServerSecurityAlertPolicy("serverSecurityAlertPolicy", new()
* {
* DisabledAlerts = new[]
* {
* "Access_Anomaly",
* "Usage_Anomaly",
* },
* EmailAccountAdmins = true,
* EmailAddresses = new[]
* {
* "[email protected]",
* },
* ResourceGroupName = "securityalert-4799",
* RetentionDays = 5,
* SecurityAlertPolicyName = "Default",
* ServerName = "securityalert-6440",
* State = AzureNative.Sql.SecurityAlertsPolicyState.Enabled,
* StorageAccountAccessKey = "sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD==",
* StorageEndpoint = "https://mystorage.blob.core.windows.net",
* });
* });
* ```
* ```go
* package main
* import (
* sql "github.com/pulumi/pulumi-azure-native-sdk/sql/v2"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := sql.NewServerSecurityAlertPolicy(ctx, "serverSecurityAlertPolicy", &sql.ServerSecurityAlertPolicyArgs{
* DisabledAlerts: pulumi.StringArray{
* pulumi.String("Access_Anomaly"),
* pulumi.String("Usage_Anomaly"),
* },
* EmailAccountAdmins: pulumi.Bool(true),
* EmailAddresses: pulumi.StringArray{
* pulumi.String("[email protected]"),
* },
* ResourceGroupName: pulumi.String("securityalert-4799"),
* RetentionDays: pulumi.Int(5),
* SecurityAlertPolicyName: pulumi.String("Default"),
* ServerName: pulumi.String("securityalert-6440"),
* State: sql.SecurityAlertsPolicyStateEnabled,
* StorageAccountAccessKey: pulumi.String("sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD=="),
* StorageEndpoint: pulumi.String("https://mystorage.blob.core.windows.net"),
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.sql.ServerSecurityAlertPolicy;
* import com.pulumi.azurenative.sql.ServerSecurityAlertPolicyArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* var serverSecurityAlertPolicy = new ServerSecurityAlertPolicy("serverSecurityAlertPolicy", ServerSecurityAlertPolicyArgs.builder()
* .disabledAlerts(
* "Access_Anomaly",
* "Usage_Anomaly")
* .emailAccountAdmins(true)
* .emailAddresses("[email protected]")
* .resourceGroupName("securityalert-4799")
* .retentionDays(5)
* .securityAlertPolicyName("Default")
* .serverName("securityalert-6440")
* .state("Enabled")
* .storageAccountAccessKey("sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD==")
* .storageEndpoint("https://mystorage.blob.core.windows.net")
* .build());
* }
* }
* ```
* ### Update a server's threat detection policy with minimal parameters
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using AzureNative = Pulumi.AzureNative;
* return await Deployment.RunAsync(() =>
* {
* var serverSecurityAlertPolicy = new AzureNative.Sql.ServerSecurityAlertPolicy("serverSecurityAlertPolicy", new()
* {
* ResourceGroupName = "securityalert-4799",
* SecurityAlertPolicyName = "Default",
* ServerName = "securityalert-6440",
* State = AzureNative.Sql.SecurityAlertsPolicyState.Enabled,
* });
* });
* ```
* ```go
* package main
* import (
* sql "github.com/pulumi/pulumi-azure-native-sdk/sql/v2"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := sql.NewServerSecurityAlertPolicy(ctx, "serverSecurityAlertPolicy", &sql.ServerSecurityAlertPolicyArgs{
* ResourceGroupName: pulumi.String("securityalert-4799"),
* SecurityAlertPolicyName: pulumi.String("Default"),
* ServerName: pulumi.String("securityalert-6440"),
* State: sql.SecurityAlertsPolicyStateEnabled,
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.sql.ServerSecurityAlertPolicy;
* import com.pulumi.azurenative.sql.ServerSecurityAlertPolicyArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* var serverSecurityAlertPolicy = new ServerSecurityAlertPolicy("serverSecurityAlertPolicy", ServerSecurityAlertPolicyArgs.builder()
* .resourceGroupName("securityalert-4799")
* .securityAlertPolicyName("Default")
* .serverName("securityalert-6440")
* .state("Enabled")
* .build());
* }
* }
* ```
* ## Import
* An existing resource can be imported using its type token, name, and identifier, e.g.
* ```sh
* $ pulumi import azure-native:sql:ServerSecurityAlertPolicy Default /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}
* ```
* @property disabledAlerts Specifies an array of alerts that are disabled. Allowed values are: Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly, Data_Exfiltration, Unsafe_Action, Brute_Force
* @property emailAccountAdmins Specifies that the alert is sent to the account administrators.
* @property emailAddresses Specifies an array of e-mail addresses to which the alert is sent.
* @property resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
* @property retentionDays Specifies the number of days to keep in the Threat Detection audit logs.
* @property securityAlertPolicyName The name of the threat detection policy.
* @property serverName The name of the server.
* @property state Specifies the state of the policy, whether it is enabled or disabled or a policy has not been applied yet on the specific database.
* @property storageAccountAccessKey Specifies the identifier key of the Threat Detection audit storage account.
* @property storageEndpoint Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs.
*/
public data class ServerSecurityAlertPolicyArgs(
public val disabledAlerts: Output>? = null,
public val emailAccountAdmins: Output? = null,
public val emailAddresses: Output>? = null,
public val resourceGroupName: Output? = null,
public val retentionDays: Output? = null,
public val securityAlertPolicyName: Output? = null,
public val serverName: Output? = null,
public val state: Output? = null,
public val storageAccountAccessKey: Output? = null,
public val storageEndpoint: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.azurenative.sql.ServerSecurityAlertPolicyArgs =
com.pulumi.azurenative.sql.ServerSecurityAlertPolicyArgs.builder()
.disabledAlerts(disabledAlerts?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
.emailAccountAdmins(emailAccountAdmins?.applyValue({ args0 -> args0 }))
.emailAddresses(emailAddresses?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
.resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
.retentionDays(retentionDays?.applyValue({ args0 -> args0 }))
.securityAlertPolicyName(securityAlertPolicyName?.applyValue({ args0 -> args0 }))
.serverName(serverName?.applyValue({ args0 -> args0 }))
.state(state?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.storageAccountAccessKey(storageAccountAccessKey?.applyValue({ args0 -> args0 }))
.storageEndpoint(storageEndpoint?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [ServerSecurityAlertPolicyArgs].
*/
@PulumiTagMarker
public class ServerSecurityAlertPolicyArgsBuilder internal constructor() {
private var disabledAlerts: Output>? = null
private var emailAccountAdmins: Output? = null
private var emailAddresses: Output>? = null
private var resourceGroupName: Output? = null
private var retentionDays: Output? = null
private var securityAlertPolicyName: Output? = null
private var serverName: Output? = null
private var state: Output? = null
private var storageAccountAccessKey: Output? = null
private var storageEndpoint: Output? = null
/**
* @param value Specifies an array of alerts that are disabled. Allowed values are: Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly, Data_Exfiltration, Unsafe_Action, Brute_Force
*/
@JvmName("ovotodtqpbgcjbgr")
public suspend fun disabledAlerts(`value`: Output>) {
this.disabledAlerts = value
}
@JvmName("muelyfsetnqrjemu")
public suspend fun disabledAlerts(vararg values: Output) {
this.disabledAlerts = Output.all(values.asList())
}
/**
* @param values Specifies an array of alerts that are disabled. Allowed values are: Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly, Data_Exfiltration, Unsafe_Action, Brute_Force
*/
@JvmName("klnjfjklxwqwwphw")
public suspend fun disabledAlerts(values: List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy