问题原文
原帖链接 · Ramesh Kumar · CC BY-SA 3.0
I have list of IP addressed, I want to find if instances associated with the IP address are still running or terminated. I am launching and terminating lot of instances on daily basis, just want to remove their certificates from puppetmaster.
If there is any alternative method, I can achieve my goal, I can do that.
已采纳解答
原帖链接 · Jamie W · CC BY-SA 3.0
aws ec2 describe-instances --filter Name=ip-address,Values=IP_1,..IP_N
Should do what you need.
use the filter name of private-ip-address to select using private address in your VPC.
Pipe through something like
jq -r '.Reservations[].Instances[] | .InstanceId, .PublicIpAddress'
if you want the corresponding InstanceID
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
