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

com.pulumi.azure.loganalytics.kotlin.LinkedStorageAccountArgs.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.loganalytics.kotlin

import com.pulumi.azure.loganalytics.LinkedStorageAccountArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * Manages a Log Analytics Linked Storage Account.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const exampleAccount = new azure.storage.Account("example", {
 *     name: "examplesa",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     accountTier: "Standard",
 *     accountReplicationType: "GRS",
 * });
 * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("example", {
 *     name: "exampleworkspace",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     sku: "PerGB2018",
 * });
 * const exampleLinkedStorageAccount = new azure.loganalytics.LinkedStorageAccount("example", {
 *     dataSourceType: "CustomLogs",
 *     resourceGroupName: example.name,
 *     workspaceResourceId: exampleAnalyticsWorkspace.id,
 *     storageAccountIds: [exampleAccount.id],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_account = azure.storage.Account("example",
 *     name="examplesa",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     account_tier="Standard",
 *     account_replication_type="GRS")
 * example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("example",
 *     name="exampleworkspace",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     sku="PerGB2018")
 * example_linked_storage_account = azure.loganalytics.LinkedStorageAccount("example",
 *     data_source_type="CustomLogs",
 *     resource_group_name=example.name,
 *     workspace_resource_id=example_analytics_workspace.id,
 *     storage_account_ids=[example_account.id])
 * ```
 * ```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-resources",
 *         Location = "West Europe",
 *     });
 *     var exampleAccount = new Azure.Storage.Account("example", new()
 *     {
 *         Name = "examplesa",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         AccountTier = "Standard",
 *         AccountReplicationType = "GRS",
 *     });
 *     var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("example", new()
 *     {
 *         Name = "exampleworkspace",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         Sku = "PerGB2018",
 *     });
 *     var exampleLinkedStorageAccount = new Azure.LogAnalytics.LinkedStorageAccount("example", new()
 *     {
 *         DataSourceType = "CustomLogs",
 *         ResourceGroupName = example.Name,
 *         WorkspaceResourceId = exampleAnalyticsWorkspace.Id,
 *         StorageAccountIds = new[]
 *         {
 *             exampleAccount.Id,
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/loganalytics"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights"
 * 	"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-resources"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleAccount, err := storage.NewAccount(ctx, "example", &storage.AccountArgs{
 * 			Name:                   pulumi.String("examplesa"),
 * 			ResourceGroupName:      example.Name,
 * 			Location:               example.Location,
 * 			AccountTier:            pulumi.String("Standard"),
 * 			AccountReplicationType: pulumi.String("GRS"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "example", &operationalinsights.AnalyticsWorkspaceArgs{
 * 			Name:              pulumi.String("exampleworkspace"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			Sku:               pulumi.String("PerGB2018"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = loganalytics.NewLinkedStorageAccount(ctx, "example", &loganalytics.LinkedStorageAccountArgs{
 * 			DataSourceType:      pulumi.String("CustomLogs"),
 * 			ResourceGroupName:   example.Name,
 * 			WorkspaceResourceId: exampleAnalyticsWorkspace.ID(),
 * 			StorageAccountIds: pulumi.StringArray{
 * 				exampleAccount.ID(),
 * 			},
 * 		})
 * 		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.operationalinsights.AnalyticsWorkspace;
 * import com.pulumi.azure.operationalinsights.AnalyticsWorkspaceArgs;
 * import com.pulumi.azure.loganalytics.LinkedStorageAccount;
 * import com.pulumi.azure.loganalytics.LinkedStorageAccountArgs;
 * 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-resources")
 *             .location("West Europe")
 *             .build());
 *         var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
 *             .name("examplesa")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .accountTier("Standard")
 *             .accountReplicationType("GRS")
 *             .build());
 *         var exampleAnalyticsWorkspace = new AnalyticsWorkspace("exampleAnalyticsWorkspace", AnalyticsWorkspaceArgs.builder()
 *             .name("exampleworkspace")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .sku("PerGB2018")
 *             .build());
 *         var exampleLinkedStorageAccount = new LinkedStorageAccount("exampleLinkedStorageAccount", LinkedStorageAccountArgs.builder()
 *             .dataSourceType("CustomLogs")
 *             .resourceGroupName(example.name())
 *             .workspaceResourceId(exampleAnalyticsWorkspace.id())
 *             .storageAccountIds(exampleAccount.id())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleAccount:
 *     type: azure:storage:Account
 *     name: example
 *     properties:
 *       name: examplesa
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       accountTier: Standard
 *       accountReplicationType: GRS
 *   exampleAnalyticsWorkspace:
 *     type: azure:operationalinsights:AnalyticsWorkspace
 *     name: example
 *     properties:
 *       name: exampleworkspace
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       sku: PerGB2018
 *   exampleLinkedStorageAccount:
 *     type: azure:loganalytics:LinkedStorageAccount
 *     name: example
 *     properties:
 *       dataSourceType: CustomLogs
 *       resourceGroupName: ${example.name}
 *       workspaceResourceId: ${exampleAnalyticsWorkspace.id}
 *       storageAccountIds:
 *         - ${exampleAccount.id}
 * ```
 * 
 * ## Import
 * Log Analytics Linked Storage Accounts can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:loganalytics/linkedStorageAccount:LinkedStorageAccount example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.OperationalInsights/workspaces/workspace1/linkedStorageAccounts/{dataSourceType}
 * ```
 * @property dataSourceType The data source type which should be used for this Log Analytics Linked Storage Account. Possible values are `CustomLogs`, `AzureWatson`, `Query`, `Ingestion` and `Alerts`. Changing this forces a new Log Analytics Linked Storage Account to be created.
 * > **Note:** The `data_source_type` is case-insensitive in current 3.x version. And in 4.0 or later versions, Case-sensitivity will be required.
 * @property resourceGroupName The name of the Resource Group where the Log Analytics Linked Storage Account should exist. Changing this forces a new Log Analytics Linked Storage Account to be created.
 * @property storageAccountIds The storage account resource ids to be linked.
 * @property workspaceResourceId The resource ID of the Log Analytics Workspace. Changing this forces a new Log Analytics Linked Storage Account to be created.
 */
public data class LinkedStorageAccountArgs(
    public val dataSourceType: Output? = null,
    public val resourceGroupName: Output? = null,
    public val storageAccountIds: Output>? = null,
    public val workspaceResourceId: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.loganalytics.LinkedStorageAccountArgs =
        com.pulumi.azure.loganalytics.LinkedStorageAccountArgs.builder()
            .dataSourceType(dataSourceType?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .storageAccountIds(storageAccountIds?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .workspaceResourceId(workspaceResourceId?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [LinkedStorageAccountArgs].
 */
@PulumiTagMarker
public class LinkedStorageAccountArgsBuilder internal constructor() {
    private var dataSourceType: Output? = null

    private var resourceGroupName: Output? = null

    private var storageAccountIds: Output>? = null

    private var workspaceResourceId: Output? = null

    /**
     * @param value The data source type which should be used for this Log Analytics Linked Storage Account. Possible values are `CustomLogs`, `AzureWatson`, `Query`, `Ingestion` and `Alerts`. Changing this forces a new Log Analytics Linked Storage Account to be created.
     * > **Note:** The `data_source_type` is case-insensitive in current 3.x version. And in 4.0 or later versions, Case-sensitivity will be required.
     */
    @JvmName("mwsqicymbuvfqlax")
    public suspend fun dataSourceType(`value`: Output) {
        this.dataSourceType = value
    }

    /**
     * @param value The name of the Resource Group where the Log Analytics Linked Storage Account should exist. Changing this forces a new Log Analytics Linked Storage Account to be created.
     */
    @JvmName("mshinrhqkulowhdh")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value The storage account resource ids to be linked.
     */
    @JvmName("krqmvjichcdfxwyy")
    public suspend fun storageAccountIds(`value`: Output>) {
        this.storageAccountIds = value
    }

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

    /**
     * @param values The storage account resource ids to be linked.
     */
    @JvmName("hdlnbstwjnwjhilo")
    public suspend fun storageAccountIds(values: List>) {
        this.storageAccountIds = Output.all(values)
    }

    /**
     * @param value The resource ID of the Log Analytics Workspace. Changing this forces a new Log Analytics Linked Storage Account to be created.
     */
    @JvmName("eyxttjhdvgyujsgl")
    public suspend fun workspaceResourceId(`value`: Output) {
        this.workspaceResourceId = value
    }

    /**
     * @param value The data source type which should be used for this Log Analytics Linked Storage Account. Possible values are `CustomLogs`, `AzureWatson`, `Query`, `Ingestion` and `Alerts`. Changing this forces a new Log Analytics Linked Storage Account to be created.
     * > **Note:** The `data_source_type` is case-insensitive in current 3.x version. And in 4.0 or later versions, Case-sensitivity will be required.
     */
    @JvmName("pfhalifkftcmtcnd")
    public suspend fun dataSourceType(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.dataSourceType = mapped
    }

    /**
     * @param value The name of the Resource Group where the Log Analytics Linked Storage Account should exist. Changing this forces a new Log Analytics Linked Storage Account to be created.
     */
    @JvmName("gliwomyxqilujkrx")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value The storage account resource ids to be linked.
     */
    @JvmName("ikphtywjjpwxnjdc")
    public suspend fun storageAccountIds(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.storageAccountIds = mapped
    }

    /**
     * @param values The storage account resource ids to be linked.
     */
    @JvmName("qapmmpobbntgmnwn")
    public suspend fun storageAccountIds(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.storageAccountIds = mapped
    }

    /**
     * @param value The resource ID of the Log Analytics Workspace. Changing this forces a new Log Analytics Linked Storage Account to be created.
     */
    @JvmName("umqygqowwlddmwhv")
    public suspend fun workspaceResourceId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.workspaceResourceId = mapped
    }

    internal fun build(): LinkedStorageAccountArgs = LinkedStorageAccountArgs(
        dataSourceType = dataSourceType,
        resourceGroupName = resourceGroupName,
        storageAccountIds = storageAccountIds,
        workspaceResourceId = workspaceResourceId,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy