[Bug]: Issue with multiple aws_cloudformation_stack_instances resources on the same aws_cloudformation_stack_set, but with different regions or OUs #40243
When deploying multiple aws_cloudformation_stack_instances resources that point to the same aws_cloudformation_stack_set, but have a different value for the parameter regions or organizational_unit_ids, I would expect the resources to only require an update if the value changes, not on each terraform plan/apply
Use case is to deploy a Cloud Formation StackSet to only 1 region for certain accounts, but to multiple regions for other accounts.
Or to deploy a StackSet to all accounts in 1 OU, and only to a limited set of accounts in another OU.
It's not clear to me whether this is a bug, a limitations from AWS or a misunderstand from my side.
Actual Behavior
Initially the resources are created correctly. But on every terraform plan/apply it marks the regions or organizational_unit_ids parameters as being modified, requiring an update of the resource.
Relevant Error/Panic Output Snippet
No response
Terraform Configuration Files
Example 1: multiple aws_cloudformation_stack_instances resources, but for different regions.
Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
Volunteering to Work on This Issue
If you are interested in working on this issue, please leave a comment.
If this would be your first contribution, please review the contribution guide.
Terraform Core Version
1.9.8
AWS Provider Version
5.76.0
Affected Resource(s)
Expected Behavior
When deploying multiple
aws_cloudformation_stack_instances
resources that point to the sameaws_cloudformation_stack_set
, but have a different value for the parameterregions
ororganizational_unit_ids
, I would expect the resources to only require an update if the value changes, not on eachterraform plan/apply
Use case is to deploy a Cloud Formation StackSet to only 1 region for certain accounts, but to multiple regions for other accounts.
Or to deploy a StackSet to all accounts in 1 OU, and only to a limited set of accounts in another OU.
It's not clear to me whether this is a bug, a limitations from AWS or a misunderstand from my side.
Actual Behavior
Initially the resources are created correctly. But on every
terraform plan/apply
it marks theregions
ororganizational_unit_ids
parameters as being modified, requiring an update of the resource.Relevant Error/Panic Output Snippet
No response
Terraform Configuration Files
Example 1: multiple
aws_cloudformation_stack_instances
resources, but for different regions.Example 2: multiple
aws_cloudformation_stack_instances
resources, but for different OUs.Steps to Reproduce
terraform apply
terraform apply
again, updates are needed to resourcesDebug Output
No response
Panic Output
No response
Important Factoids
No response
References
No response
Would you like to implement a fix?
No