Update SG rule input variable defaults to null #25
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
Be consistent with evaluating AWS security group rules creation based on
null
variable value rather than the length of a list. The following inputs defaulted to an empty list ([]
) which can cause issues when transitioning from a populated list to an empty list (default value), given how thecount
logic currently exists within the resources.When changing the value of an input from a list with one or more items in it to an empty list, Terraform wants to replace the resources, but they shouldn't really be recreated if the list is empty. Terraform will run for at least 10 minutes on the create operation until it reaches a timeout.
Related issue
N/A
Type of change
How has this been tested?
Transition from running
terraform apply
while the variables are populated with CIDR ranges in a list, to commenting them out and running anotherterraform apply
which causes them to take on the default value ofnull
- with no issue. Going back and forth between the two configurations without Terraform hanging/timing out.Checklist
Additional notes
N/A