azurerm_resource_deployment_script_azure_power_shell

Manages a Resource Deployment Script of Azure PowerShell.

Example Usage

resource "azurerm_resource_group" "example" {
  name     = "example-resources"
  location = "West Europe"
}

resource "azurerm_user_assigned_identity" "example" {
  name                = "example-uai"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
}

resource "azurerm_resource_deployment_script_azure_power_shell" "example" {
  name                = "example-rdsaps"
  resource_group_name = azurerm_resource_group.example.name
  location            = "West Europe"
  version             = "8.3"
  retention_interval  = "P1D"
  command_line        = "-name \"John Dole\""
  cleanup_preference  = "OnSuccess"
  force_update_tag    = "1"
  timeout             = "PT30M"

  script_content = <<EOF
          param([string] $name)
            $output = 'Hello {0}.' -f $name
            Write-Output $output
            $DeploymentScriptOutputs = @{}
            $DeploymentScriptOutputs['text'] = $output
  EOF

  identity {
    type = "UserAssigned"
    identity_ids = [
      azurerm_user_assigned_identity.example.id
    ]
  }

  tags = {
    key = "value"
  }
}
          param([string] $name)
            $output = 'Hello {0}.' -f $name
            Write-Output $output
            $DeploymentScriptOutputs = @{}
            $DeploymentScriptOutputs['text'] = $output
  EOF

  identity {
    type = "UserAssigned"
    identity_ids = [
      azurerm_user_assigned_identity.example.id
    ]
  }

  tags = {
    key = "value"
  }
}

Arguments Reference

The following arguments are supported:


A container block supports the following:


An environment_variable block supports the following:


An identity block supports the following:


A storage_account block supports the following:

Attributes Reference

In addition to the Arguments listed above - the following Attributes are exported:

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

Import

Resource Deployment Script can be imported using the resource id, e.g.

terraform import azurerm_resource_deployment_script_azure_power_shell.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.Resources/deploymentScripts/script1