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

com.pulumi.azurenative.app.kotlin.ConnectedEnvironmentsDaprComponentArgs.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: 2.82.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azurenative.app.kotlin

import com.pulumi.azurenative.app.ConnectedEnvironmentsDaprComponentArgs.builder
import com.pulumi.azurenative.app.kotlin.inputs.DaprMetadataArgs
import com.pulumi.azurenative.app.kotlin.inputs.DaprMetadataArgsBuilder
import com.pulumi.azurenative.app.kotlin.inputs.SecretArgs
import com.pulumi.azurenative.app.kotlin.inputs.SecretArgsBuilder
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

/**
 * Dapr Component.
 * Azure REST API version: 2022-10-01.
 * Other available API versions: 2023-04-01-preview, 2023-05-01, 2023-05-02-preview, 2023-08-01-preview, 2023-11-02-preview, 2024-02-02-preview, 2024-03-01.
 * ## Example Usage
 * ### Create or update dapr component
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var connectedEnvironmentsDaprComponent = new AzureNative.App.ConnectedEnvironmentsDaprComponent("connectedEnvironmentsDaprComponent", new()
 *     {
 *         ComponentName = "reddog",
 *         ComponentType = "state.azure.cosmosdb",
 *         ConnectedEnvironmentName = "myenvironment",
 *         IgnoreErrors = false,
 *         InitTimeout = "50s",
 *         Metadata = new[]
 *         {
 *             new AzureNative.App.Inputs.DaprMetadataArgs
 *             {
 *                 Name = "url",
 *                 Value = "",
 *             },
 *             new AzureNative.App.Inputs.DaprMetadataArgs
 *             {
 *                 Name = "database",
 *                 Value = "itemsDB",
 *             },
 *             new AzureNative.App.Inputs.DaprMetadataArgs
 *             {
 *                 Name = "collection",
 *                 Value = "items",
 *             },
 *             new AzureNative.App.Inputs.DaprMetadataArgs
 *             {
 *                 Name = "masterkey",
 *                 SecretRef = "masterkey",
 *             },
 *         },
 *         ResourceGroupName = "examplerg",
 *         Scopes = new[]
 *         {
 *             "container-app-1",
 *             "container-app-2",
 *         },
 *         Secrets = new[]
 *         {
 *             new AzureNative.App.Inputs.SecretArgs
 *             {
 *                 Name = "masterkey",
 *                 Value = "keyvalue",
 *             },
 *         },
 *         Version = "v1",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	app "github.com/pulumi/pulumi-azure-native-sdk/app/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := app.NewConnectedEnvironmentsDaprComponent(ctx, "connectedEnvironmentsDaprComponent", &app.ConnectedEnvironmentsDaprComponentArgs{
 * 			ComponentName:            pulumi.String("reddog"),
 * 			ComponentType:            pulumi.String("state.azure.cosmosdb"),
 * 			ConnectedEnvironmentName: pulumi.String("myenvironment"),
 * 			IgnoreErrors:             pulumi.Bool(false),
 * 			InitTimeout:              pulumi.String("50s"),
 * 			Metadata: app.DaprMetadataArray{
 * 				&app.DaprMetadataArgs{
 * 					Name:  pulumi.String("url"),
 * 					Value: pulumi.String(""),
 * 				},
 * 				&app.DaprMetadataArgs{
 * 					Name:  pulumi.String("database"),
 * 					Value: pulumi.String("itemsDB"),
 * 				},
 * 				&app.DaprMetadataArgs{
 * 					Name:  pulumi.String("collection"),
 * 					Value: pulumi.String("items"),
 * 				},
 * 				&app.DaprMetadataArgs{
 * 					Name:      pulumi.String("masterkey"),
 * 					SecretRef: pulumi.String("masterkey"),
 * 				},
 * 			},
 * 			ResourceGroupName: pulumi.String("examplerg"),
 * 			Scopes: pulumi.StringArray{
 * 				pulumi.String("container-app-1"),
 * 				pulumi.String("container-app-2"),
 * 			},
 * 			Secrets: app.SecretArray{
 * 				&app.SecretArgs{
 * 					Name:  pulumi.String("masterkey"),
 * 					Value: pulumi.String("keyvalue"),
 * 				},
 * 			},
 * 			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.azurenative.app.ConnectedEnvironmentsDaprComponent;
 * import com.pulumi.azurenative.app.ConnectedEnvironmentsDaprComponentArgs;
 * import com.pulumi.azurenative.app.inputs.DaprMetadataArgs;
 * import com.pulumi.azurenative.app.inputs.SecretArgs;
 * 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 connectedEnvironmentsDaprComponent = new ConnectedEnvironmentsDaprComponent("connectedEnvironmentsDaprComponent", ConnectedEnvironmentsDaprComponentArgs.builder()
 *             .componentName("reddog")
 *             .componentType("state.azure.cosmosdb")
 *             .connectedEnvironmentName("myenvironment")
 *             .ignoreErrors(false)
 *             .initTimeout("50s")
 *             .metadata(
 *                 DaprMetadataArgs.builder()
 *                     .name("url")
 *                     .value("")
 *                     .build(),
 *                 DaprMetadataArgs.builder()
 *                     .name("database")
 *                     .value("itemsDB")
 *                     .build(),
 *                 DaprMetadataArgs.builder()
 *                     .name("collection")
 *                     .value("items")
 *                     .build(),
 *                 DaprMetadataArgs.builder()
 *                     .name("masterkey")
 *                     .secretRef("masterkey")
 *                     .build())
 *             .resourceGroupName("examplerg")
 *             .scopes(
 *                 "container-app-1",
 *                 "container-app-2")
 *             .secrets(SecretArgs.builder()
 *                 .name("masterkey")
 *                 .value("keyvalue")
 *                 .build())
 *             .version("v1")
 *             .build());
 *     }
 * }
 * ```
 * ## Import
 * An existing resource can be imported using its type token, name, and identifier, e.g.
 * ```sh
 * $ pulumi import azure-native:app:ConnectedEnvironmentsDaprComponent reddog /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/daprComponents/{componentName}
 * ```
 * @property componentName Name of the Dapr Component.
 * @property componentType Component type
 * @property connectedEnvironmentName Name of the connected environment.
 * @property ignoreErrors Boolean describing if the component errors are ignores
 * @property initTimeout Initialization timeout
 * @property metadata Component metadata
 * @property resourceGroupName The name of the resource group. The name is case insensitive.
 * @property scopes Names of container apps that can use this Dapr component
 * @property secretStoreComponent Name of a Dapr component to retrieve component secrets from
 * @property secrets Collection of secrets used by a Dapr component
 * @property version Component version
 */
