com.pulumi.azurenative.appconfiguration.KeyValue 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.appconfiguration;
import com.pulumi.azurenative.Utilities;
import com.pulumi.azurenative.appconfiguration.KeyValueArgs;
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.Map;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* The key-value resource along with all resource properties.
* Azure REST API version: 2023-03-01. Prior API version in Azure Native 1.x: 2020-07-01-preview.
*
* Other available API versions: 2023-08-01-preview, 2023-09-01-preview, 2024-05-01.
*
* ## Example Usage
* ### KeyValues_CreateOrUpdate
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.appconfiguration.KeyValue;
* import com.pulumi.azurenative.appconfiguration.KeyValueArgs;
* 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 keyValue = new KeyValue("keyValue", KeyValueArgs.builder()
* .configStoreName("contoso")
* .keyValueName("myKey$myLabel")
* .resourceGroupName("myResourceGroup")
* .tags(Map.ofEntries(
* Map.entry("tag1", "tagValue1"),
* Map.entry("tag2", "tagValue2")
* ))
* .value("myValue")
* .build());
*
* }
* }
*
* }
*
*
* ## Import
*
* An existing resource can be imported using its type token, name, and identifier, e.g.
*
* ```sh
* $ pulumi import azure-native:appconfiguration:KeyValue myKey$myLabel /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/keyValues/{keyValueName}
* ```
*
*/
@ResourceType(type="azure-native:appconfiguration:KeyValue")
public class KeyValue extends com.pulumi.resources.CustomResource {
/**
* The content type of the key-value's value.
* Providing a proper content-type can enable transformations of values when they are retrieved by applications.
*
*/
@Export(name="contentType", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> contentType;
/**
* @return The content type of the key-value's value.
* Providing a proper content-type can enable transformations of values when they are retrieved by applications.
*
*/
public Output> contentType() {
return Codegen.optional(this.contentType);
}
/**
* An ETag indicating the state of a key-value within a configuration store.
*
*/
@Export(name="eTag", refs={String.class}, tree="[0]")
private Output eTag;
/**
* @return An ETag indicating the state of a key-value within a configuration store.
*
*/
public Output eTag() {
return this.eTag;
}
/**
* The primary identifier of a key-value.
* The key is used in unison with the label to uniquely identify a key-value.
*
*/
@Export(name="key", refs={String.class}, tree="[0]")
private Output key;
/**
* @return The primary identifier of a key-value.
* The key is used in unison with the label to uniquely identify a key-value.
*
*/
public Output key() {
return this.key;
}
/**
* A value used to group key-values.
* The label is used in unison with the key to uniquely identify a key-value.
*
*/
@Export(name="label", refs={String.class}, tree="[0]")
private Output label;
/**
* @return A value used to group key-values.
* The label is used in unison with the key to uniquely identify a key-value.
*
*/
public Output label() {
return this.label;
}
/**
* The last time a modifying operation was performed on the given key-value.
*
*/
@Export(name="lastModified", refs={String.class}, tree="[0]")
private Output lastModified;
/**
* @return The last time a modifying operation was performed on the given key-value.
*
*/
public Output lastModified() {
return this.lastModified;
}
/**
* A value indicating whether the key-value is locked.
* A locked key-value may not be modified until it is unlocked.
*
*/
@Export(name="locked", refs={Boolean.class}, tree="[0]")
private Output locked;
/**
* @return A value indicating whether the key-value is locked.
* A locked key-value may not be modified until it is unlocked.
*
*/
public Output locked() {
return this.locked;
}
/**
* 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;
}
/**
* A dictionary of tags that can help identify what a key-value may be applicable for.
*
*/
@Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]")
private Output* @Nullable */ Map> tags;
/**
* @return A dictionary of tags that can help identify what a key-value may be applicable for.
*
*/
public Output>> tags() {
return Codegen.optional(this.tags);
}
/**
* The type of the resource.
*
*/
@Export(name="type", refs={String.class}, tree="[0]")
private Output type;
/**
* @return The type of the resource.
*
*/
public Output type() {
return this.type;
}
/**
* The value of the key-value.
*
*/
@Export(name="value", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> value;
/**
* @return The value of the key-value.
*
*/
public Output> value() {
return Codegen.optional(this.value);
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public KeyValue(java.lang.String name) {
this(name, KeyValueArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public KeyValue(java.lang.String name, KeyValueArgs 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 KeyValue(java.lang.String name, KeyValueArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure-native:appconfiguration:KeyValue", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private KeyValue(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure-native:appconfiguration:KeyValue", name, null, makeResourceOptions(options, id), false);
}
private static KeyValueArgs makeArgs(KeyValueArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? KeyValueArgs.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:appconfiguration/v20200701preview:KeyValue").build()),
Output.of(Alias.builder().type("azure-native:appconfiguration/v20210301preview:KeyValue").build()),
Output.of(Alias.builder().type("azure-native:appconfiguration/v20211001preview:KeyValue").build()),
Output.of(Alias.builder().type("azure-native:appconfiguration/v20220301preview:KeyValue").build()),
Output.of(Alias.builder().type("azure-native:appconfiguration/v20220501:KeyValue").build()),
Output.of(Alias.builder().type("azure-native:appconfiguration/v20230301:KeyValue").build()),
Output.of(Alias.builder().type("azure-native:appconfiguration/v20230801preview:KeyValue").build()),
Output.of(Alias.builder().type("azure-native:appconfiguration/v20230901preview:KeyValue").build()),
Output.of(Alias.builder().type("azure-native:appconfiguration/v20240501:KeyValue").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 KeyValue get(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new KeyValue(name, id, options);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy