-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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: data source for AWS Security Group #9604
Conversation
1255030
to
a3ffe0c
Compare
return fmt.Errorf("no matching SecurityGroup found") | ||
} | ||
if len(resp.SecurityGroups) > 1 { | ||
return fmt.Errorf("multiple Security Groups matched; use additional constraints to reduce matches to a single Security Groups") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should probably write "...matches to a single Security Group", instead of "...matches to a single Security Groups".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I correct this in f1ac11e commit
conn := meta.(*AWSClient).ec2conn | ||
req := &ec2.DescribeSecurityGroupsInput{} | ||
|
||
if id := d.Get("id"); id != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would GetOk
be better here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I correct this in f1ac11e commit
req.Filters = nil | ||
} | ||
|
||
log.Printf("[DEBUG] Describe Security Groups %s\n", req) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be %v
here most likely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I correct this in f1ac11e commit
Thank you for your comments, I modified the code with these. |
Read: dataSourceAwsSecurityGroupRead, | ||
|
||
Schema: map[string]*schema.Schema{ | ||
"vpc_id": &schema.Schema{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The &schema.Schema
can be removed for Go 1.7+.
@mathieuherbert hi there! Thank you so much! The last comment I made is just a nit pick, it is not essential to get this merged. Great contribution! Thank you again! ❤️ |
this LGTM! Tests are also great - nice first PR to Terraform :)
|
* provider/aws: data source for AWS Security Group * provider/aws: add documentation for data source for AWS Security Group * provider/aws: data source for AWS Security Group (improve if condition and syntax) * fix fmt
* provider/aws: data source for AWS Security Group * provider/aws: add documentation for data source for AWS Security Group * provider/aws: data source for AWS Security Group (improve if condition and syntax) * fix fmt
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. |
To add Security Group data source for AWS provider.
The acceptance test
It's my first pull request, don't hesitate to tell me what can be improved.