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

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

package com.pulumi.azure.operationalinsights.kotlin

import com.pulumi.azure.operationalinsights.AnalyticsSolutionArgs.builder
import com.pulumi.azure.operationalinsights.kotlin.inputs.AnalyticsSolutionPlanArgs
import com.pulumi.azure.operationalinsights.kotlin.inputs.AnalyticsSolutionPlanArgsBuilder
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.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Manages a Log Analytics (formally Operational Insights) Solution.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * import * as random from "@pulumi/random";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "k8s-log-analytics-test",
 *     location: "West Europe",
 * });
 * const workspace = new random.RandomId("workspace", {
 *     keepers: {
 *         group_name: example.name,
 *     },
 *     byteLength: 8,
 * });
 * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("example", {
 *     name: pulumi.interpolate`k8s-workspace-${workspace.hex}`,
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     sku: "PerGB2018",
 * });
 * const exampleAnalyticsSolution = new azure.operationalinsights.AnalyticsSolution("example", {
 *     solutionName: "ContainerInsights",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     workspaceResourceId: exampleAnalyticsWorkspace.id,
 *     workspaceName: exampleAnalyticsWorkspace.name,
 *     plan: {
 *         publisher: "Microsoft",
 *         product: "OMSGallery/ContainerInsights",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * import pulumi_random as random
 * example = azure.core.ResourceGroup("example",
 *     name="k8s-log-analytics-test",
 *     location="West Europe")
 * workspace = random.RandomId("workspace",
 *     keepers={
 *         "group_name": example.name,
 *     },
 *     byte_length=8)
 * example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("example",
 *     name=workspace.hex.apply(lambda hex: f"k8s-workspace-{hex}"),
 *     location=example.location,
 *     resource_group_name=example.name,
 *     sku="PerGB2018")
 * example_analytics_solution = azure.operationalinsights.AnalyticsSolution("example",
 *     solution_name="ContainerInsights",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     workspace_resource_id=example_analytics_workspace.id,
 *     workspace_name=example_analytics_workspace.name,
 *     plan=azure.operationalinsights.AnalyticsSolutionPlanArgs(
 *         publisher="Microsoft",
 *         product="OMSGallery/ContainerInsights",
 *     ))
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * using Random = Pulumi.Random;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Azure.Core.ResourceGroup("example", new()
 *     {
 *         Name = "k8s-log-analytics-test",
 *         Location = "West Europe",
 *     });
 *     var workspace = new Random.RandomId("workspace", new()
 *     {
 *         Keepers =
 *         {
 *             { "group_name", example.Name },
 *         },
 *         ByteLength = 8,
 *     });
 *     var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("example", new()
 *     {
 *         Name = workspace.Hex.Apply(hex => $"k8s-workspace-{hex}"),
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         Sku = "PerGB2018",
 *     });
 *     var exampleAnalyticsSolution = new Azure.OperationalInsights.AnalyticsSolution("example", new()
 *     {
 *         SolutionName = "ContainerInsights",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         WorkspaceResourceId = exampleAnalyticsWorkspace.Id,
 *         WorkspaceName = exampleAnalyticsWorkspace.Name,
 *         Plan = new Azure.OperationalInsights.Inputs.AnalyticsSolutionPlanArgs
 *         {
 *             Publisher = "Microsoft",
 *             Product = "OMSGallery/ContainerInsights",
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"fmt"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights"
 * 	"github.com/pulumi/pulumi-random/sdk/v4/go/random"
 * 	"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("k8s-log-analytics-test"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		workspace, err := random.NewRandomId(ctx, "workspace", &random.RandomIdArgs{
 * 			Keepers: pulumi.StringMap{
 * 				"group_name": example.Name,
 * 			},
 * 			ByteLength: pulumi.Int(8),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "example", &operationalinsights.AnalyticsWorkspaceArgs{
 * 			Name: workspace.Hex.ApplyT(func(hex string) (string, error) {
 * 				return fmt.Sprintf("k8s-workspace-%v", hex), nil
 * 			}).(pulumi.StringOutput),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			Sku:               pulumi.String("PerGB2018"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = operationalinsights.NewAnalyticsSolution(ctx, "example", &operationalinsights.AnalyticsSolutionArgs{
 * 			SolutionName:        pulumi.String("ContainerInsights"),
 * 			Location:            example.Location,
 * 			ResourceGroupName:   example.Name,
 * 			WorkspaceResourceId: exampleAnalyticsWorkspace.ID(),
 * 			WorkspaceName:       exampleAnalyticsWorkspace.Name,
 * 			Plan: &operationalinsights.AnalyticsSolutionPlanArgs{
 * 				Publisher: pulumi.String("Microsoft"),
 * 				Product:   pulumi.String("OMSGallery/ContainerInsights"),
 * 			},
 * 		})
 * 		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.random.RandomId;
 * import com.pulumi.random.RandomIdArgs;
 * import com.pulumi.azure.operationalinsights.AnalyticsWorkspace;
 * import com.pulumi.azure.operationalinsights.AnalyticsWorkspaceArgs;
 * import com.pulumi.azure.operationalinsights.AnalyticsSolution;
 * import com.pulumi.azure.operationalinsights.AnalyticsSolutionArgs;
 * import com.pulumi.azure.operationalinsights.inputs.AnalyticsSolutionPlanArgs;
 * 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("k8s-log-analytics-test")
 *             .location("West Europe")
 *             .build());
 *         var workspace = new RandomId("workspace", RandomIdArgs.builder()
 *             .keepers(Map.of("group_name", example.name()))
 *             .byteLength(8)
 *             .build());
 *         var exampleAnalyticsWorkspace = new AnalyticsWorkspace("exampleAnalyticsWorkspace", AnalyticsWorkspaceArgs.builder()
 *             .name(workspace.hex().applyValue(hex -> String.format("k8s-workspace-%s", hex)))
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .sku("PerGB2018")
 *             .build());
 *         var exampleAnalyticsSolution = new AnalyticsSolution("exampleAnalyticsSolution", AnalyticsSolutionArgs.builder()
 *             .solutionName("ContainerInsights")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .workspaceResourceId(exampleAnalyticsWorkspace.id())
 *             .workspaceName(exampleAnalyticsWorkspace.name())
 *             .plan(AnalyticsSolutionPlanArgs.builder()
 *                 .publisher("Microsoft")
 *                 .product("OMSGallery/ContainerInsights")
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: k8s-log-analytics-test
 *       location: West Europe
 *   workspace:
 *     type: random:RandomId
 *     properties:
 *       keepers:
 *         group_name: ${example.name}
 *       byteLength: 8
 *   exampleAnalyticsWorkspace:
 *     type: azure:operationalinsights:AnalyticsWorkspace
 *     name: example
 *     properties:
 *       name: k8s-workspace-${workspace.hex}
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       sku: PerGB2018
 *   exampleAnalyticsSolution:
 *     type: azure:operationalinsights:AnalyticsSolution
 *     name: example
 *     properties:
 *       solutionName: ContainerInsights
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       workspaceResourceId: ${exampleAnalyticsWorkspace.id}
 *       workspaceName: ${exampleAnalyticsWorkspace.name}
 *       plan:
 *         publisher: Microsoft
 *         product: OMSGallery/ContainerInsights
 * ```
 * 
 * ## Import
 * Log Analytics Solutions can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:operationalinsights/analyticsSolution:AnalyticsSolution solution1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.OperationsManagement/solutions/solution1
 * ```
 * @property location Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
 * @property plan A `plan` block as documented below.
 * @property resourceGroupName The name of the resource group in which the Log Analytics solution is created. Changing this forces a new resource to be created. Note: The solution and its related workspace can only exist in the same resource group.
 * @property solutionName Specifies the name of the solution to be deployed. See [here for options](https://docs.microsoft.com/azure/log-analytics/log-analytics-add-solutions).Changing this forces a new resource to be created.
 * @property tags A mapping of tags to assign to the resource.
 * @property workspaceName The full name of the Log Analytics workspace with which the solution will be linked. Changing this forces a new resource to be created.
 * @property workspaceResourceId The full resource ID of the Log Analytics workspace with which the solution will be linked. Changing this forces a new resource to be created.
 */
public data class AnalyticsSolutionArgs(
    public val location: Output? = null,
    public val plan: Output? = null,
    public val resourceGroupName: Output? = null,
    public val solutionName: Output? = null,
    public val tags: Output>? = null,
    public val workspaceName: Output? = null,
    public val workspaceResourceId: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.operationalinsights.AnalyticsSolutionArgs =
        com.pulumi.azure.operationalinsights.AnalyticsSolutionArgs.builder()
            .location(location?.applyValue({ args0 -> args0 }))
            .plan(plan?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .solutionName(solutionName?.applyValue({ args0 -> args0 }))
            .tags(tags?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .workspaceName(workspaceName?.applyValue({ args0 -> args0 }))
            .workspaceResourceId(workspaceResourceId?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [AnalyticsSolutionArgs].
 */
@PulumiTagMarker
public class AnalyticsSolutionArgsBuilder internal constructor() {
    private var location: Output? = null

    private var plan: Output? = null

    private var resourceGroupName: Output? = null

    private var solutionName: Output? = null

    private var tags: Output>? = null

    private var workspaceName: Output? = null

    private var workspaceResourceId: Output? = null

    /**
     * @param value Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
     */
    @JvmName("xkeahsbmcuistjcq")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

    /**
     * @param value A `plan` block as documented below.
     */
    @JvmName("cnjoilrupqnityag")
    public suspend fun plan(`value`: Output) {
        this.plan = value
    }

    /**
     * @param value The name of the resource group in which the Log Analytics solution is created. Changing this forces a new resource to be created. Note: The solution and its related workspace can only exist in the same resource group.
     */
    @JvmName("ymukpkermomfqwvv")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value Specifies the name of the solution to be deployed. See [here for options](https://docs.microsoft.com/azure/log-analytics/log-analytics-add-solutions).Changing this forces a new resource to be created.
     */
    @JvmName("ifsyeimramcxlauc")
    public suspend fun solutionName(`value`: Output) {
        this.solutionName = value
    }

    /**
     * @param value A mapping of tags to assign to the resource.
     */
    @JvmName("wpncundyedrotenl")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value The full name of the Log Analytics workspace with which the solution will be linked. Changing this forces a new resource to be created.
     */
    @JvmName("qekhybxlsahjtvnl")
    public suspend fun workspaceName(`value`: Output) {
        this.workspaceName = value
    }

    /**
     * @param value The full resource ID of the Log Analytics workspace with which the solution will be linked. Changing this forces a new resource to be created.
     */
    @JvmName("affduavaunspysuv")
    public suspend fun workspaceResourceId(`value`: Output) {
        this.workspaceResourceId = value
    }

    /**
     * @param value Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
     */
    @JvmName("lpnayvqiutowdmeb")
    public suspend fun location(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.location = mapped
    }

    /**
     * @param value A `plan` block as documented below.
     */
    @JvmName("haxywxgkxqjwcipu")
    public suspend fun plan(`value`: AnalyticsSolutionPlanArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.plan = mapped
    }

    /**
     * @param argument A `plan` block as documented below.
     */
    @JvmName("ewrjfvhuwatpgqjd")
    public suspend fun plan(argument: suspend AnalyticsSolutionPlanArgsBuilder.() -> Unit) {
        val toBeMapped = AnalyticsSolutionPlanArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.plan = mapped
    }

    /**
     * @param value The name of the resource group in which the Log Analytics solution is created. Changing this forces a new resource to be created. Note: The solution and its related workspace can only exist in the same resource group.
     */
    @JvmName("sycirxduoacbcdmc")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value Specifies the name of the solution to be deployed. See [here for options](https://docs.microsoft.com/azure/log-analytics/log-analytics-add-solutions).Changing this forces a new resource to be created.
     */
    @JvmName("idbvvirlapfxdblm")
    public suspend fun solutionName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.solutionName = mapped
    }

    /**
     * @param value A mapping of tags to assign to the resource.
     */
    @JvmName("bynllmgrpycdntdb")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values A mapping of tags to assign to the resource.
     */
    @JvmName("nkwlcprrpoxspmfs")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param value The full name of the Log Analytics workspace with which the solution will be linked. Changing this forces a new resource to be created.
     */
    @JvmName("mumygwqupypjhstg")
    public suspend fun workspaceName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.workspaceName = mapped
    }

    /**
     * @param value The full resource ID of the Log Analytics workspace with which the solution will be linked. Changing this forces a new resource to be created.
     */
    @JvmName("sfaajwlggwrshoiq")
    public suspend fun workspaceResourceId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.workspaceResourceId = mapped
    }

    internal fun build(): AnalyticsSolutionArgs = AnalyticsSolutionArgs(
        location = location,
        plan = plan,
        resourceGroupName = resourceGroupName,
        solutionName = solutionName,
        tags = tags,
        workspaceName = workspaceName,
        workspaceResourceId = workspaceResourceId,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy