[Appendix] Creating an AWS VPC
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 VPCsin the left menu and pressing the
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
Subnetsin the left menu and pressing the
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, choose
Modify auto-assign IP settingsand then select
Enable auto-assign public IPv4 address.
Create a gateway for the VPC by selecting
Internet Gatewaysin the left menu and pressing the
Create Internet Gatewaybutton.
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 Tablesin 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
Routestab, press the
Add another route. Under
Destinationput ‘0.0.0.0/0’ and under
Targetthe 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.