AWS CLI
Create a VPC via the CLI

To create a /16 VPC via the CLI:

aws ec2 create-vpc --cidr-block 10.12.0.0/16

If successful, output will appear (by default) in the terminal as json. For the command above, one of the name/value pairs will have a name of "VpcId". We'll use that Id to update the name of our VPC for review in the Console.


Tag your VPC

To follow best practice, let's tag this VPC with a name of cli-test so we can recognize in the Console:

aws ec2 create-tags --resources vpc-xyxxxxxx --tags Key=Name,Value=cli-test

Let's also add an Environment tag to differentatiate between Dev, Staging, Production, etc.

aws ec2 create-tags --resources vpc-2f926857 --tags Key=Environment,Value=Dev

The Console nicely shows what we've done.