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

com.pulumi.azure.containerapp.kotlin.EnvironmentDaprComponentArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.azure.containerapp.kotlin

import com.pulumi.azure.containerapp.EnvironmentDaprComponentArgs.builder
import com.pulumi.azure.containerapp.kotlin.inputs.EnvironmentDaprComponentMetadataArgs
import com.pulumi.azure.containerapp.kotlin.inputs.EnvironmentDaprComponentMetadataArgsBuilder
import com.pulumi.azure.containerapp.kotlin.inputs.EnvironmentDaprComponentSecretArgs
import com.pulumi.azure.containerapp.kotlin.inputs.EnvironmentDaprComponentSecretArgsBuilder
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.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * Manages a Dapr Component for a Container App Environment.
 * ## 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 exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("example", {
 *     name: "acctest-01",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     sku: "PerGB2018",
 *     retentionInDays: 30,
 * });
 * const exampleEnvironment = new azure.containerapp.Environment("example", {
 *     name: "Example-Environment",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     logAnalyticsWorkspaceId: exampleAnalyticsWorkspace.id,
 * });
 * const exampleEnvironmentDaprComponent = new azure.containerapp.EnvironmentDaprComponent("example", {
 *     name: "example-component",
 *     containerAppEnvironmentId: exampleEnvironment.id,
 *     componentType: "state.azure.blobstorage",
 *     version: "v1",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("example",
 *     name="acctest-01",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     sku="PerGB2018",
 *     retention_in_days=30)
 * example_environment = azure.containerapp.Environment("example",
 *     name="Example-Environment",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     log_analytics_workspace_id=example_analytics_workspace.id)
 * example_environment_dapr_component = azure.containerapp.EnvironmentDaprComponent("example",
 *     name="example-component",
 *     container_app_environment_id=example_environment.id,
 *     component_type="state.azure.blobstorage",
 *     version="v1")
 * ```
 * ```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 exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("example", new()
 *     {
 *         Name = "acctest-01",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         Sku = "PerGB2018",
 *         RetentionInDays = 30,
 *     });
 *     var exampleEnvironment = new Azure.ContainerApp.Environment("example", new()
 *     {
 *         Name = "Example-Environment",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         LogAnalyticsWorkspaceId = exampleAnalyticsWorkspace.Id,
 *     });
 *     var exampleEnvironmentDaprComponent = new Azure.ContainerApp.EnvironmentDaprComponent("example", new()
 *     {
 *         Name = "example-component",
 *         ContainerAppEnvironmentId = exampleEnvironment.Id,
 *         ComponentType = "state.azure.blobstorage",
 *         Version = "v1",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerapp"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"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("example-resources"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "example", &operationalinsights.AnalyticsWorkspaceArgs{
 * 			Name:              pulumi.String("acctest-01"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			Sku:               pulumi.String("PerGB2018"),
 * 			RetentionInDays:   pulumi.Int(30),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleEnvironment, err := containerapp.NewEnvironment(ctx, "example", &containerapp.EnvironmentArgs{
 * 			Name:                    pulumi.String("Example-Environment"),
 * 			Location:                example.Location,
 * 			ResourceGroupName:       example.Name,
 * 			LogAnalyticsWorkspaceId: exampleAnalyticsWorkspace.ID(),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = containerapp.NewEnvironmentDaprComponent(ctx, "example", &containerapp.EnvironmentDaprComponentArgs{
 * 			Name:                      pulumi.String("example-component"),
 * 			ContainerAppEnvironmentId: exampleEnvironment.ID(),
 * 			ComponentType:             pulumi.String("state.azure.blobstorage"),
 * 			Version:                   pulumi.String("v1"),
 * 		})
 * 		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.operationalinsights.AnalyticsWorkspace;
 * import com.pulumi.azure.operationalinsights.AnalyticsWorkspaceArgs;
 * import com.pulumi.azure.containerapp.Environment;
 * import com.pulumi.azure.containerapp.EnvironmentArgs;
 * import com.pulumi.azure.containerapp.EnvironmentDaprComponent;
 * import com.pulumi.azure.containerapp.EnvironmentDaprComponentArgs;
 * 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 exampleAnalyticsWorkspace = new AnalyticsWorkspace("exampleAnalyticsWorkspace", AnalyticsWorkspaceArgs.builder()
 *             .name("acctest-01")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .sku("PerGB2018")
 *             .retentionInDays(30)
 *             .build());
 *         var exampleEnvironment = new Environment("exampleEnvironment", EnvironmentArgs.builder()
 *             .name("Example-Environment")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .logAnalyticsWorkspaceId(exampleAnalyticsWorkspace.id())
 *             .build());
 *         var exampleEnvironmentDaprComponent = new EnvironmentDaprComponent("exampleEnvironmentDaprComponent", EnvironmentDaprComponentArgs.builder()
 *             .name("example-component")
 *             .containerAppEnvironmentId(exampleEnvironment.id())
 *             .componentType("state.azure.blobstorage")
 *             .version("v1")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleAnalyticsWorkspace:
 *     type: azure:operationalinsights:AnalyticsWorkspace
 *     name: example
 *     properties:
 *       name: acctest-01
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       sku: PerGB2018
 *       retentionInDays: 30
 *   exampleEnvironment:
 *     type: azure:containerapp:Environment
 *     name: example
 *     properties:
 *       name: Example-Environment
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       logAnalyticsWorkspaceId: ${exampleAnalyticsWorkspace.id}
 *   exampleEnvironmentDaprComponent:
 *     type: azure:containerapp:EnvironmentDaprComponent
 *     name: example
 *     properties:
 *       name: example-component
 *       containerAppEnvironmentId: ${exampleEnvironment.id}
 *       componentType: state.azure.blobstorage
 *       version: v1
 * ```
 * 
 * ## Import
 * A Dapr Component for a Container App Environment can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:containerapp/environmentDaprComponent:EnvironmentDaprComponent example "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resGroup1/providers/Microsoft.App/managedEnvironments/myenv/daprComponents/mydaprcomponent"
 * ```
 * @property componentType The Dapr Component Type. For example `state.azure.blobstorage`. Changing this forces a new resource to be created.
 * @property containerAppEnvironmentId The ID of the Container App Managed Environment for this Dapr Component. Changing this forces a new resource to be created.
 * @property ignoreErrors Should the Dapr sidecar to continue initialisation if the component fails to load. Defaults to `false`
 * @property initTimeout The timeout for component initialisation as a `ISO8601` formatted string. e.g. `5s`, `2h`, `1m`. Defaults to `5s`.
 * @property metadatas One or more `metadata` blocks as detailed below.
 * @property name The name for this Dapr component. Changing this forces a new resource to be created.
 * @property scopes A list of scopes to which this component applies.
 * > **NOTE:** See the official docs for more information at https://learn.microsoft.com/en-us/azure/container-apps/dapr-overview?tabs=bicep1%2Cyaml#component-scopes
 * @property secrets A `secret` block as detailed below.
 * @property version The version of the component.
 */
public data class EnvironmentDaprComponentArgs(
    public val componentType: Output? = null,
    public val containerAppEnvironmentId: Output? = null,
    public val ignoreErrors: Output? = null,
    public val initTimeout: Output? = null,
    public val metadatas: Output>? = null,
    public val name: Output? = null,
    public val scopes: Output>? = null,
    public val secrets: Output>? = null,
    public val version: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.containerapp.EnvironmentDaprComponentArgs =
        com.pulumi.azure.containerapp.EnvironmentDaprComponentArgs.builder()
            .componentType(componentType?.applyValue({ args0 -> args0 }))
            .containerAppEnvironmentId(containerAppEnvironmentId?.applyValue({ args0 -> args0 }))
            .ignoreErrors(ignoreErrors?.applyValue({ args0 -> args0 }))
            .initTimeout(initTimeout?.applyValue({ args0 -> args0 }))
            .metadatas(
                metadatas?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .name(name?.applyValue({ args0 -> args0 }))
            .scopes(scopes?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .secrets(
                secrets?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .version(version?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [EnvironmentDaprComponentArgs].
 */
@PulumiTagMarker
public class EnvironmentDaprComponentArgsBuilder internal constructor() {
    private var componentType: Output? = null

    private var containerAppEnvironmentId: Output? = null

    private var ignoreErrors: Output? = null

    private var initTimeout: Output? = null

    private var metadatas: Output>? = null

    private var name: Output? = null

    private var scopes: Output>? = null

    private var secrets: Output>? = null

    private var version: Output? = null

    /**
     * @param value The Dapr Component Type. For example `state.azure.blobstorage`. Changing this forces a new resource to be created.
     */
    @JvmName("xtohrfchbvwideis")
    public suspend fun componentType(`value`: Output) {
        this.componentType = value
    }

    /**
     * @param value The ID of the Container App Managed Environment for this Dapr Component. Changing this forces a new resource to be created.
     */
    @JvmName("pnqkbgvgaudncfmi")
    public suspend fun containerAppEnvironmentId(`value`: Output) {
        this.containerAppEnvironmentId = value
    }

    /**
     * @param value Should the Dapr sidecar to continue initialisation if the component fails to load. Defaults to `false`
     */
    @JvmName("iboheagtscddsenr")
    public suspend fun ignoreErrors(`value`: Output) {
        this.ignoreErrors = value
    }

    /**
     * @param value The timeout for component initialisation as a `ISO8601` formatted string. e.g. `5s`, `2h`, `1m`. Defaults to `5s`.
     */
    @JvmName("eywqgbwieiqfgdro")
    public suspend fun initTimeout(`value`: Output) {
        this.initTimeout = value
    }

    /**
     * @param value One or more `metadata` blocks as detailed below.
     */
    @JvmName("oefvnrxgvxwvpigr")
    public suspend fun metadatas(`value`: Output>) {
        this.metadatas = value
    }

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

    /**
     * @param values One or more `metadata` blocks as detailed below.
     */
    @JvmName("ytehboscgyfkmhjy")
    public suspend fun metadatas(values: List>) {
        this.metadatas = Output.all(values)
    }

    /**
     * @param value The name for this Dapr component. Changing this forces a new resource to be created.
     */
    @JvmName("nwxagyiadtawmjhy")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value A list of scopes to which this component applies.
     * > **NOTE:** See the official docs for more information at https://learn.microsoft.com/en-us/azure/container-apps/dapr-overview?tabs=bicep1%2Cyaml#component-scopes
     */
    @JvmName("lgcbnlmudcqlhpil")
    public suspend fun scopes(`value`: Output>) {
        this.scopes = value
    }

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

    /**
     * @param values A list of scopes to which this component applies.
     * > **NOTE:** See the official docs for more information at https://learn.microsoft.com/en-us/azure/container-apps/dapr-overview?tabs=bicep1%2Cyaml#component-scopes
     */
    @JvmName("xyoullxjmusifbhu")
    public suspend fun scopes(values: List>) {
        this.scopes = Output.all(values)
    }

    /**
     * @param value A `secret` block as detailed below.
     */
    @JvmName("euqtcvykxnnbqhcn")
    public suspend fun secrets(`value`: Output>) {
        this.secrets = value
    }

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

    /**
     * @param values A `secret` block as detailed below.
     */
    @JvmName("orpdhtnvntnaoupg")
    public suspend fun secrets(values: List>) {
        this.secrets = Output.all(values)
    }

    /**
     * @param value The version of the component.
     */
    @JvmName("gusaaawjvahflidn")
    public suspend fun version(`value`: Output) {
        this.version = value
    }

    /**
     * @param value The Dapr Component Type. For example `state.azure.blobstorage`. Changing this forces a new resource to be created.
     */
    @JvmName("jmrvutcoibsvefoo")
    public suspend fun componentType(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.componentType = mapped
    }

    /**
     * @param value The ID of the Container App Managed Environment for this Dapr Component. Changing this forces a new resource to be created.
     */
    @JvmName("ihoaxexivyuyxtvb")
    public suspend fun containerAppEnvironmentId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.containerAppEnvironmentId = mapped
    }

    /**
     * @param value Should the Dapr sidecar to continue initialisation if the component fails to load. Defaults to `false`
     */
    @JvmName("vbuftbnlydiywsms")
    public suspend fun ignoreErrors(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ignoreErrors = mapped
    }

    /**
     * @param value The timeout for component initialisation as a `ISO8601` formatted string. e.g. `5s`, `2h`, `1m`. Defaults to `5s`.
     */
    @JvmName("gunbxfdeojjbjktj")
    public suspend fun initTimeout(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.initTimeout = mapped
    }

    /**
     * @param value One or more `metadata` blocks as detailed below.
     */
    @JvmName("jsabfjvlxisvlkmd")
    public suspend fun metadatas(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.metadatas = mapped
    }

    /**
     * @param argument One or more `metadata` blocks as detailed below.
     */
    @JvmName("eamlgnegjwrtaclp")
    public suspend fun metadatas(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            EnvironmentDaprComponentMetadataArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.metadatas = mapped
    }

    /**
     * @param argument One or more `metadata` blocks as detailed below.
     */
    @JvmName("nnwvflymeycvsnwt")
    public suspend fun metadatas(vararg argument: suspend EnvironmentDaprComponentMetadataArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            EnvironmentDaprComponentMetadataArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.metadatas = mapped
    }

    /**
     * @param argument One or more `metadata` blocks as detailed below.
     */
    @JvmName("btmpjlgbaswjuwbm")
    public suspend fun metadatas(argument: suspend EnvironmentDaprComponentMetadataArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            EnvironmentDaprComponentMetadataArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.metadatas = mapped
    }

    /**
     * @param values One or more `metadata` blocks as detailed below.
     */
    @JvmName("jlhiorrlntvjaffq")
    public suspend fun metadatas(vararg values: EnvironmentDaprComponentMetadataArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.metadatas = mapped
    }

    /**
     * @param value The name for this Dapr component. Changing this forces a new resource to be created.
     */
    @JvmName("luhvxipaedwqstcq")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value A list of scopes to which this component applies.
     * > **NOTE:** See the official docs for more information at https://learn.microsoft.com/en-us/azure/container-apps/dapr-overview?tabs=bicep1%2Cyaml#component-scopes
     */
    @JvmName("npffrpmeukmsgclt")
    public suspend fun scopes(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.scopes = mapped
    }

    /**
     * @param values A list of scopes to which this component applies.
     * > **NOTE:** See the official docs for more information at https://learn.microsoft.com/en-us/azure/container-apps/dapr-overview?tabs=bicep1%2Cyaml#component-scopes
     */
    @JvmName("otciwekjelkkuygj")
    public suspend fun scopes(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.scopes = mapped
    }

    /**
     * @param value A `secret` block as detailed below.
     */
    @JvmName("wqkcpbafmtegbnre")
    public suspend fun secrets(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.secrets = mapped
    }

    /**
     * @param argument A `secret` block as detailed below.
     */
    @JvmName("naklmaygtghsjyvr")
    public suspend fun secrets(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            EnvironmentDaprComponentSecretArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.secrets = mapped
    }

    /**
     * @param argument A `secret` block as detailed below.
     */
    @JvmName("wprkfvusqyfmcgsb")
    public suspend fun secrets(vararg argument: suspend EnvironmentDaprComponentSecretArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            EnvironmentDaprComponentSecretArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.secrets = mapped
    }

    /**
     * @param argument A `secret` block as detailed below.
     */
    @JvmName("rrdixqrlbdeiaqkx")
    public suspend fun secrets(argument: suspend EnvironmentDaprComponentSecretArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            EnvironmentDaprComponentSecretArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.secrets = mapped
    }

    /**
     * @param values A `secret` block as detailed below.
     */
    @JvmName("adrxgowpxwjidxfk")
    public suspend fun secrets(vararg values: EnvironmentDaprComponentSecretArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.secrets = mapped
    }

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

    internal fun build(): EnvironmentDaprComponentArgs = EnvironmentDaprComponentArgs(
        componentType = componentType,
        containerAppEnvironmentId = containerAppEnvironmentId,
        ignoreErrors = ignoreErrors,
        initTimeout = initTimeout,
        metadatas = metadatas,
        name = name,
        scopes = scopes,
        secrets = secrets,
        version = version,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy