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

com.pulumi.azure.monitoring.kotlin.AadDiagnosticSettingArgs.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: 6.15.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.monitoring.kotlin

import com.pulumi.azure.monitoring.AadDiagnosticSettingArgs.builder
import com.pulumi.azure.monitoring.kotlin.inputs.AadDiagnosticSettingEnabledLogArgs
import com.pulumi.azure.monitoring.kotlin.inputs.AadDiagnosticSettingEnabledLogArgsBuilder
import com.pulumi.azure.monitoring.kotlin.inputs.AadDiagnosticSettingLogArgs
import com.pulumi.azure.monitoring.kotlin.inputs.AadDiagnosticSettingLogArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Deprecated
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * Manages an Azure Active Directory Diagnostic Setting for Azure Monitor.
 * !> **Authentication** The API for this resource does not support service principal authentication. This resource can only be used with Azure CLI authentication.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-rg",
 *     location: "west europe",
 * });
 * const exampleAccount = new azure.storage.Account("example", {
 *     name: "examplestorageaccount",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     accountTier: "Standard",
 *     accountKind: "StorageV2",
 *     accountReplicationType: "LRS",
 * });
 * const exampleAadDiagnosticSetting = new azure.monitoring.AadDiagnosticSetting("example", {
 *     name: "setting1",
 *     storageAccountId: exampleAccount.id,
 *     enabledLogs: [
 *         {
 *             category: "SignInLogs",
 *             retentionPolicy: {
 *                 enabled: true,
 *                 days: 1,
 *             },
 *         },
 *         {
 *             category: "AuditLogs",
 *             retentionPolicy: {
 *                 enabled: true,
 *                 days: 1,
 *             },
 *         },
 *         {
 *             category: "NonInteractiveUserSignInLogs",
 *             retentionPolicy: {
 *                 enabled: true,
 *                 days: 1,
 *             },
 *         },
 *         {
 *             category: "ServicePrincipalSignInLogs",
 *             retentionPolicy: {
 *                 enabled: true,
 *                 days: 1,
 *             },
 *         },
 *     ],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-rg",
 *     location="west europe")
 * example_account = azure.storage.Account("example",
 *     name="examplestorageaccount",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     account_tier="Standard",
 *     account_kind="StorageV2",
 *     account_replication_type="LRS")
 * example_aad_diagnostic_setting = azure.monitoring.AadDiagnosticSetting("example",
 *     name="setting1",
 *     storage_account_id=example_account.id,
 *     enabled_logs=[
 *         azure.monitoring.AadDiagnosticSettingEnabledLogArgs(
 *             category="SignInLogs",
 *             retention_policy=azure.monitoring.AadDiagnosticSettingEnabledLogRetentionPolicyArgs(
 *                 enabled=True,
 *                 days=1,
 *             ),
 *         ),
 *         azure.monitoring.AadDiagnosticSettingEnabledLogArgs(
 *             category="AuditLogs",
 *             retention_policy=azure.monitoring.AadDiagnosticSettingEnabledLogRetentionPolicyArgs(
 *                 enabled=True,
 *                 days=1,
 *             ),
 *         ),
 *         azure.monitoring.AadDiagnosticSettingEnabledLogArgs(
 *             category="NonInteractiveUserSignInLogs",
 *             retention_policy=azure.monitoring.AadDiagnosticSettingEnabledLogRetentionPolicyArgs(
 *                 enabled=True,
 *                 days=1,
 *             ),
 *         ),
 *         azure.monitoring.AadDiagnosticSettingEnabledLogArgs(
 *             category="ServicePrincipalSignInLogs",
 *             retention_policy=azure.monitoring.AadDiagnosticSettingEnabledLogRetentionPolicyArgs(
 *                 enabled=True,
 *                 days=1,
 *             ),
 *         ),
 *     ])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Azure.Core.ResourceGroup("example", new()
 *     {
 *         Name = "example-rg",
 *         Location = "west europe",
 *     });
 *     var exampleAccount = new Azure.Storage.Account("example", new()
 *     {
 *         Name = "examplestorageaccount",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         AccountTier = "Standard",
 *         AccountKind = "StorageV2",
 *         AccountReplicationType = "LRS",
 *     });
 *     var exampleAadDiagnosticSetting = new Azure.Monitoring.AadDiagnosticSetting("example", new()
 *     {
 *         Name = "setting1",
 *         StorageAccountId = exampleAccount.Id,
 *         EnabledLogs = new[]
 *         {
 *             new Azure.Monitoring.Inputs.AadDiagnosticSettingEnabledLogArgs
 *             {
 *                 Category = "SignInLogs",
 *                 RetentionPolicy = new Azure.Monitoring.Inputs.AadDiagnosticSettingEnabledLogRetentionPolicyArgs
 *                 {
 *                     Enabled = true,
 *                     Days = 1,
 *                 },
 *             },
 *             new Azure.Monitoring.Inputs.AadDiagnosticSettingEnabledLogArgs
 *             {
 *                 Category = "AuditLogs",
 *                 RetentionPolicy = new Azure.Monitoring.Inputs.AadDiagnosticSettingEnabledLogRetentionPolicyArgs
 *                 {
 *                     Enabled = true,
 *                     Days = 1,
 *                 },
 *             },
 *             new Azure.Monitoring.Inputs.AadDiagnosticSettingEnabledLogArgs
 *             {
 *                 Category = "NonInteractiveUserSignInLogs",
 *                 RetentionPolicy = new Azure.Monitoring.Inputs.AadDiagnosticSettingEnabledLogRetentionPolicyArgs
 *                 {
 *                     Enabled = true,
 *                     Days = 1,
 *                 },
 *             },
 *             new Azure.Monitoring.Inputs.AadDiagnosticSettingEnabledLogArgs
 *             {
 *                 Category = "ServicePrincipalSignInLogs",
 *                 RetentionPolicy = new Azure.Monitoring.Inputs.AadDiagnosticSettingEnabledLogRetentionPolicyArgs
 *                 {
 *                     Enabled = true,
 *                     Days = 1,
 *                 },
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/monitoring"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
 * 			Name:     pulumi.String("example-rg"),
 * 			Location: pulumi.String("west europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleAccount, err := storage.NewAccount(ctx, "example", &storage.AccountArgs{
 * 			Name:                   pulumi.String("examplestorageaccount"),
 * 			ResourceGroupName:      example.Name,
 * 			Location:               example.Location,
 * 			AccountTier:            pulumi.String("Standard"),
 * 			AccountKind:            pulumi.String("StorageV2"),
 * 			AccountReplicationType: pulumi.String("LRS"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = monitoring.NewAadDiagnosticSetting(ctx, "example", &monitoring.AadDiagnosticSettingArgs{
 * 			Name:             pulumi.String("setting1"),
 * 			StorageAccountId: exampleAccount.ID(),
 * 			EnabledLogs: monitoring.AadDiagnosticSettingEnabledLogArray{
 * 				&monitoring.AadDiagnosticSettingEnabledLogArgs{
 * 					Category: pulumi.String("SignInLogs"),
 * 					RetentionPolicy: &monitoring.AadDiagnosticSettingEnabledLogRetentionPolicyArgs{
 * 						Enabled: pulumi.Bool(true),
 * 						Days:    pulumi.Int(1),
 * 					},
 * 				},
 * 				&monitoring.AadDiagnosticSettingEnabledLogArgs{
 * 					Category: pulumi.String("AuditLogs"),
 * 					RetentionPolicy: &monitoring.AadDiagnosticSettingEnabledLogRetentionPolicyArgs{
 * 						Enabled: pulumi.Bool(true),
 * 						Days:    pulumi.Int(1),
 * 					},
 * 				},
 * 				&monitoring.AadDiagnosticSettingEnabledLogArgs{
 * 					Category: pulumi.String("NonInteractiveUserSignInLogs"),
 * 					RetentionPolicy: &monitoring.AadDiagnosticSettingEnabledLogRetentionPolicyArgs{
 * 						Enabled: pulumi.Bool(true),
 * 						Days:    pulumi.Int(1),
 * 					},
 * 				},
 * 				&monitoring.AadDiagnosticSettingEnabledLogArgs{
 * 					Category: pulumi.String("ServicePrincipalSignInLogs"),
 * 					RetentionPolicy: &monitoring.AadDiagnosticSettingEnabledLogRetentionPolicyArgs{
 * 						Enabled: pulumi.Bool(true),
 * 						Days:    pulumi.Int(1),
 * 					},
 * 				},
 * 			},
 * 		})
 * 		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.azure.core.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.storage.Account;
 * import com.pulumi.azure.storage.AccountArgs;
 * import com.pulumi.azure.monitoring.AadDiagnosticSetting;
 * import com.pulumi.azure.monitoring.AadDiagnosticSettingArgs;
 * import com.pulumi.azure.monitoring.inputs.AadDiagnosticSettingEnabledLogArgs;
 * import com.pulumi.azure.monitoring.inputs.AadDiagnosticSettingEnabledLogRetentionPolicyArgs;
 * 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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
 *             .name("example-rg")
 *             .location("west europe")
 *             .build());
 *         var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
 *             .name("examplestorageaccount")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .accountTier("Standard")
 *             .accountKind("StorageV2")
 *             .accountReplicationType("LRS")
 *             .build());
 *         var exampleAadDiagnosticSetting = new AadDiagnosticSetting("exampleAadDiagnosticSetting", AadDiagnosticSettingArgs.builder()
 *             .name("setting1")
 *             .storageAccountId(exampleAccount.id())
 *             .enabledLogs(
 *                 AadDiagnosticSettingEnabledLogArgs.builder()
 *                     .category("SignInLogs")
 *                     .retentionPolicy(AadDiagnosticSettingEnabledLogRetentionPolicyArgs.builder()
 *                         .enabled(true)
 *                         .days(1)
 *                         .build())
 *                     .build(),
 *                 AadDiagnosticSettingEnabledLogArgs.builder()
 *                     .category("AuditLogs")
 *                     .retentionPolicy(AadDiagnosticSettingEnabledLogRetentionPolicyArgs.builder()
 *                         .enabled(true)
 *                         .days(1)
 *                         .build())
 *                     .build(),
 *                 AadDiagnosticSettingEnabledLogArgs.builder()
 *                     .category("NonInteractiveUserSignInLogs")
 *                     .retentionPolicy(AadDiagnosticSettingEnabledLogRetentionPolicyArgs.builder()
 *                         .enabled(true)
 *                         .days(1)
 *                         .build())
 *                     .build(),
 *                 AadDiagnosticSettingEnabledLogArgs.builder()
 *                     .category("ServicePrincipalSignInLogs")
 *                     .retentionPolicy(AadDiagnosticSettingEnabledLogRetentionPolicyArgs.builder()
 *                         .enabled(true)
 *                         .days(1)
 *                         .build())
 *                     .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-rg
 *       location: west europe
 *   exampleAccount:
 *     type: azure:storage:Account
 *     name: example
 *     properties:
 *       name: examplestorageaccount
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       accountTier: Standard
 *       accountKind: StorageV2
 *       accountReplicationType: LRS
 *   exampleAadDiagnosticSetting:
 *     type: azure:monitoring:AadDiagnosticSetting
 *     name: example
 *     properties:
 *       name: setting1
 *       storageAccountId: ${exampleAccount.id}
 *       enabledLogs:
 *         - category: SignInLogs
 *           retentionPolicy:
 *             enabled: true
 *             days: 1
 *         - category: AuditLogs
 *           retentionPolicy:
 *             enabled: true
 *             days: 1
 *         - category: NonInteractiveUserSignInLogs
 *           retentionPolicy:
 *             enabled: true
 *             days: 1
 *         - category: ServicePrincipalSignInLogs
 *           retentionPolicy:
 *             enabled: true
 *             days: 1
 * ```
 * 
 * ## Import
 * Monitor Azure Active Directory Diagnostic Settings can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:monitoring/aadDiagnosticSetting:AadDiagnosticSetting example /providers/Microsoft.AADIAM/diagnosticSettings/setting1
 * ```
 * @property enabledLogs One or more `enabled_log` blocks as defined below.
 * > **NOTE:** At least one `log` or `enabled_log` block must be specified. At least one type of Log must be enabled.
 * @property eventhubAuthorizationRuleId Specifies the ID of an Event Hub Namespace Authorization Rule used to send Diagnostics Data. Changing this forces a new resource to be created.
 * > **NOTE:** This can be sourced from the `azure.eventhub.EventHubNamespaceAuthorizationRule` resource and is different from a `azure.eventhub.AuthorizationRule` resource.
 * @property eventhubName Specifies the name of the Event Hub where Diagnostics Data should be sent. If not specified, the default Event Hub will be used. Changing this forces a new resource to be created.
 * @property logAnalyticsWorkspaceId Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.
 * @property logs One or more `log` blocks as defined below.
 * > **NOTE:** `log` is deprecated in favour of the `enabled_log` property and will be removed in version 4.0 of the AzureRM Provider.
 * @property name The name which should be used for this Monitor Azure Active Directory Diagnostic Setting. Changing this forces a new Monitor Azure Active Directory Diagnostic Setting to be created.
 * @property storageAccountId The ID of the Storage Account where logs should be sent. Changing this forces a new resource to be created.
 * > **NOTE:** One of `eventhub_authorization_rule_id`, `log_analytics_workspace_id` and `storage_account_id` must be specified.
 */
public data class AadDiagnosticSettingArgs(
    public val enabledLogs: Output>? = null,
    public val eventhubAuthorizationRuleId: Output? = null,
    public val eventhubName: Output? = null,
    public val logAnalyticsWorkspaceId: Output? = null,
    @Deprecated(
        message = """
  `log` has been superseded by `enabled_log` and will be removed in version 4.0 of the AzureRM
      Provider.
  """,
    )
    public val logs: Output>? = null,
    public val name: Output? = null,
    public val storageAccountId: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.monitoring.AadDiagnosticSettingArgs =
        com.pulumi.azure.monitoring.AadDiagnosticSettingArgs.builder()
            .enabledLogs(
                enabledLogs?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .eventhubAuthorizationRuleId(eventhubAuthorizationRuleId?.applyValue({ args0 -> args0 }))
            .eventhubName(eventhubName?.applyValue({ args0 -> args0 }))
            .logAnalyticsWorkspaceId(logAnalyticsWorkspaceId?.applyValue({ args0 -> args0 }))
            .logs(logs?.applyValue({ args0 -> args0.map({ args0 -> args0.let({ args0 -> args0.toJava() }) }) }))
            .name(name?.applyValue({ args0 -> args0 }))
            .storageAccountId(storageAccountId?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [AadDiagnosticSettingArgs].
 */
@PulumiTagMarker
public class AadDiagnosticSettingArgsBuilder internal constructor() {
    private var enabledLogs: Output>? = null

    private var eventhubAuthorizationRuleId: Output? = null

    private var eventhubName: Output? = null

    private var logAnalyticsWorkspaceId: Output? = null

    private var logs: Output>? = null

    private var name: Output? = null

    private var storageAccountId: Output? = null

    /**
     * @param value One or more `enabled_log` blocks as defined below.
     * > **NOTE:** At least one `log` or `enabled_log` block must be specified. At least one type of Log must be enabled.
     */
    @JvmName("togcrxbxnfqfmwun")
    public suspend fun enabledLogs(`value`: Output>) {
        this.enabledLogs = value
    }

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

    /**
     * @param values One or more `enabled_log` blocks as defined below.
     * > **NOTE:** At least one `log` or `enabled_log` block must be specified. At least one type of Log must be enabled.
     */
    @JvmName("emxenfcmbbieuqit")
    public suspend fun enabledLogs(values: List>) {
        this.enabledLogs = Output.all(values)
    }

    /**
     * @param value Specifies the ID of an Event Hub Namespace Authorization Rule used to send Diagnostics Data. Changing this forces a new resource to be created.
     * > **NOTE:** This can be sourced from the `azure.eventhub.EventHubNamespaceAuthorizationRule` resource and is different from a `azure.eventhub.AuthorizationRule` resource.
     */
    @JvmName("ckmfevmdxhqbhvxg")
    public suspend fun eventhubAuthorizationRuleId(`value`: Output) {
        this.eventhubAuthorizationRuleId = value
    }

    /**
     * @param value Specifies the name of the Event Hub where Diagnostics Data should be sent. If not specified, the default Event Hub will be used. Changing this forces a new resource to be created.
     */
    @JvmName("xxifpmxtjnmlhatq")
    public suspend fun eventhubName(`value`: Output) {
        this.eventhubName = value
    }

    /**
     * @param value Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.
     */
    @JvmName("jyqjukdmrqlosatk")
    public suspend fun logAnalyticsWorkspaceId(`value`: Output) {
        this.logAnalyticsWorkspaceId = value
    }

    /**
     * @param value One or more `log` blocks as defined below.
     * > **NOTE:** `log` is deprecated in favour of the `enabled_log` property and will be removed in version 4.0 of the AzureRM Provider.
     */
    @Deprecated(
        message = """
  `log` has been superseded by `enabled_log` and will be removed in version 4.0 of the AzureRM
      Provider.
  """,
    )
    @JvmName("mqsrxjufbvvxjdtx")
    public suspend fun logs(`value`: Output>) {
        this.logs = value
    }

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

    /**
     * @param values One or more `log` blocks as defined below.
     * > **NOTE:** `log` is deprecated in favour of the `enabled_log` property and will be removed in version 4.0 of the AzureRM Provider.
     */
    @Deprecated(
        message = """
  `log` has been superseded by `enabled_log` and will be removed in version 4.0 of the AzureRM
      Provider.
  """,
    )
    @JvmName("eqrcsgxvawvdwynd")
    public suspend fun logs(values: List>) {
        this.logs = Output.all(values)
    }

    /**
     * @param value The name which should be used for this Monitor Azure Active Directory Diagnostic Setting. Changing this forces a new Monitor Azure Active Directory Diagnostic Setting to be created.
     */
    @JvmName("ugknmmvnvmlvmbdj")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The ID of the Storage Account where logs should be sent. Changing this forces a new resource to be created.
     * > **NOTE:** One of `eventhub_authorization_rule_id`, `log_analytics_workspace_id` and `storage_account_id` must be specified.
     */
    @JvmName("xrhgeglfiluswcps")
    public suspend fun storageAccountId(`value`: Output) {
        this.storageAccountId = value
    }

    /**
     * @param value One or more `enabled_log` blocks as defined below.
     * > **NOTE:** At least one `log` or `enabled_log` block must be specified. At least one type of Log must be enabled.
     */
    @JvmName("oduhsvkqmlflbtgr")
    public suspend fun enabledLogs(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.enabledLogs = mapped
    }

    /**
     * @param argument One or more `enabled_log` blocks as defined below.
     * > **NOTE:** At least one `log` or `enabled_log` block must be specified. At least one type of Log must be enabled.
     */
    @JvmName("haiqyehombwbrovg")
    public suspend
    fun enabledLogs(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            AadDiagnosticSettingEnabledLogArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.enabledLogs = mapped
    }

    /**
     * @param argument One or more `enabled_log` blocks as defined below.
     * > **NOTE:** At least one `log` or `enabled_log` block must be specified. At least one type of Log must be enabled.
     */
    @JvmName("oerxqakrknrkndow")
    public suspend fun enabledLogs(
        vararg
        argument: suspend AadDiagnosticSettingEnabledLogArgsBuilder.() -> Unit,
    ) {
        val toBeMapped = argument.toList().map {
            AadDiagnosticSettingEnabledLogArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.enabledLogs = mapped
    }

    /**
     * @param argument One or more `enabled_log` blocks as defined below.
     * > **NOTE:** At least one `log` or `enabled_log` block must be specified. At least one type of Log must be enabled.
     */
    @JvmName("uyohthmqibpjgpda")
    public suspend
    fun enabledLogs(argument: suspend AadDiagnosticSettingEnabledLogArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            AadDiagnosticSettingEnabledLogArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.enabledLogs = mapped
    }

    /**
     * @param values One or more `enabled_log` blocks as defined below.
     * > **NOTE:** At least one `log` or `enabled_log` block must be specified. At least one type of Log must be enabled.
     */
    @JvmName("cpwnbtpjbhrecpfa")
    public suspend fun enabledLogs(vararg values: AadDiagnosticSettingEnabledLogArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.enabledLogs = mapped
    }

    /**
     * @param value Specifies the ID of an Event Hub Namespace Authorization Rule used to send Diagnostics Data. Changing this forces a new resource to be created.
     * > **NOTE:** This can be sourced from the `azure.eventhub.EventHubNamespaceAuthorizationRule` resource and is different from a `azure.eventhub.AuthorizationRule` resource.
     */
    @JvmName("gjrkkasxoelcikak")
    public suspend fun eventhubAuthorizationRuleId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.eventhubAuthorizationRuleId = mapped
    }

    /**
     * @param value Specifies the name of the Event Hub where Diagnostics Data should be sent. If not specified, the default Event Hub will be used. Changing this forces a new resource to be created.
     */
    @JvmName("dawiojexgiutfxbp")
    public suspend fun eventhubName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.eventhubName = mapped
    }

    /**
     * @param value Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.
     */
    @JvmName("ncgxncspisynjvej")
    public suspend fun logAnalyticsWorkspaceId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.logAnalyticsWorkspaceId = mapped
    }

    /**
     * @param value One or more `log` blocks as defined below.
     * > **NOTE:** `log` is deprecated in favour of the `enabled_log` property and will be removed in version 4.0 of the AzureRM Provider.
     */
    @Deprecated(
        message = """
  `log` has been superseded by `enabled_log` and will be removed in version 4.0 of the AzureRM
      Provider.
  """,
    )
    @JvmName("oukslmimddpndmhl")
    public suspend fun logs(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.logs = mapped
    }

    /**
     * @param argument One or more `log` blocks as defined below.
     * > **NOTE:** `log` is deprecated in favour of the `enabled_log` property and will be removed in version 4.0 of the AzureRM Provider.
     */
    @Deprecated(
        message = """
  `log` has been superseded by `enabled_log` and will be removed in version 4.0 of the AzureRM
      Provider.
  """,
    )
    @JvmName("cpkqvhcmndykokim")
    public suspend fun logs(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            AadDiagnosticSettingLogArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.logs = mapped
    }

    /**
     * @param argument One or more `log` blocks as defined below.
     * > **NOTE:** `log` is deprecated in favour of the `enabled_log` property and will be removed in version 4.0 of the AzureRM Provider.
     */
    @Deprecated(
        message = """
  `log` has been superseded by `enabled_log` and will be removed in version 4.0 of the AzureRM
      Provider.
  """,
    )
    @JvmName("sexuuyiqlxmsgusv")
    public suspend fun logs(vararg argument: suspend AadDiagnosticSettingLogArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            AadDiagnosticSettingLogArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.logs = mapped
    }

    /**
     * @param argument One or more `log` blocks as defined below.
     * > **NOTE:** `log` is deprecated in favour of the `enabled_log` property and will be removed in version 4.0 of the AzureRM Provider.
     */
    @Deprecated(
        message = """
  `log` has been superseded by `enabled_log` and will be removed in version 4.0 of the AzureRM
      Provider.
  """,
    )
    @JvmName("jytmsksbhjamjrme")
    public suspend fun logs(argument: suspend AadDiagnosticSettingLogArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            AadDiagnosticSettingLogArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.logs = mapped
    }

    /**
     * @param values One or more `log` blocks as defined below.
     * > **NOTE:** `log` is deprecated in favour of the `enabled_log` property and will be removed in version 4.0 of the AzureRM Provider.
     */
    @Deprecated(
        message = """
  `log` has been superseded by `enabled_log` and will be removed in version 4.0 of the AzureRM
      Provider.
  """,
    )
    @JvmName("xlnxscvnpgyqjfcd")
    public suspend fun logs(vararg values: AadDiagnosticSettingLogArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.logs = mapped
    }

    /**
     * @param value The name which should be used for this Monitor Azure Active Directory Diagnostic Setting. Changing this forces a new Monitor Azure Active Directory Diagnostic Setting to be created.
     */
    @JvmName("ekdrjbdqdjvighdh")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The ID of the Storage Account where logs should be sent. Changing this forces a new resource to be created.
     * > **NOTE:** One of `eventhub_authorization_rule_id`, `log_analytics_workspace_id` and `storage_account_id` must be specified.
     */
    @JvmName("rsvdtkjlxxifxpbl")
    public suspend fun storageAccountId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.storageAccountId = mapped
    }

    internal fun build(): AadDiagnosticSettingArgs = AadDiagnosticSettingArgs(
        enabledLogs = enabledLogs,
        eventhubAuthorizationRuleId = eventhubAuthorizationRuleId,
        eventhubName = eventhubName,
        logAnalyticsWorkspaceId = logAnalyticsWorkspaceId,
        logs = logs,
        name = name,
        storageAccountId = storageAccountId,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy