How to create a VPC using AWS CLI?

0 votes
Can someone help me with the process of creating an Amazon VPC using AWS CLI?
Feb 21 in AWS by Vanshika
96 views

1 answer to this question.

0 votes

To create an Amazon VPC using AWS CLI, you need to first configure AWS (assuming you already have AWS CLI installed)

To configure simply use the following command:-

C:\Users\priyj_kumar>aws configure
AWS Access Key ID [****************PO6Y]: 
AWS Secret Access Key [****************P6Vo]: 
Default region name [us-east-1]:
Default output format [None]:

Now your account is configured. To create a VPC (blank) use the following command:-

C:\Users\priyj_kumar>aws ec2 create-vpc --cidr-block 10.0.0.0/16

This will result in the Output giving you the necessary details about your VPC.

{
    "Vpc": {
        "CidrBlock": "10.0.0.0/16",
        "DhcpOptionsId": "dopt-d6bc32ad",
        "State": "pending",
        "VpcId": "vpc-0a1a117b2e6c8e09b",
        "InstanceTenancy": "default",
        "Ipv6CidrBlockAssociationSet": [],
        "CidrBlockAssociationSet": [
            {
                "AssociationId": "vpc-cidr-assoc-044572a6755a02354",
                "CidrBlock": "10.0.0.0/16",
                "CidrBlockState": {
                    "State": "associated"
                }
            }
        ],
        "IsDefault": false,
        "Tags": []
    }
}

This way you can create an Amazon VPC.

answered Feb 21 by Priyaj
• 56,900 points

Related Questions In AWS

0 votes
1 answer

How to create a DynamoDB using AWS CLI?

You can create a DynamoDB table using ...READ MORE

answered Feb 22 in AWS by Priyaj
• 56,900 points
75 views
0 votes
1 answer
0 votes
1 answer

How to download the latest file in a S3 bucket using AWS CLI?

You can use the below command $ aws ...READ MORE

answered Sep 6, 2018 in AWS by Archana
• 4,090 points
4,840 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

How to create a S3 bucket using AWS CLI?

You can use the following command:- C:\Users\priyj_kumar>aws s3api ...READ MORE

answered Feb 15 in AWS by Priyaj
• 56,900 points
798 views