azurerm_automation_source_control

Manages an Automation Source Control.

Example Usage

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

resource "azurerm_automation_account" "example" {
  name                = "example-account"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
  sku_name            = "Basic"
}

resource "azurerm_automation_source_control" "example" {
  name                  = "example"
  automation_account_id = azurerm_automation_account.example.id
  folder_path           = "runbook"

  security {
    token      = "ghp_xxx"
    token_type = "PersonalAccessToken"
  }
  repository_url      = "https://github.com/foo/bat.git"
  source_control_type = "GitHub"
  branch              = "main"
}

Arguments Reference

The following arguments are supported:



A security 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

Automations can be imported using the resource id, e.g.

terraform import azurerm_automation_source_control.example /subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.Automation/automationAccounts/account1/sourceControls/sc1