Azure Automation account update managent provider through terraform

Hi,

i want to automate the Azure Automation Account update management “enable” through terraform. i do not see any documention for update management in Automation account provider section. please let me know if there is any document/steps are available

Terraform v0.12.18
azure rm version is 1.38

Hi,

You can try next configuration:

locals {

  location = "eastus"

  automation_account_location = "eastus2"

}

# Create Resource Group

resource "azurerm_resource_group" "rg" {

  name     = "tf-example-rg"

  location = local.location

}

# Create a Automation Account

resource "azurerm_automation_account" "automation_account" {

  name                = "tf-example-automation-account"

  location            = local.automation_account_location

  resource_group_name = azurerm_resource_group.rg.name

  sku_name = "Basic"

}

# Create a Log Analytics Workspace

resource "azurerm_log_analytics_workspace" "log_analytics_workspace" {

  name                = "tf-example-log-analytics-workspace"

  location            = azurerm_resource_group.rg.location

  resource_group_name = azurerm_resource_group.rg.name

  sku                 = "PerGB2018"

  retention_in_days   = 30

}

# Link Log Analytics Workspace to Automation Account

resource "azurerm_log_analytics_linked_service" "autoacc_linked_log_workspace" {

  resource_group_name = azurerm_resource_group.rg.name

  workspace_name      = azurerm_log_analytics_workspace.log_analytics_workspace.name

  resource_id         = azurerm_automation_account.automation_account.id

}

# Enable Update Management solution

resource "azurerm_log_analytics_solution" "update_solution" {

  depends_on = [

    azurerm_log_analytics_linked_service.autoacc_linked_log_workspace

  ]

  solution_name         = "Updates"

  location              = azurerm_resource_group.rg.location

  resource_group_name   = azurerm_resource_group.rg.name

  workspace_resource_id = azurerm_log_analytics_workspace.log_analytics_workspace.id

  workspace_name        = azurerm_log_analytics_workspace.log_analytics_workspace.name

  plan {

    publisher = "Microsoft"

    product   = "OMSGallery/Updates"

  }

}

@arestarh Thank you so much. enabled “updated management” successfully now.