Search code examples
amazon-web-servicesamazon-vpcaws-security-group

Create security group at CLI, getting InvalidVpcID.NotFound The vpc ID does not exist


Trying to issue:

$ aws ec2 create-security-group --group-name Grp1 --description Grp1 --vpc-id vpc-0e6f748e8c01534bc

But I get

An error occurred (InvalidVpcID.NotFound) when calling the CreateSecurityGroup operation:  
The vpc ID 'vpc-0e6f748e8c01534bc' does not exist

That vpc does exists, but it isn't being recognized.
It is in a different region.
I can't specify region in the command.
How do I get around that?

enter image description here


Solution

  • When you do some command on the aws cli, you can submit the region option as follows.

    aws cli <some code> --region <region>
    

    The cli options are listed in the aws documentation.