Skip to content

Commit

Permalink
Clarified use of NewVpcPerRegion
Browse files Browse the repository at this point in the history
[skip ci]
  • Loading branch information
bwhaley committed Aug 14, 2019
1 parent 8846336 commit 0fb4281
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions aws/ec2.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ type Vpc struct {
svc ec2iface.EC2API
}

// NewVpcPerRegion merely assigns a service client and region to a VPC object
// The CLI calls this, but the tests don't because the tests need to use a
// mocked service client.
func NewVpcPerRegion(regions []string) []Vpc {
var vpcs []Vpc
for _, region := range regions {
Expand Down Expand Up @@ -161,6 +164,8 @@ func GetDefaultVpcId(vpc Vpc) (string, error) {
return "", nil
}

// GetDefaultVpcs needs a slice of vpcs that already have service clients and regions
// assigned, either via NewVpcPerRegion() (as in the CLI) or manually (as in the mock tests)
func GetDefaultVpcs(vpcs []Vpc) ([]Vpc, error) {
var outVpcs []Vpc
for _, vpc := range vpcs {
Expand Down

0 comments on commit 0fb4281

Please sign in to comment.