2 個答案
- 最新
- 最多得票
- 最多評論
2
Are you in the same region using CLI?
已回答 2 年前
AWS CLI does not have the option to specify the region
aws ec2 describe-security-groups --filters Name=vpc-id,Values=... --group-ids ...
An error occurred (InvalidGroup.NotFound) when calling the DescribeSecurityGroups operation: The security group '...' does not exist But I am on the security group page in the console now as we speak so it does exist.
2
Try adding in --region at the end of your CLI command to whatever region you see the Security Group in.
For example:
aws ec2 describe-security-groups ... --group-ids --region us-east-1
You can also run an aws configure get region to get the region of what region your CLI is setup for.
That would be my first look - ensure where you are looking in console matches the region in your CLI.
已回答 2 年前
You are a genius! Bullseye! That solved my problem. Thank you very much!
相關內容
- 已提問 6 個月前
- AWS 官方已更新 2 年前
- AWS 官方已更新 6 個月前
Search for the ENI to get the subnet and security group(s) it uses with the below command. Ensure you replace <ENI> and <REGION> placeholders with respective values. The output of the below command will be json which you can parse with something like jq. This should align with what you see in the console
aws ec2 describe-network-interfaces --network-interface-ids <ENI> --filters Name=network-interface-id,Values=ENI --region <REGION> --output json --query 'NetworkInterfaces[0].{Subnet:SubnetId,SecurityGroups:Groups[*].GroupId}')