-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Import of Container App Environment having problem with workload_profile #27057
Comments
Issue confirmed with the supplied configuration. The produced plan in the "workload_profile": [], And this in the "workload_profile": [
{
"maximum_count": null,
"minimum_count": null,
"name": "Consumption",
"workload_profile_type": "Consumption"
}
], The issue appears to be specific to the resource "azurerm_container_app_environment" "example" {
name = "test-cae02"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
infrastructure_resource_group_name = "${azurerm_resource_group.example.name}-dyn2"
infrastructure_subnet_id = azurerm_subnet.subnet2.id
internal_load_balancer_enabled = true
zone_redundancy_enabled = false
workload_profile {
name = "D4"
workload_profile_type = "D4"
minimum_count = 1
maximum_count = 2
}
}
import {
to = azurerm_container_app_environment.example
id = "/subscriptions/{subID}/resourceGroups/example-cae/providers/Microsoft.App/managedEnvironments/test-cae02"
} This returned a clean import plan with no changes to the Container App Environment. |
Hi @elesandroo , thanks for opening the issue. The problem you are facing is caused by a special handing of |
Hi @jiaweitao001, we originally created this resource using the Our Container App Environment currently contains one Container App that should use the Consumption SKU. Do you need some more information? |
To add a little more context to the issue, when a container app environment is created without an explicit Consumption SKU workload profile, Azure creates one implicitly. So this code: resource "azurerm_container_app_environment" "example2" {
name = "test-cae02"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
infrastructure_resource_group_name = "${azurerm_resource_group.example.name}-dyn2"
infrastructure_subnet_id = azurerm_subnet.subnet2.id
internal_load_balancer_enabled = true
zone_redundancy_enabled = false
workload_profile {
name = "D4"
workload_profile_type = "D4"
minimum_count = 1
maximum_count = 2
}
} Would create a container app environment with two workload profiles, The current workaround is for the plugin to look and see if the The problem you're encountering is that during import, the resource Read function gets a stub state based on the resource type that doesn't include the actual configuration. The stub has an empty workload profile, so the Read function returns back a state that doesn't include the Aside from changing how the resource itself is implemented, I don't see an easy workaround. You might as well leave it as an |
Thank you for the explanation. If I understand correctly,
So, if this error weren’t present, we wouldn’t have to configure Of course, that’s only my thinking. I don’t know whether there are any other dependencies or complications. |
Hi @elesandroo , you're right about Sorry for the miss leading error message here. The logic of this feature has changed quite a few times so it's not reflecting the most recent intentions. There will be a major release coming soon, that would fix the issue. Thanks for your understanding. |
Okay, I will be checking the changelog and wait for some update then. Thank you for your assistance. |
@jiaweitao001 can you point me to the current WIP? I'm curious to see how it's being resolved. Thanks! |
@elesandroo , I was not precise about |
Is there an existing issue for this?
Community Note
Terraform Version
1.8.5
AzureRM Provider Version
3.108.0
Affected Resource(s)/Data Source(s)
azurerm_container_app_environment
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
I would expect the terraform import to run without any changes. If you deploy this code instead of importing it, it completes successfully.
Actual Behaviour
Terraform plan tries to replace the resource because of
workload_profile
. If I remove it from the configuration, I get another error:Steps to Reproduce
terraform import
of the Container App EnvironmentImportant Factoids
No response
References
No response
The text was updated successfully, but these errors were encountered: