Error while creating Security Group using aws-CLI

0 votes

I am trying to create a Security group using AWS CLI but am getting error.

aws ec2 create-security-group --group-name my-sg --description "My security group" --vpc-id vpc-208fft56hhg

An error occurred (InvalidVpcID.NotFound) when calling the CreateSecurityGroup operation: The vpc ID 'vpc-1a2b3c4d' does not exist
Nov 21, 2018 in AWS by Jino
• 5,590 points

retagged Nov 21, 2018 by Jino 237 views

1 answer to this question.

0 votes

The error says you have entered a wrong VPC Id.

Check your VPC Id and then execute the statement. Your security group will be created.

C:\>aws ec2 create-security-group --group-name my-sg --description "My security group" --vpc-id vpc-0f137be1215hgyta16
{
    "GroupId": "sg-0788ff40f5gt56a55"
}

This way you will be given the Security Group Id stating that the security group is created. 

Hope this helps.

answered Nov 21, 2018 by Anup

Related Questions In AWS

0 votes
1 answer

AWS S3 CLI : error while trying to copy files locally using terminal

For the first error you should add ...READ MORE

answered Aug 3, 2018 in AWS by Archana
• 4,110 points
1,685 views
0 votes
1 answer
0 votes
1 answer

How to Pass the VPC ID while creating the Ec2 instance in AWS using Python Boto3

import boto3 ec2 = boto3.resource('ec2') instance = ec2.create_instances( ...READ MORE

answered Jan 29 in AWS by Priyaj
• 57,300 points
428 views
0 votes
1 answer

AWS S3 uploading hidden files by default

versioning is enabled in your bucket. docs.aws.amazon.com/AmazonS3/latest/user-guide/….... the ...READ MORE

answered Oct 4, 2018 in AWS by Priyaj
• 57,300 points
346 views
0 votes
1 answer

How to decrypt the encrypted S3 file using aws-encryption-cli --decrypt

Use command : aws s3 presign s3://mybucket/abc_count.png you get ...READ MORE

answered Oct 22, 2018 in AWS by Priyaj
• 57,300 points
763 views
0 votes
2 answers
0 votes
1 answer