You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-> % terraform plan
azurerm_resource_group.example: Refreshing state... [id=/subscriptions/xxx/resourceGroups/wt-test-apc]
azurerm_app_configuration.app_conf: Refreshing state... [id=/subscriptions/xxx/resourceGroups/wt-test-apc/providers/Microsoft.AppConfiguration/configurationStores/appconfigwt2541]
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the
following symbols:
~ update in-place
Terraform planned the following actions, but then encountered a problem:
# azurerm_app_configuration.app_conf will be updated in-place
~ resource "azurerm_app_configuration" "app_conf" {
id = "/subscriptions/xxx/resourceGroups/wt-test-apc/providers/Microsoft.AppConfiguration/configurationStores/appconfigwt2541"
name = "appconfigwt2541"
tags = {}
# (11 unchanged attributes hidden)
+ identity {
+ type = "SystemAssigned"
}
}
Plan: 0 to add, 1 to change, 0 to destroy.
╷
│ Error: Missing required argument
│
│ with azurerm_role_assignment.app_config_system_identity_log_analytics_contributor,
│ on main.tf line 36, in resource "azurerm_role_assignment" "app_config_system_identity_log_analytics_contributor":
│ 36: principal_id = azurerm_app_configuration.app_conf.identity[0].principal_id
│
│ The argument "principal_id" is required, but no definition was found.
╵
Expected Behavior
terraform plan no error.
Actual Behavior
terraform plan has error
Steps to Reproduce
create azurerm_app_configuration without identity
update the config, add a identity block for azurerm_app_configuration and a new azurerm_role_assignment refers to the azurerm_app_configuration.app_conf.identity[0].principal_id, the principal_id is a computed field returned by API.
run terraform plan, the error will show.
Additional Context
The identity block is quite common in azurerm. Seems during Update, a new added computed property inside a nested block cannot be referenced. But if all the resources are created from scratch, no error.
There already seems to be an issue filed for his in the azurerm repository which covers the issue. The problem is that the provider is not marking the new attribute as computed during the plan, which tells Terraform that the value will be null, so Terraform must use that null value in the plan for the azurerm_role_assignment. \
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Terraform Version
Terraform Configuration Files
first:
update to
Debug Output
Expected Behavior
terraform plan
no error.Actual Behavior
terraform plan
has errorSteps to Reproduce
azurerm_app_configuration
withoutidentity
identity
block forazurerm_app_configuration
and a newazurerm_role_assignment
refers to theazurerm_app_configuration.app_conf.identity[0].principal_id
, theprincipal_id
is acomputed
field returned by API.terraform plan
, the error will show.Additional Context
The
identity
block is quite common in azurerm. Seems during Update, a new added computed property inside a nested block cannot be referenced. But if all the resources are created from scratch, no error.References
The text was updated successfully, but these errors were encountered: