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

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

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

package com.pulumi.azure.loganalytics.kotlin

import com.pulumi.azure.loganalytics.LinkedServiceArgs.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.jvm.JvmName

/**
 * Manages a Log Analytics Linked Service.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "resourcegroup-01",
 *     location: "West Europe",
 * });
 * const exampleAccount = new azure.automation.Account("example", {
 *     name: "automation-01",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     skuName: "Basic",
 *     tags: {
 *         environment: "development",
 *     },
 * });
 * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("example", {
 *     name: "workspace-01",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     sku: "PerGB2018",
 *     retentionInDays: 30,
 * });
 * const exampleLinkedService = new azure.loganalytics.LinkedService("example", {
 *     resourceGroupName: example.name,
 *     workspaceId: exampleAnalyticsWorkspace.id,
 *     readAccessId: exampleAccount.id,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="resourcegroup-01",
 *     location="West Europe")
 * example_account = azure.automation.Account("example",
 *     name="automation-01",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     sku_name="Basic",
 *     tags={
 *         "environment": "development",
 *     })
 * example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("example",
 *     name="workspace-01",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     sku="PerGB2018",
 *     retention_in_days=30)
 * example_linked_service = azure.loganalytics.LinkedService("example",
 *     resource_group_name=example.name,
 *     workspace_id=example_analytics_workspace.id,
 *     read_access_id=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 = "resourcegroup-01",
 *         Location = "West Europe",
 *     });
 *     var exampleAccount = new Azure.Automation.Account("example", new()
 *     {
 *         Name = "automation-01",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         SkuName = "Basic",
 *         Tags =
 *         {
 *             { "environment", "development" },
 *         },
 *     });
 *     var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("example", new()
 *     {
 *         Name = "workspace-01",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         Sku = "PerGB2018",
 *         RetentionInDays = 30,
 *     });
 *     var exampleLinkedService = new Azure.LogAnalytics.LinkedService("example", new()
 *     {
 *         ResourceGroupName = example.Name,
 *         WorkspaceId = exampleAnalyticsWorkspace.Id,
 *         ReadAccessId = exampleAccount.Id,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/automation"
 * 	"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/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
 * 			Name:     pulumi.String("resourcegroup-01"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleAccount, err := automation.NewAccount(ctx, "example", &automation.AccountArgs{
 * 			Name:              pulumi.String("automation-01"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			SkuName:           pulumi.String("Basic"),
 * 			Tags: pulumi.StringMap{
 * 				"environment": pulumi.String("development"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "example", &operationalinsights.AnalyticsWorkspaceArgs{
 * 			Name:              pulumi.String("workspace-01"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			Sku:               pulumi.String("PerGB2018"),
 * 			RetentionInDays:   pulumi.Int(30),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = loganalytics.NewLinkedService(ctx, "example", &loganalytics.LinkedServiceArgs{
 * 			ResourceGroupName: example.Name,
 * 			WorkspaceId:       exampleAnalyticsWorkspace.ID(),
 * 			ReadAccessId:      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.automation.Account;
 * import com.pulumi.azure.automation.AccountArgs;
 * import com.pulumi.azure.operationalinsights.AnalyticsWorkspace;
 * import com.pulumi.azure.operationalinsights.AnalyticsWorkspaceArgs;
 * import com.pulumi.azure.loganalytics.LinkedService;
 * import com.pulumi.azure.loganalytics.LinkedServiceArgs;
 * 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("resourcegroup-01")
 *             .location("West Europe")
 *             .build());
 *         var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
 *             .name("automation-01")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .skuName("Basic")
 *             .tags(Map.of("environment", "development"))
 *             .build());
 *         var exampleAnalyticsWorkspace = new AnalyticsWorkspace("exampleAnalyticsWorkspace", AnalyticsWorkspaceArgs.builder()
 *             .name("workspace-01")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .sku("PerGB2018")
 *             .retentionInDays(30)
 *             .build());
 *         var exampleLinkedService = new LinkedService("exampleLinkedService", LinkedServiceArgs.builder()
 *             .resourceGroupName(example.name())
 *             .workspaceId(exampleAnalyticsWorkspace.id())
 *             .readAccessId(exampleAccount.id())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: resourcegroup-01
 *       location: West Europe
 *   exampleAccount:
 *     type: azure:automation:Account
 *     name: example
 *     properties:
 *       name: automation-01
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       skuName: Basic
 *       tags:
 *         environment: development
 *   exampleAnalyticsWorkspace:
 *     type: azure:operationalinsights:AnalyticsWorkspace
 *     name: example
 *     properties:
 *       name: workspace-01
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       sku: PerGB2018
 *       retentionInDays: 30
 *   exampleLinkedService:
 *     type: azure:loganalytics:LinkedService
 *     name: example
 *     properties:
 *       resourceGroupName: ${example.name}
 *       workspaceId: ${exampleAnalyticsWorkspace.id}
 *       readAccessId: ${exampleAccount.id}
 * ```
 * 
 * ## Import
 * Log Analytics Workspaces can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:loganalytics/linkedService:LinkedService example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.OperationalInsights/workspaces/workspace1/linkedServices/Automation
 * ```
 * @property readAccessId The ID of the readable Resource that will be linked to the workspace. This should be used for linking to an Automation Account resource.
 * @property resourceGroupName The name of the resource group in which the Log Analytics Linked Service is created. Changing this forces a new resource to be created.
 * @property workspaceId The ID of the Log Analytics Workspace that will contain the Log Analytics Linked Service resource.
 * @property writeAccessId The ID of the writable Resource that will be linked to the workspace. This should be used for linking to a Log Analytics Cluster resource.
 * > **NOTE:** You must define at least one of the above access resource id attributes (e.g. `read_access_id` or `write_access_id`).
 */
public data class LinkedServiceArgs(
    public val readAccessId: Output? = null,
    public val resourceGroupName: Output? = null,
    public val workspaceId: Output? = null,
    public val writeAccessId: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.loganalytics.LinkedServiceArgs =
        com.pulumi.azure.loganalytics.LinkedServiceArgs.builder()
            .readAccessId(readAccessId?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .workspaceId(workspaceId?.applyValue({ args0 -> args0 }))
            .writeAccessId(writeAccessId?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [LinkedServiceArgs].
 */
@PulumiTagMarker
public class LinkedServiceArgsBuilder internal constructor() {
    private var readAccessId: Output? = null

    private var resourceGroupName: Output? = null

    private var workspaceId: Output? = null

    private var writeAccessId: Output? = null

    /**
     * @param value The ID of the readable Resource that will be linked to the workspace. This should be used for linking to an Automation Account resource.
     */
    @JvmName("dxkgnuxnbvdnedbj")
    public suspend fun readAccessId(`value`: Output) {
        this.readAccessId = value
    }

    /**
     * @param value The name of the resource group in which the Log Analytics Linked Service is created. Changing this forces a new resource to be created.
     */
    @JvmName("cpbsmaohpjswloes")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value The ID of the Log Analytics Workspace that will contain the Log Analytics Linked Service resource.
     */
    @JvmName("qvkguvpnnsuoyqnf")
    public suspend fun workspaceId(`value`: Output) {
        this.workspaceId = value
    }

    /**
     * @param value The ID of the writable Resource that will be linked to the workspace. This should be used for linking to a Log Analytics Cluster resource.
     * > **NOTE:** You must define at least one of the above access resource id attributes (e.g. `read_access_id` or `write_access_id`).
     */
    @JvmName("ywkmtyghxoldauhg")
    public suspend fun writeAccessId(`value`: Output) {
        this.writeAccessId = value
    }

    /**
     * @param value The ID of the readable Resource that will be linked to the workspace. This should be used for linking to an Automation Account resource.
     */
    @JvmName("lmsgxtatnhwjxggf")
    public suspend fun readAccessId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.readAccessId = mapped
    }

    /**
     * @param value The name of the resource group in which the Log Analytics Linked Service is created. Changing this forces a new resource to be created.
     */
    @JvmName("lknpveeipourchmf")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value The ID of the Log Analytics Workspace that will contain the Log Analytics Linked Service resource.
     */
    @JvmName("iluyvinpbawcofsw")
    public suspend fun workspaceId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.workspaceId = mapped
    }

    /**
     * @param value The ID of the writable Resource that will be linked to the workspace. This should be used for linking to a Log Analytics Cluster resource.
     * > **NOTE:** You must define at least one of the above access resource id attributes (e.g. `read_access_id` or `write_access_id`).
     */
    @JvmName("fbwdiqxjogtfkeue")
    public suspend fun writeAccessId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.writeAccessId = mapped
    }

    internal fun build(): LinkedServiceArgs = LinkedServiceArgs(
        readAccessId = readAccessId,
        resourceGroupName = resourceGroupName,
        workspaceId = workspaceId,
        writeAccessId = writeAccessId,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy