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

com.pulumi.azurenative.resources.AzurePowerShellScript Maven / Gradle / Ivy

There is a newer version: 2.72.0
Show newest version
// *** 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.resources;

import com.pulumi.azurenative.Utilities;
import com.pulumi.azurenative.resources.AzurePowerShellScriptArgs;
import com.pulumi.azurenative.resources.outputs.ContainerConfigurationResponse;
import com.pulumi.azurenative.resources.outputs.EnvironmentVariableResponse;
import com.pulumi.azurenative.resources.outputs.ManagedServiceIdentityResponse;
import com.pulumi.azurenative.resources.outputs.ScriptStatusResponse;
import com.pulumi.azurenative.resources.outputs.StorageAccountConfigurationResponse;
import com.pulumi.azurenative.resources.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.Object;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Object model for the Azure PowerShell script.
 * Azure REST API version: 2020-10-01. Prior API version in Azure Native 1.x: 2020-10-01.
 * 
 * ## Example Usage
 * ### DeploymentScriptsCreateNoUserManagedIdentity
 * 
 * 
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azurenative.resources.AzurePowerShellScript;
 * import com.pulumi.azurenative.resources.AzurePowerShellScriptArgs;
 * 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 azurePowerShellScript = new AzurePowerShellScript("azurePowerShellScript", AzurePowerShellScriptArgs.builder()
 *             .arguments("-Location 'westus' -Name \"*rg2\"")
 *             .azPowerShellVersion("1.7.0")
 *             .cleanupPreference("Always")
 *             .kind("AzurePowerShell")
 *             .location("westus")
 *             .resourceGroupName("script-rg")
 *             .retentionInterval("PT7D")
 *             .scriptContent("Param([string]$Location,[string]$Name) $deploymentScriptOutputs['test'] = 'value' Get-AzResourceGroup -Location $Location -Name $Name")
 *             .scriptName("MyDeploymentScript")
 *             .supportingScriptUris(            
 *                 "https://uri1.to.supporting.script",
 *                 "https://uri2.to.supporting.script")
 *             .timeout("PT1H")
 *             .build());
 * 
 *     }
 * }
 * 
 * }
 * 
* * ## Import * * An existing resource can be imported using its type token, name, and identifier, e.g. * * ```sh * $ pulumi import azure-native:resources:AzurePowerShellScript myresource1 /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentScripts/{scriptName} * ``` * */ @ResourceType(type="azure-native:resources:AzurePowerShellScript") public class AzurePowerShellScript extends com.pulumi.resources.CustomResource { /** * Command line arguments to pass to the script. Arguments are separated by spaces. ex: -Name blue* -Location 'West US 2' * */ @Export(name="arguments", refs={String.class}, tree="[0]") private Output arguments; /** * @return Command line arguments to pass to the script. Arguments are separated by spaces. ex: -Name blue* -Location 'West US 2' * */ public Output> arguments() { return Codegen.optional(this.arguments); } /** * Azure PowerShell module version to be used. * */ @Export(name="azPowerShellVersion", refs={String.class}, tree="[0]") private Output azPowerShellVersion; /** * @return Azure PowerShell module version to be used. * */ public Output azPowerShellVersion() { return this.azPowerShellVersion; } /** * The clean up preference when the script execution gets in a terminal state. Default setting is 'Always'. * */ @Export(name="cleanupPreference", refs={String.class}, tree="[0]") private Output cleanupPreference; /** * @return The clean up preference when the script execution gets in a terminal state. Default setting is 'Always'. * */ public Output> cleanupPreference() { return Codegen.optional(this.cleanupPreference); } /** * Container settings. * */ @Export(name="containerSettings", refs={ContainerConfigurationResponse.class}, tree="[0]") private Output containerSettings; /** * @return Container settings. * */ public Output> containerSettings() { return Codegen.optional(this.containerSettings); } /** * The environment variables to pass over to the script. * */ @Export(name="environmentVariables", refs={List.class,EnvironmentVariableResponse.class}, tree="[0,1]") private Output> environmentVariables; /** * @return The environment variables to pass over to the script. * */ public Output>> environmentVariables() { return Codegen.optional(this.environmentVariables); } /** * Gets or sets how the deployment script should be forced to execute even if the script resource has not changed. Can be current time stamp or a GUID. * */ @Export(name="forceUpdateTag", refs={String.class}, tree="[0]") private Output forceUpdateTag; /** * @return Gets or sets how the deployment script should be forced to execute even if the script resource has not changed. Can be current time stamp or a GUID. * */ public Output> forceUpdateTag() { return Codegen.optional(this.forceUpdateTag); } /** * Optional property. Managed identity to be used for this deployment script. Currently, only user-assigned MSI is supported. * */ @Export(name="identity", refs={ManagedServiceIdentityResponse.class}, tree="[0]") private Output identity; /** * @return Optional property. Managed identity to be used for this deployment script. Currently, only user-assigned MSI is supported. * */ public Output> identity() { return Codegen.optional(this.identity); } /** * Type of the script. * Expected value is 'AzurePowerShell'. * */ @Export(name="kind", refs={String.class}, tree="[0]") private Output kind; /** * @return Type of the script. * Expected value is 'AzurePowerShell'. * */ public Output kind() { return this.kind; } /** * The location of the ACI and the storage account for the deployment script. * */ @Export(name="location", refs={String.class}, tree="[0]") private Output location; /** * @return The location of the ACI and the storage account for the deployment script. * */ public Output location() { return this.location; } /** * Name of this resource. * */ @Export(name="name", refs={String.class}, tree="[0]") private Output name; /** * @return Name of this resource. * */ public Output name() { return this.name; } /** * List of script outputs. * */ @Export(name="outputs", refs={Map.class,String.class,Object.class}, tree="[0,1,2]") private Output> outputs; /** * @return List of script outputs. * */ public Output> outputs() { return this.outputs; } /** * Uri for the script. This is the entry point for the external script. * */ @Export(name="primaryScriptUri", refs={String.class}, tree="[0]") private Output primaryScriptUri; /** * @return Uri for the script. This is the entry point for the external script. * */ public Output> primaryScriptUri() { return Codegen.optional(this.primaryScriptUri); } /** * State of the script execution. This only appears in the response. * */ @Export(name="provisioningState", refs={String.class}, tree="[0]") private Output provisioningState; /** * @return State of the script execution. This only appears in the response. * */ public Output provisioningState() { return this.provisioningState; } /** * Interval for which the service retains the script resource after it reaches a terminal state. Resource will be deleted when this duration expires. Duration is based on ISO 8601 pattern (for example P1D means one day). * */ @Export(name="retentionInterval", refs={String.class}, tree="[0]") private Output retentionInterval; /** * @return Interval for which the service retains the script resource after it reaches a terminal state. Resource will be deleted when this duration expires. Duration is based on ISO 8601 pattern (for example P1D means one day). * */ public Output retentionInterval() { return this.retentionInterval; } /** * Script body. * */ @Export(name="scriptContent", refs={String.class}, tree="[0]") private Output scriptContent; /** * @return Script body. * */ public Output> scriptContent() { return Codegen.optional(this.scriptContent); } /** * Contains the results of script execution. * */ @Export(name="status", refs={ScriptStatusResponse.class}, tree="[0]") private Output status; /** * @return Contains the results of script execution. * */ public Output status() { return this.status; } /** * Storage Account settings. * */ @Export(name="storageAccountSettings", refs={StorageAccountConfigurationResponse.class}, tree="[0]") private Output storageAccountSettings; /** * @return Storage Account settings. * */ public Output> storageAccountSettings() { return Codegen.optional(this.storageAccountSettings); } /** * Supporting files for the external script. * */ @Export(name="supportingScriptUris", refs={List.class,String.class}, tree="[0,1]") private Output> supportingScriptUris; /** * @return Supporting files for the external script. * */ public Output>> supportingScriptUris() { return Codegen.optional(this.supportingScriptUris); } /** * The system metadata related to this resource. * */ @Export(name="systemData", refs={SystemDataResponse.class}, tree="[0]") private Output systemData; /** * @return The system metadata related to this resource. * */ public Output systemData() { return this.systemData; } /** * Resource tags. * */ @Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]") private Output> tags; /** * @return Resource tags. * */ public Output>> tags() { return Codegen.optional(this.tags); } /** * Maximum allowed script execution time specified in ISO 8601 format. Default value is P1D * */ @Export(name="timeout", refs={String.class}, tree="[0]") private Output timeout; /** * @return Maximum allowed script execution time specified in ISO 8601 format. Default value is P1D * */ public Output> timeout() { return Codegen.optional(this.timeout); } /** * Type of this resource. * */ @Export(name="type", refs={String.class}, tree="[0]") private Output type; /** * @return Type of this resource. * */ public Output type() { return this.type; } /** * * @param name The _unique_ name of the resulting resource. */ public AzurePowerShellScript(java.lang.String name) { this(name, AzurePowerShellScriptArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public AzurePowerShellScript(java.lang.String name, AzurePowerShellScriptArgs 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 AzurePowerShellScript(java.lang.String name, AzurePowerShellScriptArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure-native:resources:AzurePowerShellScript", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private AzurePowerShellScript(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure-native:resources:AzurePowerShellScript", name, null, makeResourceOptions(options, id), false); } private static AzurePowerShellScriptArgs makeArgs(AzurePowerShellScriptArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } var builder = args == null ? AzurePowerShellScriptArgs.builder() : AzurePowerShellScriptArgs.builder(args); return builder .kind("AzurePowerShell") .build(); } 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:resources/v20191001preview:AzurePowerShellScript").build()), Output.of(Alias.builder().type("azure-native:resources/v20201001:AzurePowerShellScript").build()), Output.of(Alias.builder().type("azure-native:resources/v20230801:AzurePowerShellScript").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 AzurePowerShellScript get(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new AzurePowerShellScript(name, id, options); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy