Creates an Azure Automation Account
Reference the module to a specific version (recommended):
module "automation" {
source = "git://github.com/aztfmod/automation.git?ref=v0.1"
auto_name = var.auto_account
resource_group_name = var.rg
location = var.location["region1"]
tags = var.tags
la_workspace_id = var.log_analytics_workspace.id
diagnostics_map = var.diagnostics_map
}
Or get the latest version
module "automation" {
source = "git://github.com/aztfmod/automation.git?ref=latest"
auto_name = var.auto_account
resource_group_name = var.rg
location = var.location["region1"]
tags = var.tags
la_workspace_id = var.log_analytics_workspace.id
diagnostics_map = var.diagnostics_map
}
(Required) Name for the automation account
variable "auto_name" {
description = "(Required) Name for the automation account"
}
Example
auto_name = "myautomation"
(Required) Name of the resource group to deploy the automation account.
variable "resource_group_name" {
description = "(Required) Resource group for automation account"
}
Example
resource_group_name = "operations-rg"
(Required) Define the region where the ASR vault will be created.
variable "location" {
description = "(Required) Define the region where the ASR vault will be created"
type = string
}
Example
location = "southeastasia"
(Required) Map of tags for the deployment
variable "tags" {
description = "(Required) map of tags for the deployment"
}
Example
tags = {
environment = "DEV"
owner = "Arnaud"
deploymentType = "Terraform"
}
(Required) Log Analytics Repository ID
variable "la_workspace_id" {
description = "Log Analytics Repository"
}
Example
la_workspace_id = "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/arnaud-hub-operations/providers/microsoft.operationalinsights/workspaces/mylalogs"
(Required) Map with the diagnostics repository information"
variable "diagnostics_map" {
description = "(Required) Map with the diagnostics repository information"
}
Example
diagnostics_map = {
diags_sa = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/arnaud-hub-operations/providers/Microsoft.Storage/storageAccounts/opslogskumowxv"
eh_id = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/arnaud-hub-operations/providers/Microsoft.EventHub/namespaces/opslogskumowxv"
eh_name = "opslogskumowxv"
}
(Required) Map with the diagnostics settings for automation account deployment. See the required structure in the following example or in the diagnostics module documentation.
variable "diagnostics_settings" {
description = "(Required) Map with the diagnostics settings for ASR deployment"
}
Example
diagnostics_settings = {
log = [
# ["Category name", "Diagnostics Enabled(true/false)", "Retention Enabled(true/false)", Retention_period]
["JobLogs", true, true, 30],
["JobStreams", true, true, 30],
["DscNodeStatus", true, true, 30],
]
metric = [
# ["Category name", "Metric Enabled(true/false)", "Retention Enabled(true/false)", Retention_period]
["AllMetrics", true, true, 30],
]
}
Returns the resource object of the created azure automation account.
output "object" {
value = azurerm_automation_account.auto_account
}
Returns the resource name of the created azure automation account.
output "name" {
value = azurerm_automation_account.auto_account.name
}
Returns the resource ID of the created azure automation account.
output "id" {
value = azurerm_automation_account.auto_account.id
}