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

Method ListVPCSubnets

aws/ec2/client.go:283–304  ·  view source on GitHub ↗
(vpcID string)

Source from the content-addressed store, hash-verified

281}
282
283func (c *Client) ListVPCSubnets(vpcID string) ([]string, error) {
284 params := &_ec2.DescribeSubnetsInput{
285 Filters: []*_ec2.Filter{
286 {
287 Name: _aws.String("vpc-id"),
288 Values: _aws.StringSlice([]string{vpcID}),
289 },
290 },
291 }
292
293 res, err := c.svc.DescribeSubnets(params)
294 if err != nil {
295 return nil, err
296 }
297
298 subnetIDs := []string{}
299 for _, s := range res.Subnets {
300 subnetIDs = append(subnetIDs, conv.S(s.SubnetId))
301 }
302
303 return subnetIDs, nil
304}
305
306func (c *Client) RetrieveKeyPair(keyPairName string) (*_ec2.KeyPairInfo, error) {
307 params := &_ec2.DescribeKeyPairsInput{

Callers 5

getAWSInfoMethod · 0.80
createELBLoadBalancerMethod · 0.80
getAWSInfoMethod · 0.80
getAWSInfoMethod · 0.80
RunMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected