Skip to content

azurermAutomationVariableString

Manages a string variable in Azure Automation

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
  this,
  "example",
  {
    location: "West Europe",
    name: "tfex-example-rg",
  }
);
const azurermAutomationAccountExample =
  new azurerm.automationAccount.AutomationAccount(this, "example_1", {
    location: azurermResourceGroupExample.location,
    name: "tfex-example-account",
    resource_group_name: azurermResourceGroupExample.name,
    sku_name: "Basic",
  });
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermAutomationAccountExample.overrideLogicalId("example");
const azurermAutomationVariableStringExample =
  new azurerm.automationVariableString.AutomationVariableString(
    this,
    "example_2",
    {
      automation_account_name: azurermAutomationAccountExample.name,
      name: "tfex-example-var",
      resource_group_name: azurermResourceGroupExample.name,
      value: "Hello, Terraform Basic Test.",
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermAutomationVariableStringExample.overrideLogicalId("example");

Argument Reference

The following arguments are supported:

  • name - (Required) The name of the Automation Variable. Changing this forces a new resource to be created.

  • resourceGroupName - (Required) The name of the resource group in which to create the Automation Variable. Changing this forces a new resource to be created.

  • automationAccountName - (Required) The name of the automation account in which the Variable is created. Changing this forces a new resource to be created.

  • description - (Optional) The description of the Automation Variable.

  • encrypted - (Optional) Specifies if the Automation Variable is encrypted. Defaults to false.

  • value - (Optional) The value of the Automation Variable as a string.

Attributes Reference

The following attributes are exported:

  • id - The ID of the Automation Variable.

Timeouts

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

  • create - (Defaults to 30 minutes) Used when creating the Automation String Variable.
  • update - (Defaults to 30 minutes) Used when updating the Automation String Variable.
  • read - (Defaults to 5 minutes) Used when retrieving the Automation String Variable.
  • delete - (Defaults to 30 minutes) Used when deleting the Automation String Variable.

Import

Automation String Variable can be imported using the resourceId, e.g.

terraform import azurerm_automation_variable_string.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tfex-example-rg/providers/Microsoft.Automation/automationAccounts/tfex-example-account/variables/tfex-example-var