MCPcopy Create free account
hub / github.com/coldbrewcloud/coldbrew-cli / RetrieveSecurityGroups

Method RetrieveSecurityGroups

aws/ec2/client.go:144–162  ·  view source on GitHub ↗
(securityGroupIDs []string)

Source from the content-addressed store, hash-verified

142}
143
144func (c *Client) RetrieveSecurityGroups(securityGroupIDs []string) ([]*_ec2.SecurityGroup, error) {
145 // NOTE: used Filter instead of GroupIds attribute because GroupIds
146 // returns error when it cannot find the matching security groups.
147 params := &_ec2.DescribeSecurityGroupsInput{
148 Filters: []*_ec2.Filter{
149 {
150 Name: _aws.String("group-id"),
151 Values: _aws.StringSlice(securityGroupIDs),
152 },
153 },
154 }
155
156 res, err := c.svc.DescribeSecurityGroups(params)
157 if err != nil {
158 return nil, err
159 }
160
161 return res.SecurityGroups, nil
162}
163
164func (c *Client) RetrieveSecurityGroupByName(name string) (*_ec2.SecurityGroup, error) {
165 // NOTE: used Filter instead of GroupNames attribute because GroupNames

Callers 1

RunMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected