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

com.pulumi.azure.core.ResourceDeploymentScriptPowerShell Maven / Gradle / Ivy

Go to download

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.

There is a newer version: 6.10.0-alpha.1731737215
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.azure.core;

import com.pulumi.azure.Utilities;
import com.pulumi.azure.core.ResourceDeploymentScriptPowerShellArgs;
import com.pulumi.azure.core.inputs.ResourceDeploymentScriptPowerShellState;
import com.pulumi.azure.core.outputs.ResourceDeploymentScriptPowerShellContainer;
import com.pulumi.azure.core.outputs.ResourceDeploymentScriptPowerShellEnvironmentVariable;
import com.pulumi.azure.core.outputs.ResourceDeploymentScriptPowerShellIdentity;
import com.pulumi.azure.core.outputs.ResourceDeploymentScriptPowerShellStorageAccount;
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.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Manages a Resource Deployment Script of Azure PowerShell.
 * 
 * ## 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.authorization.UserAssignedIdentity;
 * import com.pulumi.azure.authorization.UserAssignedIdentityArgs;
 * import com.pulumi.azure.core.ResourceDeploymentScriptPowerShell;
 * import com.pulumi.azure.core.ResourceDeploymentScriptPowerShellArgs;
 * import com.pulumi.azure.core.inputs.ResourceDeploymentScriptPowerShellIdentityArgs;
 * 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 }{{@code
 *     public static void main(String[] args) }{{@code
 *         Pulumi.run(App::stack);
 *     }}{@code
 * 
 *     public static void stack(Context ctx) }{{@code
 *         var example = new ResourceGroup("example", ResourceGroupArgs.builder()
 *             .name("example-resources")
 *             .location("West Europe")
 *             .build());
 * 
 *         var exampleUserAssignedIdentity = new UserAssignedIdentity("exampleUserAssignedIdentity", UserAssignedIdentityArgs.builder()
 *             .name("example-uai")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .build());
 * 
 *         var exampleResourceDeploymentScriptPowerShell = new ResourceDeploymentScriptPowerShell("exampleResourceDeploymentScriptPowerShell", ResourceDeploymentScriptPowerShellArgs.builder()
 *             .name("example-rdsaps")
 *             .resourceGroupName(example.name())
 *             .location("West Europe")
 *             .version("8.3")
 *             .retentionInterval("P1D")
 *             .commandLine("-name \"John Dole\"")
 *             .cleanupPreference("OnSuccess")
 *             .forceUpdateTag("1")
 *             .timeout("PT30M")
 *             .scriptContent("""
 *           param([string] $name)
 *             $output = 'Hello }{{@code 0}}{@code .' -f $name
 *             Write-Output $output
 *             $DeploymentScriptOutputs = }{@literal @}{}{@code
 *             $DeploymentScriptOutputs['text'] = $output
 *             """)
 *             .identity(ResourceDeploymentScriptPowerShellIdentityArgs.builder()
 *                 .type("UserAssigned")
 *                 .identityIds(exampleUserAssignedIdentity.id())
 *                 .build())
 *             .tags(Map.of("key", "value"))
 *             .build());
 * 
 *     }}{@code
 * }}{@code
 * }
 * 
* <!--End PulumiCodeChooser --> * * ## Import * * Resource Deployment Script can be imported using the `resource id`, e.g. * * ```sh * $ pulumi import azure:core/resourceDeploymentScriptPowerShell:ResourceDeploymentScriptPowerShell example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.Resources/deploymentScripts/script1 * ``` * */ @ResourceType(type="azure:core/resourceDeploymentScriptPowerShell:ResourceDeploymentScriptPowerShell") public class ResourceDeploymentScriptPowerShell extends com.pulumi.resources.CustomResource { /** * Specifies the cleanup preference when the script execution gets in a terminal state. Possible values are `Always`, `OnExpiration`, `OnSuccess`. Defaults to `Always`. Changing this forces a new Resource Deployment Script to be created. * */ @Export(name="cleanupPreference", refs={String.class}, tree="[0]") private Output cleanupPreference; /** * @return Specifies the cleanup preference when the script execution gets in a terminal state. Possible values are `Always`, `OnExpiration`, `OnSuccess`. Defaults to `Always`. Changing this forces a new Resource Deployment Script to be created. * */ public Output> cleanupPreference() { return Codegen.optional(this.cleanupPreference); } /** * Command line arguments to pass to the script. Changing this forces a new Resource Deployment Script to be created. * */ @Export(name="commandLine", refs={String.class}, tree="[0]") private Output commandLine; /** * @return Command line arguments to pass to the script. Changing this forces a new Resource Deployment Script to be created. * */ public Output> commandLine() { return Codegen.optional(this.commandLine); } /** * A `container` block as defined below. Changing this forces a new Resource Deployment Script to be created. * */ @Export(name="container", refs={ResourceDeploymentScriptPowerShellContainer.class}, tree="[0]") private Output container; /** * @return A `container` block as defined below. Changing this forces a new Resource Deployment Script to be created. * */ public Output> container() { return Codegen.optional(this.container); } /** * An `environment_variable` block as defined below. Changing this forces a new Resource Deployment Script to be created. * */ @Export(name="environmentVariables", refs={List.class,ResourceDeploymentScriptPowerShellEnvironmentVariable.class}, tree="[0,1]") private Output> environmentVariables; /** * @return An `environment_variable` block as defined below. Changing this forces a new Resource Deployment Script to be created. * */ 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. Changing this forces a new Resource Deployment Script to be created. * */ @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. Changing this forces a new Resource Deployment Script to be created. * */ public Output> forceUpdateTag() { return Codegen.optional(this.forceUpdateTag); } /** * An `identity` block as defined below. Changing this forces a new Resource Deployment Script to be created. * */ @Export(name="identity", refs={ResourceDeploymentScriptPowerShellIdentity.class}, tree="[0]") private Output identity; /** * @return An `identity` block as defined below. Changing this forces a new Resource Deployment Script to be created. * */ public Output> identity() { return Codegen.optional(this.identity); } /** * Specifies the Azure Region where the Resource Deployment Script should exist. Changing this forces a new Resource Deployment Script to be created. * */ @Export(name="location", refs={String.class}, tree="[0]") private Output location; /** * @return Specifies the Azure Region where the Resource Deployment Script should exist. Changing this forces a new Resource Deployment Script to be created. * */ public Output location() { return this.location; } /** * Specifies the name which should be used for this Resource Deployment Script. The name length must be from 1 to 260 characters. The name can only contain alphanumeric, underscore, parentheses, hyphen and period, and it cannot end with a period. Changing this forces a new Resource Deployment Script to be created. * */ @Export(name="name", refs={String.class}, tree="[0]") private Output name; /** * @return Specifies the name which should be used for this Resource Deployment Script. The name length must be from 1 to 260 characters. The name can only contain alphanumeric, underscore, parentheses, hyphen and period, and it cannot end with a period. Changing this forces a new Resource Deployment Script to be created. * */ public Output name() { return this.name; } /** * List of script outputs. * */ @Export(name="outputs", refs={String.class}, tree="[0]") 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. Changing this forces a new Resource Deployment Script to be created. * */ @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. Changing this forces a new Resource Deployment Script to be created. * */ public Output> primaryScriptUri() { return Codegen.optional(this.primaryScriptUri); } /** * Specifies the name of the Resource Group where the Resource Deployment Script should exist. Changing this forces a new Resource Deployment Script to be created. * */ @Export(name="resourceGroupName", refs={String.class}, tree="[0]") private Output resourceGroupName; /** * @return Specifies the name of the Resource Group where the Resource Deployment Script should exist. Changing this forces a new Resource Deployment Script to be created. * */ public Output resourceGroupName() { return this.resourceGroupName; } /** * Interval for which the service retains the script resource after it reaches a terminal state. Resource will be deleted when this duration expires. The time duration should be between `1` hour and `26` hours (inclusive) and should be specified in ISO 8601 format. Changing this forces a new Resource Deployment Script to be created. * */ @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. The time duration should be between `1` hour and `26` hours (inclusive) and should be specified in ISO 8601 format. Changing this forces a new Resource Deployment Script to be created. * */ public Output retentionInterval() { return this.retentionInterval; } /** * Script body. Changing this forces a new Resource Deployment Script to be created. * */ @Export(name="scriptContent", refs={String.class}, tree="[0]") private Output scriptContent; /** * @return Script body. Changing this forces a new Resource Deployment Script to be created. * */ public Output> scriptContent() { return Codegen.optional(this.scriptContent); } /** * A `storage_account` block as defined below. Changing this forces a new Resource Deployment Script to be created. * */ @Export(name="storageAccount", refs={ResourceDeploymentScriptPowerShellStorageAccount.class}, tree="[0]") private Output storageAccount; /** * @return A `storage_account` block as defined below. Changing this forces a new Resource Deployment Script to be created. * */ public Output> storageAccount() { return Codegen.optional(this.storageAccount); } /** * Supporting files for the external script. Changing this forces a new Resource Deployment Script to be created. * */ @Export(name="supportingScriptUris", refs={List.class,String.class}, tree="[0,1]") private Output> supportingScriptUris; /** * @return Supporting files for the external script. Changing this forces a new Resource Deployment Script to be created. * */ public Output>> supportingScriptUris() { return Codegen.optional(this.supportingScriptUris); } /** * A mapping of tags which should be assigned to the Resource Deployment Script. * */ @Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]") private Output> tags; /** * @return A mapping of tags which should be assigned to the Resource Deployment Script. * */ public Output>> tags() { return Codegen.optional(this.tags); } /** * Maximum allowed script execution time specified in ISO 8601 format. Needs to be greater than 0 and smaller than 1 day. Defaults to `P1D`. Changing this forces a new Resource Deployment Script to be created. * */ @Export(name="timeout", refs={String.class}, tree="[0]") private Output timeout; /** * @return Maximum allowed script execution time specified in ISO 8601 format. Needs to be greater than 0 and smaller than 1 day. Defaults to `P1D`. Changing this forces a new Resource Deployment Script to be created. * */ public Output> timeout() { return Codegen.optional(this.timeout); } /** * Specifies the version of the Azure PowerShell that should be used in the format `X.Y` (e.g. `9.7`). A canonical list of versions [is available from the Microsoft Container Registry API](https://mcr.microsoft.com/v2/azure-powershell/tags/list). Changing this forces a new Resource Deployment Script to be created. * */ @Export(name="version", refs={String.class}, tree="[0]") private Output version; /** * @return Specifies the version of the Azure PowerShell that should be used in the format `X.Y` (e.g. `9.7`). A canonical list of versions [is available from the Microsoft Container Registry API](https://mcr.microsoft.com/v2/azure-powershell/tags/list). Changing this forces a new Resource Deployment Script to be created. * */ public Output version() { return this.version; } /** * * @param name The _unique_ name of the resulting resource. */ public ResourceDeploymentScriptPowerShell(java.lang.String name) { this(name, ResourceDeploymentScriptPowerShellArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public ResourceDeploymentScriptPowerShell(java.lang.String name, ResourceDeploymentScriptPowerShellArgs 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 ResourceDeploymentScriptPowerShell(java.lang.String name, ResourceDeploymentScriptPowerShellArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure:core/resourceDeploymentScriptPowerShell:ResourceDeploymentScriptPowerShell", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private ResourceDeploymentScriptPowerShell(java.lang.String name, Output id, @Nullable ResourceDeploymentScriptPowerShellState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure:core/resourceDeploymentScriptPowerShell:ResourceDeploymentScriptPowerShell", name, state, makeResourceOptions(options, id), false); } private static ResourceDeploymentScriptPowerShellArgs makeArgs(ResourceDeploymentScriptPowerShellArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? ResourceDeploymentScriptPowerShellArgs.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 ResourceDeploymentScriptPowerShell get(java.lang.String name, Output id, @Nullable ResourceDeploymentScriptPowerShellState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new ResourceDeploymentScriptPowerShell(name, id, state, options); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy