Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provider/aws: Fix issue with detecting drift in AWS Security Groups rules #4779

Merged
merged 1 commit into from
Jan 25, 2016

Conversation

catsby
Copy link
Contributor

@catsby catsby commented Jan 21, 2016

This PR updates the resourceAwsSecurityGroupIPPermGather method to correctly create the Ingress/Egress TypeSet need to store the data locally. #4741 revealed that ingress/egress rules were not actually being stored on Read of a Security Group. There was an error with d.Set("ingress") (and egress) that was being ignored, and as a result whatever was in the configuration file remained unchanged since the first initial set on create.

This prevented drift from being detected, e.g. an additional rule being added on the AWS Console.

The crux of it was that resourceAwsSecurityGroupIPPermGather would return a slice of security group Ids, which was not compatible with the TypeSet that it was supposed to be.

This PR fixes that by correctly formatting the []map[string]interface{} returned from the method to include the Set of security groups, instead of a slice of strings.

Fixes #4741

@catsby
Copy link
Contributor Author

catsby commented Jan 21, 2016

Users upgrading to this may see non empty plans related to security groups. While unfortunate, it's actually correct... without this patch drift or other changes are being ignored

@phinze
Copy link
Contributor

phinze commented Jan 25, 2016

LGTM

catsby added a commit that referenced this pull request Jan 25, 2016
provider/aws: Fix issue with detecting drift in AWS Security Groups rules
@catsby catsby merged commit 0f2f9da into master Jan 25, 2016
@jen20 jen20 deleted the aws-sg-drift-fix branch April 24, 2016 23:56
@ghost
Copy link

ghost commented Apr 26, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Security Groups do not detect drifted source group rules in refresh, causing errors
2 participants