Skip to content
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

[Bug]: aws_ram_principal_association can mange the same AWS resource from two different Terraform resources #33483

Closed
efrodriguez opened this issue Sep 15, 2023 · 3 comments · Fixed by #36062
Labels
bug Addresses a defect in current functionality. service/ram Issues and PRs that pertain to the ram service.
Milestone

Comments

@efrodriguez
Copy link

efrodriguez commented Sep 15, 2023

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

resource "aws_ram_principal_association" "ram_association_1" {
  principal          = "123456789000"
  resource_share_arn = "arn:aws:ram:us-east-1:123456789000:resource-share/e0d2fd62-91e1-4a87-82f8-51eb4d616262"
}

resource "aws_ram_principal_association" "ram_association_2" {
  principal          = "123456789000"
  resource_share_arn = "arn:aws:ram:us-east-1:123456789000:resource-share/e0d2fd62-91e1-4a87-82f8-51eb4d616262"
}

## Notice principal and resource_share_arn are the same for both Terraform resource declarations

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

@efrodriguez efrodriguez added the bug Addresses a defect in current functionality. label Sep 15, 2023
@github-actions github-actions bot added the service/ram Issues and PRs that pertain to the ram service. label Sep 15, 2023
@github-actions
Copy link

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • 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-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Sep 15, 2023
@justinretzolk justinretzolk removed the needs-triage Waiting for first response or review from a maintainer. label Nov 14, 2023
@ewbankkit ewbankkit changed the title [Bug]: aws_ram_resource_share can mange the same AWS resource from two different Terraform resources [Bug]: aws_ram_principal_association can mange the same AWS resource from two different Terraform resources Mar 13, 2024
@github-actions github-actions bot added this to the v5.41.0 milestone Mar 14, 2024
Copy link

This functionality has been released in v5.41.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/ram Issues and PRs that pertain to the ram service.
Projects
None yet
2 participants