Skip to content

Commit

Permalink
add func for getting single sg
Browse files Browse the repository at this point in the history
  • Loading branch information
Abrar-Ahmed7 committed Feb 1, 2023
1 parent ddba394 commit 12e7612
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions internal/aws/ec2.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,18 @@ func GetSecGrps(sess session.Session) []*ec2.SecurityGroup {
return result.SecurityGroups
}

func GetSingleSecGrp(sess session.Session, sgId string) *ec2.DescribeSecurityGroupsOutput {
ec2Serv := *ec2.New(&sess)
result, err := ec2Serv.DescribeSecurityGroups(&ec2.DescribeSecurityGroupsInput{
GroupIds: []*string{&sgId},
})
if err != nil {
fmt.Println("Error in fetching Security Group: ", sgId, " err: ", err)
return nil
}
return result
}

/*
Volumes(ebs) are region specific
Localstack doesn't have default volumes, so at some regions, there won't be any volumes.
Expand Down

0 comments on commit 12e7612

Please sign in to comment.