Skip to content

azurermAutomationConnection

Manages an Automation Connection.

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.*/
new azurerm.provider.AzurermProvider(this, "azurerm", {
  features: [{}],
});
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
  this,
  "example",
  {
    location: "West Europe",
    name: "resourceGroup-example",
  }
);
const dataAzurermClientConfigExample =
  new azurerm.dataAzurermClientConfig.DataAzurermClientConfig(
    this,
    "example_2",
    {}
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
dataAzurermClientConfigExample.overrideLogicalId("example");
const azurermAutomationAccountExample =
  new azurerm.automationAccount.AutomationAccount(this, "example_3", {
    location: azurermResourceGroupExample.location,
    name: "account-example",
    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 azurermAutomationConnectionExample =
  new azurerm.automationConnection.AutomationConnection(this, "example_4", {
    automation_account_name: azurermAutomationAccountExample.name,
    name: "connection-example",
    resource_group_name: azurermResourceGroupExample.name,
    type: "AzureServicePrincipal",
    values: [
      {
        ApplicationId: "00000000-0000-0000-0000-000000000000",
        CertificateThumbprint: "sample-certificate-thumbprint",
        SubscriptionId: dataAzurermClientConfigExample.subscriptionId,
        TenantId: dataAzurermClientConfigExample.tenantId,
      },
    ],
  });
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermAutomationConnectionExample.overrideLogicalId("example");

Argument Reference

The following arguments are supported:

  • name - (Required) Specifies the name of the Connection. Changing this forces a new resource to be created.

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

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

  • type - (Required) The type of the Connection - can be either builtin type such as azure, azureClassicCertificate, and azureServicePrincipal, or a user defined types. Changing this forces a new resource to be created.

  • values - (Required) A mapping of key value pairs passed to the connection. Different type needs different parameters in the values. Builtin types have required field values as below:

    • azure: parameters automationCertificateName and subscriptionId.

    • azureClassicCertificate: parameters subscriptionName, subscriptionId and certificateAssetName.

    • azureServicePrincipal: parameters applicationId, certificateThumbprint, subscriptionId and tenantId.

  • description - (Optional) A description for this Connection.

Attributes Reference

The following attributes are exported:

  • id - The Automation Connection ID.

Timeouts

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

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

Import

Automation Connection can be imported using the resourceId, e.g.

terraform import azurerm_automation_connection.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Automation/automationAccounts/account1/connections/conn1