terraform plan incorrectly wants to blank a security group ingress description #2018
Labels
bug
Addresses a defect in current functionality.
service/ec2
Issues and PRs that pertain to the ec2 service.
Milestone
Terraform Version
If I knew how to use a
master
build of this provider, I would report if this has been fixed since 1.1.0Affected Resource(s)
aws_security_group
(specifically aningress
block)Terraform Configuration Files
Debug Output
I'll be glad to create a gist of the entire run, but I would have to scrub it, so I would only want to do that if this plan output -- which I feel is very clear, when taken with the AWS EC2 api response -- isn't sufficient
In the following output, I moved the
426799852
creation text next to its1365611918
destruction text to make that relationship more obvious; the3854841948
"copy" action at the bottom is correct, it's theingress.1365611918.description
change that is wrong -- the EC2IpRange
"10.2.0.0/16" has no description to begin with, and thus does not need it blankedExpected Behavior
The
plan
output should have indicated no changes requiredActual Behavior
The
plan
output proposed modifying the security group, specifically itsingress
blockSteps to Reproduce
sg-abcdef
blah.tf
terraform plan
Important Factoids
There are three interesting observations:
.tf
.tfstate
fileec2 describe-security-groups
(which 100% matches the--debug
traffic fromterraform-provider-aws
)First, I tried manually distinguishing where the
description
should go by splitting out the with-description ingress from the without-description ingress by creating two separateresource "aws_security_group_rule" "jenkins-sg_10-5_22"
but it didn't help (and made the problem much worse)Then, I thought maybe it was just a
.tfstate
problem, and updated theattributes
block to correctly describe the"description": "blah blah message",
, but this also did not helpThe output from
aws ec2 describe-security-groups --filters 'Name=tag-value,Values=jenkins-sg'
demonstrates that AWS itself is rolling up thoseingress
blocks and pushing thedescription
down onto the actual CIDRIpRange
, whereas it seemsterraform-provider-aws
is erroneously recombining them at some step, resulting in a mismatch with the tfstate (and actual) situationThis is the output from that
describe-security-groups
and matches (as one might expect) the debug-level<DescribeSecurityGroupsResponse
from AWSReferences
The text was updated successfully, but these errors were encountered: