Skip to content

chore(ec2): add ListVpcSubnets method and pagination#1210

Merged
mergify[bot] merged 2 commits intoaws:masterfrom
iamhopaul123:ec2/add-new-subnet-apis
Jul 31, 2020
Merged

chore(ec2): add ListVpcSubnets method and pagination#1210
mergify[bot] merged 2 commits intoaws:masterfrom
iamhopaul123:ec2/add-new-subnet-apis

Conversation

@iamhopaul123
Copy link
Copy Markdown
Contributor

Part of #1192.

  1. Add ListVpcSubnets to list all subnets given a VPC ID.
  2. Add pagination when calling DescribeSubnets so that we won't miss results in following pages.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Copy link
Copy Markdown
Contributor

@kohidave kohidave left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay! We getting somewhere now!

Comment thread internal/pkg/aws/ec2/ec2.go
Comment thread internal/pkg/aws/ec2/ec2.go Outdated
Comment thread internal/pkg/aws/ec2/ec2.go
@iamhopaul123 iamhopaul123 added the WIP Pull requests that are being modified now. label Jul 30, 2020
@iamhopaul123 iamhopaul123 force-pushed the ec2/add-new-subnet-apis branch from d622a7d to ccedec2 Compare July 30, 2020 23:05
@iamhopaul123 iamhopaul123 force-pushed the ec2/add-new-subnet-apis branch from ccedec2 to 01f240b Compare July 30, 2020 23:22
@iamhopaul123 iamhopaul123 removed the WIP Pull requests that are being modified now. label Jul 30, 2020
Copy link
Copy Markdown
Contributor

@Louise15926 Louise15926 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :shipit:

@mergify mergify bot merged commit 88a2910 into aws:master Jul 31, 2020
}

// ListVpcSubnets lists all subnets given a VPC ID.
func (c *EC2) ListVpcSubnets(vpcID string) (*Subnets, error) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +46 to +47
PublicSubnets []string
PrivateSubnets []string
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type Subnets struct {
    Public []string
    Private []string
}

Subnets.PublicSubnets is redundant :P

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'll update it in the next one :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants