Skip to content

azure-automn-variable-encrypted

Ensure that Automation account variables are encrypted

To prevent accidentally exposing secrets, it is recommended to encrypt all automation variables.

Examples

Insecure Example

resource "azurerm_automation_variable_string" "example" {
  name                    = "tfex-example-var"
  resource_group_name     = azurerm_resource_group.example.name
  automation_account_name = azurerm_automation_account.example.name
  value                   = "Hello, Terraform Basic Test."
  encrypted               = false  # (default value is false)
}

Secure Example

resource "azurerm_automation_variable_string" "example" {
  name                    = "tfex-example-var"
  resource_group_name     = azurerm_resource_group.example.name
  automation_account_name = azurerm_automation_account.example.name
  value                   = "Hello, Terraform Basic Test."
  encrypted               = true
}

More information