Find launch templates based on network interface security groups

This commit is contained in:
Ciprian Hacman 2020-02-27 13:09:16 +02:00
parent 61511b5c43
commit 7b5a4714e0
1 changed files with 4 additions and 1 deletions

View File

@ -1204,7 +1204,10 @@ func FindAutoScalingLaunchTemplateConfigurations(cloud fi.Cloud, securityGroups
}
for _, j := range req.LaunchTemplateVersions {
// @check if the security group references the security group above
for _, y := range j.LaunchTemplateData.SecurityGroupIds {
var s []*string
s = append(s, j.LaunchTemplateData.NetworkInterfaces[0].Groups...)
s = append(s, j.LaunchTemplateData.SecurityGroupIds...)
for _, y := range s {
if securityGroups.Has(fi.StringValue(y)) {
list = append(list, &resources.Resource{
Name: aws.StringValue(x.LaunchTemplateName),