All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.azurenative.sql.kotlin.ServerSecurityAlertPolicyArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 2.82.0.0
Show newest version
@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>) {
        this.disabledAlerts = Output.all(values)
    }

    /**
     * @param value Specifies that the alert is sent to the account administrators.
     */
    @JvmName("bfvhuvvgxfaxoygp")
    public suspend fun emailAccountAdmins(`value`: Output) {
        this.emailAccountAdmins = value
    }

    /**
     * @param value Specifies an array of e-mail addresses to which the alert is sent.
     */
    @JvmName("xstqgcgemjtwijsx")
    public suspend fun emailAddresses(`value`: Output>) {
        this.emailAddresses = value
    }

    @JvmName("qcikcxntplefdqey")
    public suspend fun emailAddresses(vararg values: Output) {
        this.emailAddresses = Output.all(values.asList())
    }

    /**
     * @param values Specifies an array of e-mail addresses to which the alert is sent.
     */
    @JvmName("ungonpnfcxfbqxuy")
    public suspend fun emailAddresses(values: List>) {
        this.emailAddresses = Output.all(values)
    }

    /**
     * @param value The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
     */
    @JvmName("apiackostpjxotpc")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value Specifies the number of days to keep in the Threat Detection audit logs.
     */
    @JvmName("cwlrgppfbqgdmuto")
    public suspend fun retentionDays(`value`: Output) {
        this.retentionDays = value
    }

    /**
     * @param value The name of the threat detection policy.
     */
    @JvmName("iytlnrtvwrlynopp")
    public suspend fun securityAlertPolicyName(`value`: Output) {
        this.securityAlertPolicyName = value
    }

    /**
     * @param value The name of the server.
     */
    @JvmName("rpvlqfsaycsmndgo")
    public suspend fun serverName(`value`: Output) {
        this.serverName = value
    }

    /**
     * @param value Specifies the state of the policy, whether it is enabled or disabled or a policy has not been applied yet on the specific database.
     */
    @JvmName("wptfcrrwvhynwmkx")
    public suspend fun state(`value`: Output) {
        this.state = value
    }

    /**
     * @param value Specifies the identifier key of the Threat Detection audit storage account.
     */
    @JvmName("bhlbqwqqjeabldwf")
    public suspend fun storageAccountAccessKey(`value`: Output) {
        this.storageAccountAccessKey = value
    }

    /**
     * @param value Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs.
     */
    @JvmName("hjqucqcvwcbpxsbh")
    public suspend fun storageEndpoint(`value`: Output) {
        this.storageEndpoint = value
    }

    /**
     * @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("bcseepooqpjheiwd")
    public suspend fun disabledAlerts(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.disabledAlerts = mapped
    }

    /**
     * @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("queowyefxrlkwmtb")
    public suspend fun disabledAlerts(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.disabledAlerts = mapped
    }

    /**
     * @param value Specifies that the alert is sent to the account administrators.
     */
    @JvmName("vmcscdbkqxhtlrvv")
    public suspend fun emailAccountAdmins(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.emailAccountAdmins = mapped
    }

    /**
     * @param value Specifies an array of e-mail addresses to which the alert is sent.
     */
    @JvmName("kygjmiqqvmtqewls")
    public suspend fun emailAddresses(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.emailAddresses = mapped
    }

    /**
     * @param values Specifies an array of e-mail addresses to which the alert is sent.
     */
    @JvmName("ygipbxxmjjirxvnu")
    public suspend fun emailAddresses(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.emailAddresses = mapped
    }

    /**
     * @param value The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
     */
    @JvmName("pvprvrymixsyqmab")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value Specifies the number of days to keep in the Threat Detection audit logs.
     */
    @JvmName("xnoxteeqwdorurgy")
    public suspend fun retentionDays(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.retentionDays = mapped
    }

    /**
     * @param value The name of the threat detection policy.
     */
    @JvmName("oihtcvoqjyumlddq")
    public suspend fun securityAlertPolicyName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.securityAlertPolicyName = mapped
    }

    /**
     * @param value The name of the server.
     */
    @JvmName("onuwwgicvvhtavlx")
    public suspend fun serverName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.serverName = mapped
    }

    /**
     * @param value Specifies the state of the policy, whether it is enabled or disabled or a policy has not been applied yet on the specific database.
     */
    @JvmName("gfuwgaxuknhtefuq")
    public suspend fun state(`value`: SecurityAlertsPolicyState?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.state = mapped
    }

    /**
     * @param value Specifies the identifier key of the Threat Detection audit storage account.
     */
    @JvmName("fbkdxvewynmfagkx")
    public suspend fun storageAccountAccessKey(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.storageAccountAccessKey = mapped
    }

    /**
     * @param value Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs.
     */
    @JvmName("ojswbpfknrxpfxga")
    public suspend fun storageEndpoint(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.storageEndpoint = mapped
    }

    internal fun build(): ServerSecurityAlertPolicyArgs = ServerSecurityAlertPolicyArgs(
        disabledAlerts = disabledAlerts,
        emailAccountAdmins = emailAccountAdmins,
        emailAddresses = emailAddresses,
        resourceGroupName = resourceGroupName,
        retentionDays = retentionDays,
        securityAlertPolicyName = securityAlertPolicyName,
        serverName = serverName,
        state = state,
        storageAccountAccessKey = storageAccountAccessKey,
        storageEndpoint = storageEndpoint,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy