4

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

Michael Durrant
  • 93,410
  • 97
  • 333
  • 497
  • Check your cli region is the same as the vpc. Region can be found by `aws configure`. – Lamanus Oct 13 '19 at 01:41
  • I am in a different region (`aws configure list`) is the command we want. So how do do I do a security group in a region different from my default. I thought the fact I had to pick the VPC would take of that given it implies region. – Michael Durrant Oct 13 '19 at 01:51
  • try to add `--region ` where the region example is `us-east-1` – Lamanus Oct 13 '19 at 01:53
  • That worked. I had looked for it in the help and not seen it. Thanks! The answer is region if you'd like to post – Michael Durrant Oct 13 '19 at 01:54

1 Answers1

3

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.

Lamanus
  • 12,898
  • 4
  • 21
  • 47