Follow the steps provided to create AWS VPC and subnet from CLI.
- Open your command prompt and give the command:
aws ec2 create-vpc --profile user2 --region us-east-1 --cidr-block 10.0.0.0/16 --amazon-provided-ipv6-cidr-block
The different components of our command are explained as follows:
-
- aws ec2 create-vpc: It is the command for creating a VPC profile.
- user2: It is the user profile with which a VPC is being created. You may omit this if you want to create the VPC with a default profile.
- region us-east-1: It is the AWS region where the VPC is going to be created. You can omit this if you want to create it in the default region.
- cidr-block 10.0.0.0/16: It is the IPv4 CIDR block associated with the VPC.
- amazon-provided-ipv6-cidr-block ...