[Bug]: aws_ram_principal_association can mange the same AWS resource from two different Terraform resources #33483
Labels
bug
Addresses a defect in current functionality.
service/ram
Issues and PRs that pertain to the ram service.
Milestone
Terraform Core Version
1.3.3
AWS Provider Version
4.38.0
Affected Resource(s)
aws_ram_principal_association
Expected Behavior
Terraform apply should fail with an error saying that the the RAM principal association already exists. Either one of the Terraform resources should be successful in creating the association and the other should error out because the association already exists.
Actual Behavior
Terraform apply finishes successfully and both Terraform resources end up managing the same AWS resource which is the RAM principal association. When one Terraform resource is destroyed, the AWS resource is effectively destroyed and any dependent resource stops working because the RAM principal association doesn't exists anymore even though there is another Terraform resource managing it.
This is less obvious when
aws_ram_resource_share
is provisioned as part of a module that is instantiated multiple times. Additional module instances should error out to tell the engineer that something is wrong with the module design.Relevant Error/Panic Output Snippet
No response
Terraform Configuration Files
Steps to Reproduce
Just run Terraform apply with the above Terraform configuration.
Debug Output
No response
Panic Output
No response
Important Factoids
No response
References
No response
Would you like to implement a fix?
None
The text was updated successfully, but these errors were encountered: