AzurePowerShellScript

class AzurePowerShellScript : KotlinCustomResource

Object model for the Azure PowerShell script. Uses Azure REST API version 2023-08-01. In version 2.x of the Azure Native provider, it used API version 2020-10-01.

Example Usage

DeploymentScriptsCreateNoUserManagedIdentity

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var azurePowerShellScript = new AzureNative.Resources.AzurePowerShellScript("azurePowerShellScript", new()
{
Arguments = "-Location 'westus' -Name \"*rg2\"",
AzPowerShellVersion = "1.7.0",
CleanupPreference = AzureNative.Resources.CleanupOptions.Always,
Kind = "AzurePowerShell",
Location = "westus",
ResourceGroupName = "script-rg",
RetentionInterval = "P7D",
ScriptContent = "Param([string]$Location,[string]$Name) $deploymentScriptOutputs['test'] = 'value' Get-AzResourceGroup -Location $Location -Name $Name",
ScriptName = "MyDeploymentScript",
SupportingScriptUris = new[]
{
"https://uri1.to.supporting.script",
"https://uri2.to.supporting.script",
},
Timeout = "PT1H",
});
});
package main
import (
resources "github.com/pulumi/pulumi-azure-native-sdk/resources/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := resources.NewAzurePowerShellScript(ctx, "azurePowerShellScript", &resources.AzurePowerShellScriptArgs{
Arguments: pulumi.String("-Location 'westus' -Name \"*rg2\""),
AzPowerShellVersion: pulumi.String("1.7.0"),
CleanupPreference: pulumi.String(resources.CleanupOptionsAlways),
Kind: pulumi.String("AzurePowerShell"),
Location: pulumi.String("westus"),
ResourceGroupName: pulumi.String("script-rg"),
RetentionInterval: pulumi.String("P7D"),
ScriptContent: pulumi.String("Param([string]$Location,[string]$Name) $deploymentScriptOutputs['test'] = 'value' Get-AzResourceGroup -Location $Location -Name $Name"),
ScriptName: pulumi.String("MyDeploymentScript"),
SupportingScriptUris: pulumi.StringArray{
pulumi.String("https://uri1.to.supporting.script"),
pulumi.String("https://uri2.to.supporting.script"),
},
Timeout: pulumi.String("PT1H"),
})
if err != nil {
return err
}
return nil
})
}
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("P7D")
.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.

$ pulumi import azure-native:resources:AzurePowerShellScript myresource1 /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deploymentScripts/{scriptName}

Properties

Link copied to clipboard
val arguments: Output<String>?

Command line arguments to pass to the script. Arguments are separated by spaces. ex: -Name blue* -Location 'West US 2'

Link copied to clipboard

Azure PowerShell module version to be used.

Link copied to clipboard
val azureApiVersion: Output<String>

The Azure API version of the resource.

Link copied to clipboard

The clean up preference when the script execution gets in a terminal state. Default setting is 'Always'.

Link copied to clipboard

Container settings.

Link copied to clipboard

The environment variables to pass over to the script.

Link copied to clipboard
val forceUpdateTag: Output<String>?

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.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard

Optional property. Managed identity to be used for this deployment script. Currently, only user-assigned MSI is supported.

Link copied to clipboard
val kind: Output<String>

Type of the script. Expected value is 'AzurePowerShell'.

Link copied to clipboard
val location: Output<String>

The location of the ACI and the storage account for the deployment script.

Link copied to clipboard
val name: Output<String>

Name of this resource.

Link copied to clipboard
val outputs: Output<Map<String, Any>>

List of script outputs.

Link copied to clipboard
val primaryScriptUri: Output<String>?

Uri for the script. This is the entry point for the external script.

Link copied to clipboard

State of the script execution. This only appears in the response.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

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).

Link copied to clipboard
val scriptContent: Output<String>?

Script body.

Link copied to clipboard

Contains the results of script execution.

Link copied to clipboard

Storage Account settings.

Link copied to clipboard

Supporting files for the external script.

Link copied to clipboard

The system metadata related to this resource.

Link copied to clipboard
val tags: Output<Map<String, String>>?

Resource tags.

Link copied to clipboard
val timeout: Output<String>?

Maximum allowed script execution time specified in ISO 8601 format. Default value is P1D

Link copied to clipboard
val type: Output<String>

Type of this resource.

Link copied to clipboard
val urn: Output<String>