From 0fb4281ec5b6682271750e53d68804fbdd39351e Mon Sep 17 00:00:00 2001 From: Ben Whaley Date: Wed, 14 Aug 2019 15:11:43 -0700 Subject: [PATCH] Clarified use of NewVpcPerRegion [skip ci] --- aws/ec2.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/ec2.go b/aws/ec2.go index aa2c4994..47cd18e4 100644 --- a/aws/ec2.go +++ b/aws/ec2.go @@ -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 { @@ -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 {