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, 2019 in AWS by Vanshika
1,141 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, 2019 by Priyaj
• 58,020 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, 2019 in AWS by Priyaj
• 58,020 points
1,892 views
0 votes
1 answer

How to create a redshift cluster using AWS CLI?

You can create your cluster using AWS ...READ MORE

answered Feb 25, 2019 in AWS by Priyaj
• 58,020 points
1,240 views
0 votes
1 answer

How to create a VPC in AWS using Boto3?

Hi@akhtar, Amazon Web Services enables you to create ...READ MORE

answered Oct 9, 2020 in AWS by MD
• 95,460 points
1,646 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 subnet inside a VPC using AWS CLI?

To create a subnet inside a VPC ...READ MORE

answered Feb 21, 2019 in AWS by Priyaj
• 58,020 points
714 views
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, 2019 in AWS by Priyaj
• 58,020 points
6,132 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP