cloud/awscloud: describe security groups using filters
Using the group names option only works for the default VPC, the workers are not running in the default VPC. For non-default VPCs filters should be used.
This commit is contained in:
parent
bb43f330b8
commit
5025ec31d3
1 changed files with 7 additions and 2 deletions
|
|
@ -201,8 +201,13 @@ func isInvalidGroupNotFoundErr(err error) bool {
|
|||
func (a *AWS) createOrReplaceSG(hostInstanceID, hostIP, vpcID string) (string, error) {
|
||||
sgName := fmt.Sprintf("SG for %s (%s)", hostInstanceID, hostIP)
|
||||
descrSGOutput, err := a.ec2.DescribeSecurityGroups(&ec2.DescribeSecurityGroupsInput{
|
||||
GroupNames: []*string{
|
||||
aws.String(sgName),
|
||||
Filters: []*ec2.Filter{
|
||||
&ec2.Filter{
|
||||
Name: aws.String("group-name"),
|
||||
Values: []*string{
|
||||
aws.String(sgName),
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
if err != nil && !isInvalidGroupNotFoundErr(err) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue