From a8679f508cf06a3a687e74f395b97569d522544d Mon Sep 17 00:00:00 2001 From: Erik Kristensen Date: Tue, 5 Apr 2022 01:04:18 -0600 Subject: [PATCH] fix: default security group deletion, should not proceed if groupIds is 0 (#766) --- resources/ec2-default-security-group-rules.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/resources/ec2-default-security-group-rules.go b/resources/ec2-default-security-group-rules.go index 9ca44a121..3e782b66b 100644 --- a/resources/ec2-default-security-group-rules.go +++ b/resources/ec2-default-security-group-rules.go @@ -43,6 +43,10 @@ func ListEC2SecurityGroupRules(sess *session.Session) ([]Resource, error) { return nil, err } + if len(groupIds) == 0 { + return resources, nil + } + sgRuleFilters := []*ec2.Filter{ { Name: aws.String("group-id"),