feat: Added optional revoke_rules_on_delete functionality (required for EMR) #179
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
A new optional boolean variable was created in the variables.tf to allow revoke_rules_on_delete to be set.
Within the main.tf, this new variable was used to set the attribute on Security Group creation.
The README has been updated to include the details on the new
Motivation and Context
While using this module in collaboration with AWS EMR, some issues were found on doing a destroy of the entire stack. AWS EMR creates additional rules in the SG's and in my experience seemed to create a circular dependency where rules in one SG referenced another SG and vice versa. The only resolution appeared to be manual intervention to remove the rules from the SG's and then re-run a destroy to allow a teardown of resources.
Breaking Changes
This has no breaking changes as the variable has been added with a default value of false, so anyone wishing to utilise this capability would only need to pass in the variable with the true value.
How Has This Been Tested?
I was initially using the module as is and was encountering the failure on destroy where an EMR was provisioned. I branched off the repo in our local environment and made the changes to add the new variable & apply it to the resources for SG creation. When using this branch I was successfully able to create the necessary resources and then run an E2E destroy of all components which were spun up from Terraform without any manual intervention.