com.pulumi.azurenative.app.DaprComponent Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-native Show documentation
Show all versions of azure-native Show documentation
A native Pulumi package for creating and managing Azure resources.
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.azurenative.app;
import com.pulumi.azurenative.Utilities;
import com.pulumi.azurenative.app.DaprComponentArgs;
import com.pulumi.azurenative.app.outputs.DaprMetadataResponse;
import com.pulumi.azurenative.app.outputs.SecretResponse;
import com.pulumi.azurenative.app.outputs.SystemDataResponse;
import com.pulumi.core.Alias;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.Boolean;
import java.lang.String;
import java.util.List;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* Dapr Component.
* Azure REST API version: 2022-10-01. Prior API version in Azure Native 1.x: 2022-03-01.
*
* Other available API versions: 2022-01-01-preview, 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 with secret store component
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.app.DaprComponent;
* import com.pulumi.azurenative.app.DaprComponentArgs;
* import com.pulumi.azurenative.app.inputs.DaprMetadataArgs;
* 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 daprComponent = new DaprComponent("daprComponent", DaprComponentArgs.builder()
* .componentName("reddog")
* .componentType("state.azure.cosmosdb")
* .environmentName("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")
* .secretStoreComponent("my-secret-store")
* .version("v1")
* .build());
*
* }
* }
*
* }
*
* ### Create or update dapr component with secrets
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.app.DaprComponent;
* import com.pulumi.azurenative.app.DaprComponentArgs;
* 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 daprComponent = new DaprComponent("daprComponent", DaprComponentArgs.builder()
* .componentName("reddog")
* .componentType("state.azure.cosmosdb")
* .environmentName("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:DaprComponent reddog /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}
* ```
*
*/
@ResourceType(type="azure-native:app:DaprComponent")
public class DaprComponent extends com.pulumi.resources.CustomResource {
/**
* Component type
*
*/
@Export(name="componentType", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> componentType;
/**
* @return Component type
*
*/
public Output> componentType() {
return Codegen.optional(this.componentType);
}
/**
* Boolean describing if the component errors are ignores
*
*/
@Export(name="ignoreErrors", refs={Boolean.class}, tree="[0]")
private Output* @Nullable */ Boolean> ignoreErrors;
/**
* @return Boolean describing if the component errors are ignores
*
*/
public Output> ignoreErrors() {
return Codegen.optional(this.ignoreErrors);
}
/**
* Initialization timeout
*
*/
@Export(name="initTimeout", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> initTimeout;
/**
* @return Initialization timeout
*
*/
public Output> initTimeout() {
return Codegen.optional(this.initTimeout);
}
/**
* Component metadata
*
*/
@Export(name="metadata", refs={List.class,DaprMetadataResponse.class}, tree="[0,1]")
private Output* @Nullable */ List> metadata;
/**
* @return Component metadata
*
*/
public Output>> metadata() {
return Codegen.optional(this.metadata);
}
/**
* The name of the resource
*
*/
@Export(name="name", refs={String.class}, tree="[0]")
private Output name;
/**
* @return The name of the resource
*
*/
public Output name() {
return this.name;
}
/**
* Names of container apps that can use this Dapr component
*
*/
@Export(name="scopes", refs={List.class,String.class}, tree="[0,1]")
private Output* @Nullable */ List> scopes;
/**
* @return Names of container apps that can use this Dapr component
*
*/
public Output>> scopes() {
return Codegen.optional(this.scopes);
}
/**
* Name of a Dapr component to retrieve component secrets from
*
*/
@Export(name="secretStoreComponent", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> secretStoreComponent;
/**
* @return Name of a Dapr component to retrieve component secrets from
*
*/
public Output> secretStoreComponent() {
return Codegen.optional(this.secretStoreComponent);
}
/**
* Collection of secrets used by a Dapr component
*
*/
@Export(name="secrets", refs={List.class,SecretResponse.class}, tree="[0,1]")
private Output* @Nullable */ List> secrets;
/**
* @return Collection of secrets used by a Dapr component
*
*/
public Output>> secrets() {
return Codegen.optional(this.secrets);
}
/**
* Azure Resource Manager metadata containing createdBy and modifiedBy information.
*
*/
@Export(name="systemData", refs={SystemDataResponse.class}, tree="[0]")
private Output systemData;
/**
* @return Azure Resource Manager metadata containing createdBy and modifiedBy information.
*
*/
public Output systemData() {
return this.systemData;
}
/**
* The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
*
*/
@Export(name="type", refs={String.class}, tree="[0]")
private Output type;
/**
* @return The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
*
*/
public Output type() {
return this.type;
}
/**
* Component version
*
*/
@Export(name="version", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> version;
/**
* @return Component version
*
*/
public Output> version() {
return Codegen.optional(this.version);
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public DaprComponent(java.lang.String name) {
this(name, DaprComponentArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public DaprComponent(java.lang.String name, DaprComponentArgs args) {
this(name, args, null);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
* @param options A bag of options that control this resource's behavior.
*/
public DaprComponent(java.lang.String name, DaprComponentArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure-native:app:DaprComponent", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private DaprComponent(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure-native:app:DaprComponent", name, null, makeResourceOptions(options, id), false);
}
private static DaprComponentArgs makeArgs(DaprComponentArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? DaprComponentArgs.Empty : args;
}
private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) {
var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
.version(Utilities.getVersion())
.aliases(List.of(
Output.of(Alias.builder().type("azure-native:app/v20220101preview:DaprComponent").build()),
Output.of(Alias.builder().type("azure-native:app/v20220301:DaprComponent").build()),
Output.of(Alias.builder().type("azure-native:app/v20220601preview:DaprComponent").build()),
Output.of(Alias.builder().type("azure-native:app/v20221001:DaprComponent").build()),
Output.of(Alias.builder().type("azure-native:app/v20221101preview:DaprComponent").build()),
Output.of(Alias.builder().type("azure-native:app/v20230401preview:DaprComponent").build()),
Output.of(Alias.builder().type("azure-native:app/v20230501:DaprComponent").build()),
Output.of(Alias.builder().type("azure-native:app/v20230502preview:DaprComponent").build()),
Output.of(Alias.builder().type("azure-native:app/v20230801preview:DaprComponent").build()),
Output.of(Alias.builder().type("azure-native:app/v20231102preview:DaprComponent").build()),
Output.of(Alias.builder().type("azure-native:app/v20240202preview:DaprComponent").build()),
Output.of(Alias.builder().type("azure-native:app/v20240301:DaprComponent").build())
))
.build();
return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id);
}
/**
* Get an existing Host resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param options Optional settings to control the behavior of the CustomResource.
*/
public static DaprComponent get(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new DaprComponent(name, id, options);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy