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
data "azurerm_subscription""current" {
~ display_name = "DUMMY-SUBSCRIPTION-NAME" -> (known after apply)
~ id = "/subscriptions/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" -> (known after apply)
~ location_placement_id = "Public_XXX" -> (known after apply)
~ quota_id = "XXX" -> (known after apply)
~ spending_limit = "Off" -> (known after apply)
~ state = "Enabled" -> (known after apply)
~ subscription_id = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" -> (known after apply)
~ tags = {} -> (known after apply)
~ tenant_id = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" -> (known after apply)
+ timeouts {
+ read = (known after apply)
}
}
Expected Behaviour
After the first creation, the azurerm_role_assignment should not be recreated as nothing changed in resource definition.
Actual Behaviour
On every run of terraform plan/apply azurerm_role_assignment is recreated because azurerm_subscription.current data source is unkown/known after apply but none of Attributes References aren't changed. This forces recreation of azurerm_role_assignment resource and makes terraform plan output hard to read and understand what will actually change.
Steps to Reproduce
paste terraform configuration file
create resource with terraform apply
don't change anything in terrafrom configuration
run terraform plan again
Important Factoids
No response
References
No response
The text was updated successfully, but these errors were encountered:
Hi @karloefd95, I tried to reproduce this issue with your configuration and do not meet the data source refresh issue.
This issue is very similar with another one, which says the issue may be caused by some configuration dependency. Could you try to replace the 2 variables(principal_id and scope) with constant values and try it again?
Hi @ms-zhenhua , thanks for your reply. Yes, I was using data source in module which is depended on another module.
I switched data source to main.tf file and I'm now passing value of subscription from data source through variable into module and everything seems to work like it should.
Thanks for your reply and help.
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.
Is there an existing issue for this?
Community Note
Terraform Version
1.1.7
AzureRM Provider Version
3.40.0
Affected Resource(s)/Data Source(s)
azurerm_subscription, azurerm_client_config
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
After the first creation, the azurerm_role_assignment should not be recreated as nothing changed in resource definition.
Actual Behaviour
On every run of terraform plan/apply azurerm_role_assignment is recreated because azurerm_subscription.current data source is unkown/known after apply but none of Attributes References aren't changed. This forces recreation of azurerm_role_assignment resource and makes terraform plan output hard to read and understand what will actually change.
Steps to Reproduce
Important Factoids
No response
References
No response
The text was updated successfully, but these errors were encountered: