Skip to content

azurermAutomationConnectionCertificate

Manages an Automation Connection with type azure.

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 azurermAutomationCertificateExample =
  new azurerm.automationCertificate.AutomationCertificate(this, "example_4", {
    automation_account_name: azurermAutomationAccountExample.name,
    base64: '${filebase64("certificate.pfx")}',
    name: "certificate-example",
    resource_group_name: azurermResourceGroupExample.name,
  });
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermAutomationCertificateExample.overrideLogicalId("example");
const azurermAutomationConnectionCertificateExample =
  new azurerm.automationConnectionCertificate.AutomationConnectionCertificate(
    this,
    "example_5",
    {
      automation_account_name: azurermAutomationAccountExample.name,
      automation_certificate_name: azurermAutomationCertificateExample.name,
      name: "connection-example",
      resource_group_name: azurermResourceGroupExample.name,
      subscription_id: dataAzurermClientConfigExample.subscriptionId,
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermAutomationConnectionCertificateExample.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.

  • automationCertificateName - (Required) The name of the automation certificate.

  • subscriptionId - (Required) The id of subscription where the automation certificate exists.

  • 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_certificate.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Automation/automationAccounts/account1/connections/conn1