Azure / terraform-azurerm-alz-management

Terraform module to deploy Azure Landing Zone Management resources.
https://registry.terraform.io/modules/Azure/alz-management/azurerm/latest
MIT License
9 stars 6 forks source link

Log analytics workspace name references in created Policies expects other name than actual creaed workspace #38

Open knuterik-ballestad opened 11 months ago

knuterik-ballestad commented 11 months ago

Is there an existing issue for this?

Greenfield/Brownfield provisioning

greenfield

Terraform Version

1.6.2

Module Version

0.1.5

AzureRM Provider Version

= 3.75

Affected Resource(s)/Data Source(s)

azurerm.management

Terraform Configuration Files

module "alz-management" {
  source  = "Azure/alz-management/azurerm"
  version = "0.1.5"

  #deploy_resource_group        = false
  automation_account_name      = "aa-management-${var.DEFAULT_LOCATION}"
  location                     = var.DEFAULT_LOCATION
  log_analytics_workspace_name = "log-management-${var.DEFAULT_LOCATION}"
  resource_group_name          = "rg-management-${var.DEFAULT_LOCATION}"

  providers = {
    azurerm = azurerm.management
  }
}

tfvars variables values

Doesn't matter what values are used

Debug Output/Panic Output

No output needed to validate this

Expected Behaviour

Log analytics workspace with name "ALZ-law" created OK

Policies that enforces logging to /sub../xxx/res..Gr../ALZ-mgmt/providers/Microsoft.OperationalInsights/workspaces/ALZ-law" expected!

Actual Behaviour

Policies that enforced logging to /sub../xxx/res..Gr../ALZ-mgmt/providers/Microsoft.OperationalInsights/workspaces/ALZ-la" was deployed instead!

Quick fix was to manually create a log analytics workspace named "ALZ-la" in addition to the created "ALZ-law"

Steps to Reproduce

No response

Important Factoids

No response

References

No response

luke-taylor commented 11 months ago

Hey, this module only deploys the Log Analytics Workspace, not policies. What module are you using for that?

matt-FFFFFF commented 11 months ago

If you are using the caf-enterprise-scale module see: https://github.com/Azure/terraform-azurerm-caf-enterprise-scale/issues/850#issuecomment-1794687242

It describes how to pass in an existing LA workspace id to the module