Azure / terraform-azurerm-caf-enterprise-scale

Azure landing zones Terraform module
https://aka.ms/alz/tf
MIT License
870 stars 574 forks source link

Bug Report - CAF version 4.2.0 want to delete the automation account ! Why? #1181

Open hungbui78 opened 3 weeks ago

hungbui78 commented 3 weeks ago

Community Note

Versions

terraform: TERRAFORM_VERSION=1.7.4

azure provider:

Configure the Azure provider

terraform { required_providers { azurerm = { source = "hashicorp/azurerm" version = "3.54.0" } } module:

4.2.0

Description

Describe the bug

Today when I did a terraform plan on our CAF codes it says it want to delete the automation account that has been created by the module when we set it up few years back.

module.enterprise_scale.azurerm_automation_account.management["/subscriptions/$ARM_SUBSCRIPTION_ID/resourceGroups/prodTF-mgmt/providers/Microsoft.Automation/automationAccounts/prodTF-automation"] will be updated in-place

~ resource "azurerm_automation_account" "management" {

    id                            = "/subscriptions/$ARM_SUBSCRIPTION_ID/resourceGroups/prodTF-mgmt/providers/Microsoft.Automation/automationAccounts/prodTF-automation"

    name                          = "prodTF-automation"

    tags                          = {

        "deployedBy" = "terraform/azure/caf-enterprise-scale"

    }

    # (10 unchanged attributes hidden)

  - identity {

      - identity_ids = [] -> null

      - principal_id = "e417b213-71f6-47b7-b5d2-ec114662c6fb" -> null

      - tenant_id    = "$ARM_TENANT_ID" -> null

      - type         = "SystemAssigned" -> null

    }

}

Steps to Reproduce

terradform init terraform plan

Screenshots

Additional context

Why do the module want to delete that automation account? As I know it use for the log analytics data collection.

hungbui78 commented 3 weeks ago

Any update on this case?

hungbui78 commented 2 weeks ago

Bump!!

matt-FFFFFF commented 1 week ago

From what I can see it is trying to remove the managed identity that has been assigned to the automation account. This was probably done via other means in between the initial deployment and your more recent run.

microsoft-github-policy-service[bot] commented 2 days ago

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment.