Creating VPC using AWS CLI
- Lets create a IAM user to configure aws cli
aws configure
Enter access key , secret key and region(us-west-2)
- To create IAM user Refer Here
- AWS CLI are the commands to create resources in AWS by using Commands
- To find command
- approach 1: google

- approach 2: aws cli commands are in the form of
aws service action args- Refer Here for the aws cli reference
- VPC belongs to a service ec2 Refer Here
- Now find the commands for vpc

- approach 1: google
- AWS CLI has two kinds of arguments
- required arguments
- optional arguments
- Since we want to create vpc Refer Here

- Lets create vpc

- Now lets make a note of vpc id.
- Other approach is to query for vpc id and in aws generally most of the query commands will be in form of
describe-<resource>Refer Here for describe vpcs - We can query the cli outputs

- To do that first we need to understand
- JSON Refer Here
- We will have one session on JMES Path
- Exercise: Write aws cli to
- create a vpc with 4 subnets (you can manually copy id)
- Attach the internet gateway to vpc
- Make two subnets public and two subnet private.
