com.pulumi.azure.automation.StringVariable Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure Show documentation
Show all versions of azure Show documentation
A Pulumi package for creating and managing Microsoft Azure cloud resources, based on the Terraform azurerm provider. We recommend using the [Azure Native provider](https://github.com/pulumi/pulumi-azure-native) to provision Azure infrastructure. Azure Native provides complete coverage of Azure resources and same-day access to new resources and resource updates.
// *** 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.azure.automation;
import com.pulumi.azure.Utilities;
import com.pulumi.azure.automation.StringVariableArgs;
import com.pulumi.azure.automation.inputs.StringVariableState;
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.Optional;
import javax.annotation.Nullable;
/**
* Manages a string variable in Azure Automation
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* 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.automation.Account;
* import com.pulumi.azure.automation.AccountArgs;
* import com.pulumi.azure.automation.StringVariable;
* import com.pulumi.azure.automation.StringVariableArgs;
* 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("tfex-example-rg")
* .location("West Europe")
* .build());
*
* var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
* .name("tfex-example-account")
* .location(example.location())
* .resourceGroupName(example.name())
* .skuName("Basic")
* .build());
*
* var exampleStringVariable = new StringVariable("exampleStringVariable", StringVariableArgs.builder()
* .name("tfex-example-var")
* .resourceGroupName(example.name())
* .automationAccountName(exampleAccount.name())
* .value("Hello, Basic Test.")
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ## Import
*
* Automation String Variable can be imported using the `resource id`, e.g.
*
* ```sh
* $ pulumi import azure:automation/stringVariable:StringVariable example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tfex-example-rg/providers/Microsoft.Automation/automationAccounts/tfex-example-account/variables/tfex-example-var
* ```
*
*/
@ResourceType(type="azure:automation/stringVariable:StringVariable")
public class StringVariable extends com.pulumi.resources.CustomResource {
/**
* The name of the automation account in which the Variable is created. Changing this forces a new resource to be created.
*
*/
@Export(name="automationAccountName", refs={String.class}, tree="[0]")
private Output automationAccountName;
/**
* @return The name of the automation account in which the Variable is created. Changing this forces a new resource to be created.
*
*/
public Output automationAccountName() {
return this.automationAccountName;
}
/**
* The description of the Automation Variable.
*
*/
@Export(name="description", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> description;
/**
* @return The description of the Automation Variable.
*
*/
public Output> description() {
return Codegen.optional(this.description);
}
/**
* Specifies if the Automation Variable is encrypted. Defaults to `false`.
*
*/
@Export(name="encrypted", refs={Boolean.class}, tree="[0]")
private Output* @Nullable */ Boolean> encrypted;
/**
* @return Specifies if the Automation Variable is encrypted. Defaults to `false`.
*
*/
public Output> encrypted() {
return Codegen.optional(this.encrypted);
}
/**
* The name of the Automation Variable. Changing this forces a new resource to be created.
*
*/
@Export(name="name", refs={String.class}, tree="[0]")
private Output name;
/**
* @return The name of the Automation Variable. Changing this forces a new resource to be created.
*
*/
public Output name() {
return this.name;
}
/**
* The name of the resource group in which to create the Automation Variable. Changing this forces a new resource to be created.
*
*/
@Export(name="resourceGroupName", refs={String.class}, tree="[0]")
private Output resourceGroupName;
/**
* @return The name of the resource group in which to create the Automation Variable. Changing this forces a new resource to be created.
*
*/
public Output resourceGroupName() {
return this.resourceGroupName;
}
/**
* The value of the Automation Variable as a `string`.
*
*/
@Export(name="value", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> value;
/**
* @return The value of the Automation Variable as a `string`.
*
*/
public Output> value() {
return Codegen.optional(this.value);
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public StringVariable(java.lang.String name) {
this(name, StringVariableArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public StringVariable(java.lang.String name, StringVariableArgs 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 StringVariable(java.lang.String name, StringVariableArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure:automation/stringVariable:StringVariable", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private StringVariable(java.lang.String name, Output id, @Nullable StringVariableState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure:automation/stringVariable:StringVariable", name, state, makeResourceOptions(options, id), false);
}
private static StringVariableArgs makeArgs(StringVariableArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? StringVariableArgs.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())
.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 state
* @param options Optional settings to control the behavior of the CustomResource.
*/
public static StringVariable get(java.lang.String name, Output id, @Nullable StringVariableState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new StringVariable(name, id, state, options);
}
}