https://codereview.appspot.com/54690048/diff/40001/ec2/subnets.go#newcode42
ec2/subnets.go:42: // When you create each subnet, you provide the VPC
ID and the CIDR
// The vpcId and cidrBlock parameters specify the
// VPC id and CIDR block respectively - these cannot
// be changed after creation. The subnet's CIDR block can be the same as
// the VPC's CIDR block (assuming you want only a single subnet in the
// VPC), or a subset of the VPC's CIDR block. If more than one
// subnet is created in a VPC, their CIDR blocks must not overlap. The
// smallest subnet (and VPC) that can be created uses a /28 netmask (16
IP
// addresses), and the largest uses a /16 netmask (65,536 IP
// addresses).
LGTM with some suggestions below.
https:/ /codereview. appspot. com/54690048/ diff/40001/ ec2/ec2test/ server. go server. go (right):
File ec2/ec2test/
https:/ /codereview. appspot. com/54690048/ diff/40001/ ec2/ec2test/ server. go#newcode1105 server. go:1105: availIPs := Exp2(float64( maskBits- maskOnes) )) - 5
ec2/ec2test/
int(math.
availIPs := 1<<uint(maskBits - maskOnes) - 5
?
i suppose we might consider making sure that there
are enough bits in the mask too, otherwise
we can get a negative AvailableIPCount.
https:/ /codereview. appspot. com/54690048/ diff/40001/ ec2/subnets. go
File ec2/subnets.go (right):
https:/ /codereview. appspot. com/54690048/ diff/40001/ ec2/subnets. go#newcode42
ec2/subnets.go:42: // When you create each subnet, you provide the VPC
ID and the CIDR
// The vpcId and cidrBlock parameters specify the
// VPC id and CIDR block respectively - these cannot
// be changed after creation. The subnet's CIDR block can be the same as
// the VPC's CIDR block (assuming you want only a single subnet in the
// VPC), or a subset of the VPC's CIDR block. If more than one
// subnet is created in a VPC, their CIDR blocks must not overlap. The
// smallest subnet (and VPC) that can be created uses a /28 netmask (16
IP
// addresses), and the largest uses a /16 netmask (65,536 IP
// addresses).
?
https:/ /codereview. appspot. com/54690048/ diff/40001/ ec2/subnets. go#newcode52
ec2/subnets.go:52: // availZone can be empty, in which case Amazon EC2
selects one for
s/can/may/
https:/ /codereview. appspot. com/54690048/ diff/40001/ ec2/subnets. go#newcode71
ec2/subnets.go:71: // DeleteSubnet deletes the specified subnet. You
must terminate all
// All running instances in the subnet must have been terminated.
?
https:/ /codereview. appspot. com/54690048/