Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(13162)

Issue 49930045: ec2: Add support for AWS VPCs (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 2 months ago by dimitern
Modified:
10 years, 2 months ago
Reviewers:
gz, mp+204514, niemeyer, rog
Visibility:
Public.

Description

ec2: Add support for AWS VPCs Added the following new API calls: - CreateVPC - DeleteVPC - VPCs (and the associated types/responses). Most new code is in vpc.go and vpc_test.go. These are needed in order to support VPC-related operations on EC2, which will come in later follow-ups. Implementation complexity in ec2test package for the new calls is minimal. Some changes were needed in order to support these and the upcoming API calls. For the new ones, AWS API version 2013-10-15 (latest) is used, while for the existing calls use the previous API version, as before (2011-12-15). Added tests, updated test doubles and tested live on EC2. After running the EC2 live tests numerous times, I realized some tests are leaking security groups, so I added a deleteGroups() tests helper that retries to ensure all groups are deleted. Also improved the VPC tests to include retrying as well, so the live tests are more stable and clean up after themselves. https://code.launchpad.net/~dimitern/goamz/vpc-api-calls/+merge/204514 Requires: https://code.launchpad.net/~dimitern/goamz/lp-1275406-lpcalserversuite-testinstanceinfo/+merge/204469 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 10

Patch Set 2 : ec2: Add support for AWS VPCs #

Patch Set 3 : ec2: Add support for AWS VPCs #

Total comments: 2

Patch Set 4 : ec2: Add support for AWS VPCs #

Patch Set 5 : ec2: Add support for AWS VPCs #

Total comments: 19

Patch Set 6 : ec2: Add support for AWS VPCs #

Total comments: 8

Patch Set 7 : ec2: Add support for AWS VPCs #

Total comments: 14

Patch Set 8 : ec2: Add support for AWS VPCs #

Unified diffs Side-by-side diffs Delta from patch set Stats (+514 lines, -32 lines) Patch
A [revision details] View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
M aws/aws.go View 1 2 3 4 5 6 7 1 chunk +1 line, -2 lines 0 comments Download
M ec2/ec2.go View 1 2 3 4 5 6 7 5 chunks +20 lines, -5 lines 0 comments Download
M ec2/ec2_test.go View 1 2 1 chunk +7 lines, -7 lines 0 comments Download
M ec2/ec2t_test.go View 1 2 3 4 5 6 7 10 chunks +50 lines, -11 lines 0 comments Download
M ec2/ec2test/server.go View 1 2 3 4 5 6 7 8 chunks +121 lines, -4 lines 0 comments Download
M ec2/responses_test.go View 1 2 3 1 chunk +42 lines, -1 line 0 comments Download
A ec2/vpc.go View 1 2 3 4 5 6 7 1 chunk +105 lines, -0 lines 0 comments Download
A ec2/vpc_test.go View 1 2 3 4 5 6 7 1 chunk +166 lines, -0 lines 0 comments Download
M s3/s3.go View 1 2 3 4 5 6 7 1 chunk +0 lines, -2 lines 0 comments Download

Messages

Total messages: 13
dimitern
Please take a look.
10 years, 2 months ago (2014-02-03 15:20:34 UTC) #1
gz
LGTM, a couple of comments. https://codereview.appspot.com/49930045/diff/1/ec2/ec2.go File ec2/ec2.go (right): https://codereview.appspot.com/49930045/diff/1/ec2/ec2.go#newcode925 ec2/ec2.go:925: func (ec2 *EC2) CreateVpc(cidrBlock ...
10 years, 2 months ago (2014-02-03 21:40:54 UTC) #2
dimitern
Please take a look. https://codereview.appspot.com/49930045/diff/1/ec2/ec2.go File ec2/ec2.go (right): https://codereview.appspot.com/49930045/diff/1/ec2/ec2.go#newcode925 ec2/ec2.go:925: func (ec2 *EC2) CreateVpc(cidrBlock string) ...
10 years, 2 months ago (2014-02-04 09:00:18 UTC) #3
dimitern
Please take a look.
10 years, 2 months ago (2014-02-04 09:37:29 UTC) #4
dimitern
Please take a look.
10 years, 2 months ago (2014-02-05 13:25:44 UTC) #5
dimitern
Please take a look.
10 years, 2 months ago (2014-02-05 13:27:47 UTC) #6
rog
LGTM with some suggestions, mostly documentation related. https://codereview.appspot.com/49930045/diff/40001/ec2/ec2test/server.go File ec2/ec2test/server.go (right): https://codereview.appspot.com/49930045/diff/40001/ec2/ec2test/server.go#newcode212 ec2/ec2test/server.go:212: return false, ...
10 years, 2 months ago (2014-02-05 14:29:14 UTC) #7
dimitern
Please take a look. https://codereview.appspot.com/49930045/diff/40001/ec2/ec2test/server.go File ec2/ec2test/server.go (right): https://codereview.appspot.com/49930045/diff/40001/ec2/ec2test/server.go#newcode212 ec2/ec2test/server.go:212: return false, fmt.Errorf("tag, tag-key, and ...
10 years, 2 months ago (2014-02-06 11:32:22 UTC) #8
rog
LGTM with a few further suggestions below. https://codereview.appspot.com/49930045/diff/80001/ec2/vpc.go File ec2/vpc.go (right): https://codereview.appspot.com/49930045/diff/80001/ec2/vpc.go#newcode57 ec2/vpc.go:57: // The ...
10 years, 2 months ago (2014-02-06 14:42:07 UTC) #9
gz
LGTM. https://codereview.appspot.com/49930045/diff/100001/ec2/ec2.go File ec2/ec2.go (right): https://codereview.appspot.com/49930045/diff/100001/ec2/ec2.go#newcode177 ec2/ec2.go:177: return makeParamsWithVersion(action, "2011-12-15") I'd stick "2011-12-15" in a ...
10 years, 2 months ago (2014-02-06 16:25:06 UTC) #10
dimitern
Please take a look. https://codereview.appspot.com/49930045/diff/100001/ec2/ec2.go File ec2/ec2.go (right): https://codereview.appspot.com/49930045/diff/100001/ec2/ec2.go#newcode177 ec2/ec2.go:177: return makeParamsWithVersion(action, "2011-12-15") On 2014/02/06 ...
10 years, 2 months ago (2014-02-07 12:35:24 UTC) #11
niemeyer
LGTM with trivial points. https://codereview.appspot.com/49930045/diff/120001/ec2/ec2.go File ec2/ec2.go (right): https://codereview.appspot.com/49930045/diff/120001/ec2/ec2.go#newcode31 ec2/ec2.go:31: // VPC-related requests. Moving the ...
10 years, 2 months ago (2014-02-12 13:23:49 UTC) #12
dimitern
10 years, 2 months ago (2014-02-12 13:43:48 UTC) #13
*** Submitted:

ec2: Add support for AWS VPCs

Added the following new API calls:
- CreateVPC
- DeleteVPC
- VPCs
(and the associated types/responses).

Most new code is in vpc.go and vpc_test.go.

These are needed in order to support VPC-related
operations on EC2, which will come in later follow-ups.
Implementation complexity in ec2test package for the
new calls is minimal.

Some changes were needed in order to support these
and the upcoming API calls. For the new ones, AWS API
version 2013-10-15 (latest) is used, while for the
existing calls use the previous API version, as before
(2011-12-15).

Added tests, updated test doubles and tested live on
EC2.

After running the EC2 live tests numerous times, I
realized some tests are leaking security groups, so
I added a deleteGroups() tests helper that retries
to ensure all groups are deleted. Also improved the
VPC tests to include retrying as well, so the live
tests are more stable and clean up after themselves.

R=
CC=
https://codereview.appspot.com/49930045

https://codereview.appspot.com/49930045/diff/120001/ec2/ec2.go
File ec2/ec2.go (right):

https://codereview.appspot.com/49930045/diff/120001/ec2/ec2.go#newcode31
ec2/ec2.go:31: // VPC-related requests.
On 2014/02/12 13:23:49, niemeyer wrote:
> Moving the VPC API version here as well would make it more clear. The constant
> isn't even used in vpc.go either way.
> 
> Also, is there a known reason not to use the new API version across the board?

I'll move it here. The reason for not using the newer API version is that some
things are changed, possibly in an incompatible way (responses include different
sub sections, more filters, certain arguments have changed). I didn't want to
make a massive change to all current API calls to make them compatible with
2013-10-15. I could do it in a follow-up, after the current chain have landed
though.

https://codereview.appspot.com/49930045/diff/120001/ec2/ec2t_test.go
File ec2/ec2t_test.go (right):

https://codereview.appspot.com/49930045/diff/120001/ec2/ec2t_test.go#newcode657
ec2/ec2t_test.go:657: func (s *ServerTests) errorCode(err error) string {
On 2014/02/12 13:23:49, niemeyer wrote:
> This can be a function (s is unnecessary).

Done.

https://codereview.appspot.com/49930045/diff/120001/ec2/vpc.go
File ec2/vpc.go (right):

https://codereview.appspot.com/49930045/diff/120001/ec2/vpc.go#newcode8
ec2/vpc.go:8: // Written by Gustavo Niemeyer <gustavo.niemeyer@canonical.com>
On 2014/02/12 13:23:49, niemeyer wrote:
> Please drop this line. We should drop it from all the files.

I'll remove it from all files then.

https://codereview.appspot.com/49930045/diff/120001/ec2/vpc.go#newcode19
ec2/vpc.go:19: PendingState   = "pending"
On 2014/02/12 13:23:49, niemeyer wrote:
> The names of these constants do not look entirely sane. Although this is
inside
> the vpc.go file, this is living inside the ec2 package, which means it's
> ec2.PendingState, and ec2.DefaultTenancy, which is a lot more broad than
> "supported values for VPC state".
> 
> I suggest either fixing them to include the fact they are about VPC
> (VPCPendingState, for example), or just dropping the constants until we have a
> better idea.

I'll drop them and update the doc comments.

https://codereview.appspot.com/49930045/diff/120001/ec2/vpc.go#newcode24
ec2/vpc.go:24: DedicatedTenancy = "dedicated"
On 2014/02/12 13:23:49, niemeyer wrote:
> Same as above.

Done.

https://codereview.appspot.com/49930045/diff/120001/ec2/vpc.go#newcode30
ec2/vpc.go:30: // VPC describes an Amazon Virtual Private Cloud (VPC).
On 2014/02/12 13:23:49, niemeyer wrote:
> s/an Amazon Virtual/a Virtual/
> 
> We might have other pre-existent instances of that in the documentation, but
we
> should eventually fix them as well to not refer to Amazon. First, because 
every
> single documentation entry refers to something coming out of Amazon, and
second,
> because this will work with whoever implements this API.

Done.

https://codereview.appspot.com/49930045/diff/120001/ec2/vpc_test.go
File ec2/vpc_test.go (right):

https://codereview.appspot.com/49930045/diff/120001/ec2/vpc_test.go#newcode8
ec2/vpc_test.go:8: // Written by Gustavo Niemeyer
<gustavo.niemeyer@canonical.com>
On 2014/02/12 13:23:49, niemeyer wrote:
> Please drop this line.

Done.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b