首页 > 解决方案 > 在 CLI 创建安全组,得到 InvalidVpcID.NotFound The vpc ID does not exist

问题描述

试图发出:

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

但我明白了

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

该 vpc 确实存在,但未被识别。
它位于不同的区域。
我无法在命令中指定区域。
我该如何解决?

在此处输入图像描述

标签: amazon-web-servicesamazon-vpcaws-security-group

解决方案


当您在 aws cli 上执行某些命令时,您可以提交 region 选项,如下所示。

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

cli 选项在 aws文档中列出。


推荐阅读