hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.46k stars 4.54k forks source link

azurerm_container_app_environment - log_analytics_workspace_id - incorrect case match for attribute validation #26327

Open camilosantana opened 3 weeks ago

camilosantana commented 3 weeks ago

Is there an existing issue for this?

Community Note

Terraform Version

1.8.5

AzureRM Provider Version

3.103.1

Affected Resource(s)/Data Source(s)

azurerm_container_app_environment

Terraform Configuration Files

data calls and copy/paste from the console will give you an id that `azurerm_container_app_environment` won't accept.

error:

│ The parsed Resource ID was missing a value for the segment at position 2
│ (which should be the literal value "resourceGroups").

Example config

```hcl
data "azurerm_log_analytics_workspace" "ace" {
  name                = "a_workspace"
  resource_group_name = "a_resource_group"
}
resource "azurerm_container_app_environment" "a" {
  name                           = "example"
  location                       = "eastus"
  resource_group_name            = "a_resource_group"
  infrastructure_subnet_id       = azurerm_subnet.a[0].id
  internal_load_balancer_enabled = true
  # log_analytics_workspace_id     = data.azurerm_log_analytics_workspace.ace.id # this tries to force replacement as of azrm 3.103.1
  workload_profile {
    maximum_count         = 3
    minimum_count         = 1
    name                  = "basic"
    workload_profile_type = "D4"
  }
}

Debug Output/Panic Output

│ The parsed Resource ID was missing a value for the segment at position 2
│ (which should be the literal value "resourceGroups").

Expected Behaviour

accept the input as valid

Actual Behaviour

input is rejected

Steps to Reproduce

run the above terraform you'll have to finagle the subnet because of race condition with delegation (that's another issue altogether)

Important Factoids

No response

References

No response

jiaweitao001 commented 3 weeks ago

Hi @camilosantana , thanks for opening the issue. Could you please provide an example TF config here so we can try to reproduce this error? Thanks.