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.51k stars 4.6k forks source link

azurerm_container_app_environment infrastructure_resource_group_name not being set after version 3.109.0 #26602

Open iam-take opened 2 months ago

iam-take commented 2 months ago

Is there an existing issue for this?

Community Note

Terraform Version

1.5.7

AzureRM Provider Version

3.110.0

Affected Resource(s)/Data Source(s)

azurerm_container_app_environment

Terraform Configuration Files

resource "azurerm_container_app_environment" "module" {
  location                                    = "westeurope"
  name                                        = "xyz"
  resource_group_name                         = "xyz"
  infrastructure_subnet_id                    = "subnet_id"
  infrastructure_resource_group_name          = "xyz"
  internal_load_balancer_enabled              = true

workload_profile = {
      name                  = "Consumption"
      workload_profile_type = "Consumption"
      minimum_count         = 0
      maximum_count         = 0
    }
}

Debug Output/Panic Output

No debug output

Expected Behaviour

We expect the value of the infrastructure_resource_group_name to be set by the resource however since version 3.110.0 and higher this not being done anymore. I've tested 3.109.0 still works.

On version 3.109.0 this is the plan view which is also being applied. The variable is visible with the proper value content.

 module.container_apps["xxx"].azurerm_container_app_environment.module will be created
  + resource "azurerm_container_app_environment" "module" {
      + custom_domain_verification_id      = (known after apply)
      + default_domain                     = (known after apply)
      + docker_bridge_cidr                 = (known after apply)
      + id                                 = (known after apply)
      **+ infrastructure_resource_group_name = "xyz"**
      + infrastructure_subnet_id           = (known after apply)
      + internal_load_balancer_enabled     = true
      + location                           = "westeurope"
      + mutual_tls_enabled                 = false
      + name                               = (known after apply)
      + platform_reserved_cidr             = (known after apply)
      + platform_reserved_dns_ip_address   = (known after apply)
      + resource_group_name                = (known after apply)
      + static_ip_address                  = (known after apply)
      + tags                               = {  }
      + zone_redundancy_enabled            = false

      + workload_profile {
          + maximum_count         = 0
          + minimum_count         = 0
          + name                  = "Consumption"
          + workload_profile_type = "Consumption"
        }
    }

Actual Behaviour

The whole variable is not visible. The plan output json shows it as being null instead of the value that we pass

 module.container_apps["xxx"].azurerm_container_app_environment.module will be created
  + resource "azurerm_container_app_environment" "module" {
      + custom_domain_verification_id      = (known after apply)
      + default_domain                     = (known after apply)
      + docker_bridge_cidr                 = (known after apply)
      + id                                 = (known after apply)
      + infrastructure_subnet_id           = (known after apply)
      + internal_load_balancer_enabled     = true
      + location                           = "westeurope"
      + mutual_tls_enabled                 = false
      + name                               = (known after apply)
      + platform_reserved_cidr             = (known after apply)
      + platform_reserved_dns_ip_address   = (known after apply)
      + resource_group_name                = (known after apply)
      + static_ip_address                  = (known after apply)
      + tags                               = {  }
      + zone_redundancy_enabled            = false

      + workload_profile {
          + maximum_count         = 0
          + minimum_count         = 0
          + name                  = "Consumption"
          + workload_profile_type = "Consumption"
        }
    }

Steps to Reproduce

No response

Important Factoids

No response

References

No response

antnsn commented 2 months ago

I can verify the same issue applies to 3.111.0