Open vbauchart opened 1 month ago
Voting for Prioritization
Volunteering to Work on This Issue
Hey @vbauchart 👋 Thank you for taking the time to raise this! I'm not sure it's possible to achieve what you're referring to here due to the way to that Terraform works at its core. Each resource is independent of one another (aside from implicit/explicit dependencies that help determine the order of operations), so there's no way for Terraform to "know" that it shouldn't allow the configuration. That sort of mechanism would first need to be implemented at the Terraform Core level before the AWS Provider would be able to fail for this sort of misconfiguration.
That said, I'm going to leave this enhancement open for now, in case I've missed some key bit of information, someone else has a different opinion, or in case Terraform Core implements something that would help us to accomplish this. It may be worth opening a feature request in the Terraform Core repository for better visibility.
To be honest, I somewhat expected this response. In my opinion, all the new "_exclusive" resources partially violate the core Terraform concepts of idempotency and should simply not be used.
Description
When I mix
aws_iam_role_policy_attachments_exclusive
resource with any other ressource that manage policy of this role, I get hazardous results, as said in the documentation.But the documentation is not sufficient. The provider should fail explicitly, or at least have a clear warning to prevent the user to get an inconsistent configuration.
Affected Resource(s) and/or Data Source(s)
Potential Terraform Configuration
References
No response
Would you like to implement a fix?
No