This appendix is in connection with Juju and Fan networking where an AWS user may wish to create an additional VPC (virtual private network).
Note that only older AWS accounts will actually require a new VPC in order for Juju to auto-configure the Fan. Recent AWS accounts are furnished with a VPC which will work out-of-the-box.
The procedure covered here refers to the AWS web interface. Alternatively, the AWS API can be used.
To add a VPC:
-
Navigate to the VPC console:
-
Create a VPC by selecting
Your VPCs
in the left menu and pressing theCreate VPC
button.In the resulting dialog box, enter a name for the VPC (e.g. ‘vpc-juju’) and a /16 address space (e.g. ‘192.168.0.0/16’).
-
Create a subnet for the VPC by selecting
Subnets
in the left menu and pressing theCreate Subnet
button.In the resulting dialog box, enter a name for the subnet (e.g. ‘vpc-juju-subnet’), select the VPC you created earlier, an Availability Zone (optional), and an IPv4 CIDR block that resides within the initial address space (e.g. ‘192.168.1.0/24’).
Select the subnet’s checkbox and hit
Subnet Actions
. There, chooseModify auto-assign IP settings
and then selectEnable auto-assign public IPv4 address
. -
Create a gateway for the VPC by selecting
Internet Gateways
in the left menu and pressing theCreate Internet Gateway
button.In the resulting dialog box, enter a name for the gateway (e.g. ‘vpc-juju-igw’).
Select the gateway’s checkbox and hit
Attach to VPC
. There, select the VPC you created earlier. -
Create a default route for the VPC by selecting
Route Tables
in the left menu and selecting the route table for your VPC. The VPC name will appear in the VPC column (along with the VPC ID).Down below, enter the
Routes
tab, press theEdit
button, thenAdd another route
. UnderDestination
put ‘0.0.0.0/0’ and underTarget
the gateway you created earlier will be pre-populated as an option, select it. Save.
The VPC is now ready for use by Juju. If you now have multiple VPCs Juju will need to refer to a VPC by its ID. Take note of it. It has the format vpc-HHHHHHHH
where each ‘H’ represents a hexadecimal number (e.g. ‘vpc-2434a45c’).
While working with VPCs be careful to not delete the wrong one by mistake. Doing so will destroy all associated instances.