public data class ConnectedEnvironmentsDaprComponentArgs(
    public val componentName: Output? = null,
    public val componentType: Output? = null,
    public val connectedEnvironmentName: Output? = null,
    public val ignoreErrors: Output? = null,
    public val initTimeout: Output? = null,
    public val metadata: Output>? = null,
    public val resourceGroupName: Output? = null,
    public val scopes: Output>? = null,
    public val secretStoreComponent: Output? = null,
    public val secrets: Output>? = null,
    public val version: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.app.ConnectedEnvironmentsDaprComponentArgs =
        com.pulumi.azurenative.app.ConnectedEnvironmentsDaprComponentArgs.builder()
            .componentName(componentName?.applyValue({ args0 -> args0 }))
            .componentType(componentType?.applyValue({ args0 -> args0 }))
            .connectedEnvironmentName(connectedEnvironmentName?.applyValue({ args0 -> args0 }))
            .ignoreErrors(ignoreErrors?.applyValue({ args0 -> args0 }))
            .initTimeout(initTimeout?.applyValue({ args0 -> args0 }))
            .metadata(
                metadata?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .scopes(scopes?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .secretStoreComponent(secretStoreComponent?.applyValue({ args0 -> args0 }))
            .secrets(
                secrets?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .version(version?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [ConnectedEnvironmentsDaprComponentArgs].
 */
@PulumiTagMarker
public class ConnectedEnvironmentsDaprComponentArgsBuilder internal constructor() {
    private var componentName: Output? = null

    private var componentType: Output? = null

    private var connectedEnvironmentName: Output? = null

    private var ignoreErrors: Output? = null

    private var initTimeout: Output? = null

    private var metadata: Output>? = null

    private var resourceGroupName: Output? = null

    private var scopes: Output>? = null

    private var secretStoreComponent: Output? = null

    private var secrets: Output>? = null

    private var version: Output? = null

    /**
     * @param value Name of the Dapr Component.
     */
    @JvmName("ntmdaahtvlwrlapy")
    public suspend fun componentName(`value`: Output) {
        this.componentName = value
    }

    /**
     * @param value Component type
     */
    @JvmName("sujsdamxylvmbwfd")
    public suspend fun componentType(`value`: Output) {
        this.componentType = value
    }

    /**
     * @param value Name of the connected environment.
     */
    @JvmName("nmlvgvwhnyhinrbn")
    public suspend fun connectedEnvironmentName(`value`: Output) {
        this.connectedEnvironmentName = value
    }

    /**
     * @param value Boolean describing if the component errors are ignores
     */
    @JvmName("fxlblkvknxwcfphf")
    public suspend fun ignoreErrors(`value`: Output) {
        this.ignoreErrors = value
    }

    /**
     * @param value Initialization timeout
     */
    @JvmName("gcvmrvgwhodsygiv")
    public suspend fun initTimeout(`value`: Output) {
        this.initTimeout = value
    }

    /**
     * @param value Component metadata
     */
    @JvmName("rralwqwtsrumhxui")
    public suspend fun metadata(`value`: Output>) {
        this.metadata = value
    }

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

    /**
     * @param values Component metadata
     */
    @JvmName("tinkwvbsyhvgqrth")
    public suspend fun metadata(values: List>) {
        this.metadata = Output.all(values)
    }

    /**
     * @param value The name of the resource group. The name is case insensitive.
     */
    @JvmName("vawjqkvlfesrcmce")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value Names of container apps that can use this Dapr component
     */
    @JvmName("apsyqwucjqdbqegw")
    public suspend fun scopes(`value`: Output>) {
        this.scopes = value
    }

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

    /**
     * @param values Names of container apps that can use this Dapr component
     */
    @JvmName("efimmpviqdwkprvc")
    public suspend fun scopes(values: List>) {
        this.scopes = Output.all(values)
    }

    /**
     * @param value Name of a Dapr component to retrieve component secrets from
     */
    @JvmName("hmwvmntlqssthgsg")
    public suspend fun secretStoreComponent(`value`: Output) {
        this.secretStoreComponent = value
    }

    /**
     * @param value Collection of secrets used by a Dapr component
     */
    @JvmName("tacdvavrgxqdeaqd")
    public suspend fun secrets(`value`: Output>) {
        this.secrets = value
    }

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

    /**
     * @param values Collection of secrets used by a Dapr component
     */
    @JvmName("bcruryapeklsanis")
    public suspend fun secrets(values: List>) {
        this.secrets = Output.all(values)
    }

    /**
     * @param value Component version
     */
    @JvmName("yfcofrrfnkgehkyq")
    public suspend fun version(`value`: Output) {
        this.version = value
    }

    /**
     * @param value Name of the Dapr Component.
     */
    @JvmName("rngeshkumynugvao")
    public suspend fun componentName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.componentName = mapped
    }

    /**
     * @param value Component type
     */
    @JvmName("qqlrnqqtpeqsycfh")
    public suspend fun componentType(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.componentType = mapped
    }

    /**
     * @param value Name of the connected environment.
     */
    @JvmName("bcugwexhwmchuhmp")
    public suspend fun connectedEnvironmentName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.connectedEnvironmentName = mapped
    }

    /**
     * @param value Boolean describing if the component errors are ignores
     */
    @JvmName("gpwutvwvnmncekxp")
    public suspend fun ignoreErrors(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ignoreErrors = mapped
    }

    /**
     * @param value Initialization timeout
     */
    @JvmName("tkofigvmutwyhykl")
    public suspend fun initTimeout(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.initTimeout = mapped
    }

    /**
     * @param value Component metadata
     */
    @JvmName("jmaoimgvitmkjjir")
    public suspend fun metadata(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.metadata = mapped
    }

    /**
     * @param argument Component metadata
     */
    @JvmName("fflymttgtfrebmqg")
    public suspend fun metadata(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            DaprMetadataArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.metadata = mapped
    }

    /**
     * @param argument Component metadata
     */
    @JvmName("iyclaxpmsnbxctsw")
    public suspend fun metadata(vararg argument: suspend DaprMetadataArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            DaprMetadataArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.metadata = mapped
    }

    /**
     * @param argument Component metadata
     */
    @JvmName("golacfnjtxmvbxyv")
    public suspend fun metadata(argument: suspend DaprMetadataArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(DaprMetadataArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.metadata = mapped
    }

    /**
     * @param values Component metadata
     */
    @JvmName("yjuumxrpbsfgbthk")
    public suspend fun metadata(vararg values: DaprMetadataArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.metadata = mapped
    }

    /**
     * @param value The name of the resource group. The name is case insensitive.
     */
    @JvmName("xstsmsubguwbdpbs")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value Names of container apps that can use this Dapr component
     */
    @JvmName("nadibjvjoxjkqpws")
    public suspend fun scopes(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.scopes = mapped
    }

    /**
     * @param values Names of container apps that can use this Dapr component
     */
    @JvmName("oqhwqydygwyghkxe")
    public suspend fun scopes(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.scopes = mapped
    }

    /**
     * @param value Name of a Dapr component to retrieve component secrets from
     */
    @JvmName("tfbsdnxxxmdowkfq")
    public suspend fun secretStoreComponent(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.secretStoreComponent = mapped
    }

    /**
     * @param value Collection of secrets used by a Dapr component
     */
    @JvmName("hkfgeuekdosufyln")
    public suspend fun secrets(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.secrets = mapped
    }

    /**
     * @param argument Collection of secrets used by a Dapr component
     */
    @JvmName("imaahpaqosjbpasm")
    public suspend fun secrets(argument: List Unit>) {
        val toBeMapped = argument.toList().map { SecretArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.secrets = mapped
    }

    /**
     * @param argument Collection of secrets used by a Dapr component
     */
    @JvmName("cetanjteeoodbhgk")
    public suspend fun secrets(vararg argument: suspend SecretArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map { SecretArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.secrets = mapped
    }

    /**
     * @param argument Collection of secrets used by a Dapr component
     */
    @JvmName("ygowqxaufqnpugfp")
    public suspend fun secrets(argument: suspend SecretArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(SecretArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.secrets = mapped
    }

    /**
     * @param values Collection of secrets used by a Dapr component
     */
    @JvmName("invpodatpewwcrdo")
    public suspend fun secrets(vararg values: SecretArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.secrets = mapped
    }

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

    internal fun build(): ConnectedEnvironmentsDaprComponentArgs =
        ConnectedEnvironmentsDaprComponentArgs(
            componentName = componentName,
            componentType = componentType,
            connectedEnvironmentName = connectedEnvironmentName,
            ignoreErrors = ignoreErrors,
            initTimeout = initTimeout,
            metadata = metadata,
            resourceGroupName = resourceGroupName,
            scopes = scopes,
            secretStoreComponent = secretStoreComponent,
            secrets = secrets,
            version = version,
        )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy