This repository has been archived by the owner on Sep 9, 2022. It is now read-only.
Add security group individual rule descriptions #475
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.
This addresses the concern from #437. This PR adds a description into each rule block in an SG.
is now
There is a limitation to this approach though. When creating a rule with multiple cidr blocks or security groups, 2 separate rules are created in the AWS console, but get processed by the API/terraforming as 1 rule with 2 cidr blocks / security groups.
If you were to (1) create a rule like described above, and (2) manually edit the description of one of those rules in the AWS console, the current way terraforming is structured (using in-line rules) would not be able to preserve the changed description.
As discussed in #262, using these in-line rules allows for mixing what are really multiple rules into one rule block. When using the separate
aws_security_group_rule
resource, only one ofcidr_blocks
,ipv6_cidr_blocks
,security_groups
andself
are allowed, which allows you to ensure that the separate descriptions for each are preserved.This isn't a major issue as I don't think what I described impacts most use cases of terraforming, but be aware that it exists and that the ideal solution is to migrate to creating
aws_security_group_rule
resources alongside the mainaws_security_group
resource.