How to create a subnet inside a VPC using AWS CLI

0 votes
Please help me with the command used to create a subnet inside a VPC using AWS CLI?
Feb 21, 2019 in AWS by Nabarupa Das
711 views

1 answer to this question.

0 votes

To create a subnet inside a VPC using AWS CLI you can use the following command:-

Pre-requisite:-

  1. AWS CLI configured
  2. VPC ID
The command used is as follows:-
C:\Users\priyj_kumar>aws ec2 create-subnet --vpc-id vpc-0aca683c37231c12f --cidr-block 10.0.1.0/24

The output you will get after executing the command will be as follows:- 

{
    "Subnet": {
        "AvailabilityZone": "us-east-1e",
        "AvailableIpAddressCount": 251,
        "CidrBlock": "10.0.1.0/24",
        "DefaultForAz": false,
        "MapPublicIpOnLaunch": false,
        "State": "pending",
        "SubnetId": "subnet-08f4ee13b627d22bb",
        "VpcId": "vpc-0aca683c37231c12f",
        "AssignIpv6AddressOnCreation": false,
        "Ipv6CidrBlockAssociationSet": []
    }
}

This way you can create a subnet inside a VPC. Hope this helps.

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,888 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,236 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 VPC using AWS CLI?

To create an Amazon VPC using AWS ...READ MORE

answered Feb 21, 2019 in AWS by Priyaj
• 58,020 points
1,139 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,128 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