Resource Deployment Script Azure Cli
Manages a Resource Deployment Script of Azure Cli.
Example Usage
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.ResourceDeploymentScriptAzureCli;
import com.pulumi.azure.core.ResourceDeploymentScriptAzureCliArgs;
import com.pulumi.azure.core.inputs.ResourceDeploymentScriptAzureCliIdentityArgs;
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 exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()
.location("West Europe")
.build());
var exampleUserAssignedIdentity = new UserAssignedIdentity("exampleUserAssignedIdentity", UserAssignedIdentityArgs.builder()
.location(exampleResourceGroup.location())
.resourceGroupName(exampleResourceGroup.name())
.build());
var exampleResourceDeploymentScriptAzureCli = new ResourceDeploymentScriptAzureCli("exampleResourceDeploymentScriptAzureCli", ResourceDeploymentScriptAzureCliArgs.builder()
.resourceGroupName(exampleResourceGroup.name())
.location("West Europe")
.version("2.40.0")
.retentionInterval("P1D")
.commandLine("'foo' 'bar'")
.cleanupPreference("OnSuccess")
.forceUpdateTag("1")
.timeout("PT30M")
.scriptContent("""
echo "{\"name\":{\"displayName\":\"$1 $2\"}}" $AZ_SCRIPTS_OUTPUT_PATH
""")
.identity(ResourceDeploymentScriptAzureCliIdentityArgs.builder()
.type("UserAssigned")
.identityIds(exampleUserAssignedIdentity.id())
.build())
.tags(Map.of("key", "value"))
.build());
}
}
Import
Resource Deployment Script can be imported using the resource id
, e.g.
$ pulumi import azure:core/resourceDeploymentScriptAzureCli:ResourceDeploymentScriptAzureCli example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.Resources/deploymentScripts/script1
Properties
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.
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.
Specifies the version of the Azure CLI that should be used in the format X.Y.Z
(e.g. 2.30.0
). A canonical list of versions is available from the Microsoft Container Registry API. Changing this forces a new Resource Deployment Script to be created.