com.pulumi.azure.containerapp.kotlin.EnvironmentDaprComponent.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-azure-kotlin Show documentation
Show all versions of pulumi-azure-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.containerapp.kotlin
import com.pulumi.azure.containerapp.kotlin.outputs.EnvironmentDaprComponentMetadata
import com.pulumi.azure.containerapp.kotlin.outputs.EnvironmentDaprComponentSecret
import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import com.pulumi.azure.containerapp.kotlin.outputs.EnvironmentDaprComponentMetadata.Companion.toKotlin as environmentDaprComponentMetadataToKotlin
import com.pulumi.azure.containerapp.kotlin.outputs.EnvironmentDaprComponentSecret.Companion.toKotlin as environmentDaprComponentSecretToKotlin
/**
* Builder for [EnvironmentDaprComponent].
*/
@PulumiTagMarker
public class EnvironmentDaprComponentResourceBuilder internal constructor() {
public var name: String? = null
public var args: EnvironmentDaprComponentArgs = EnvironmentDaprComponentArgs()
public var opts: CustomResourceOptions = CustomResourceOptions()
/**
* @param name The _unique_ name of the resulting resource.
*/
public fun name(`value`: String) {
this.name = value
}
/**
* @param block The arguments to use to populate this resource's properties.
*/
public suspend fun args(block: suspend EnvironmentDaprComponentArgsBuilder.() -> Unit) {
val builder = EnvironmentDaprComponentArgsBuilder()
block(builder)
this.args = builder.build()
}
/**
* @param block A bag of options that control this resource's behavior.
*/
public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
}
internal fun build(): EnvironmentDaprComponent {
val builtJavaResource =
com.pulumi.azure.containerapp.EnvironmentDaprComponent(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return EnvironmentDaprComponent(builtJavaResource)
}
}
/**
* 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"
* ```
*/
public class EnvironmentDaprComponent internal constructor(
override val javaResource: com.pulumi.azure.containerapp.EnvironmentDaprComponent,
) : KotlinCustomResource(javaResource, EnvironmentDaprComponentMapper) {
/**
* The Dapr Component Type. For example `state.azure.blobstorage`. Changing this forces a new resource to be created.
*/
public val componentType: Output
get() = javaResource.componentType().applyValue({ args0 -> args0 })
/**
* The ID of the Container App Managed Environment for this Dapr Component. Changing this forces a new resource to be created.
*/
public val containerAppEnvironmentId: Output
get() = javaResource.containerAppEnvironmentId().applyValue({ args0 -> args0 })
/**
* Should the Dapr sidecar to continue initialisation if the component fails to load. Defaults to `false`
*/
public val ignoreErrors: Output?
get() = javaResource.ignoreErrors().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The timeout for component initialisation as a `ISO8601` formatted string. e.g. `5s`, `2h`, `1m`. Defaults to `5s`.
*/
public val initTimeout: Output?
get() = javaResource.initTimeout().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* One or more `metadata` blocks as detailed below.
*/
public val metadatas: Output>?
get() = javaResource.metadatas().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> environmentDaprComponentMetadataToKotlin(args0) })
})
}).orElse(null)
})
/**
* The name for this Dapr component. Changing this forces a new resource to be created.
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* 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
*/
public val scopes: Output>?
get() = javaResource.scopes().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0
})
}).orElse(null)
})
/**
* A `secret` block as detailed below.
*/
public val secrets: Output>?
get() = javaResource.secrets().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> environmentDaprComponentSecretToKotlin(args0) })
})
}).orElse(null)
})
/**
* The version of the component.
*/
public val version: Output
get() = javaResource.version().applyValue({ args0 -> args0 })
}
public object EnvironmentDaprComponentMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.azure.containerapp.EnvironmentDaprComponent::class == javaResource::class
override fun map(javaResource: Resource): EnvironmentDaprComponent =
EnvironmentDaprComponent(
javaResource as
com.pulumi.azure.containerapp.EnvironmentDaprComponent,
)
}
/**
* @see [EnvironmentDaprComponent].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [EnvironmentDaprComponent].
*/
public suspend fun environmentDaprComponent(
name: String,
block: suspend EnvironmentDaprComponentResourceBuilder.() -> Unit,
): EnvironmentDaprComponent {
val builder = EnvironmentDaprComponentResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [EnvironmentDaprComponent].
* @param name The _unique_ name of the resulting resource.
*/
public fun environmentDaprComponent(name: String): EnvironmentDaprComponent {
val builder = EnvironmentDaprComponentResourceBuilder()
builder.name(name)
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy