Awscli snippets


Published:   November 26, 2021

Tags:

Fetch running instance with their private IP

1
aws ec2 describe-instances --query 'Reservations[*].Instances[*].[NetworkInterfaces[0].PrivateIpAddresses[0].PrivateIpAddress,Tags[?Key==`Name`].Value| [0]]' --filters "Name=instance-state-name,Values=running" "Name=tag:environment,Values=production" --output text

Fetch running instance for given tag

1
aws ec2 describe-instances --output table   --query 'Reservations[].Instances[].[Tags[?Key==`Name`] | [0].Value, State.Name]' --filters Name=instance-state-name,Values=running Name=tag:billing,Values=devops

Linked post:

Reference:


< Prev   Further Reading   Next >

For feedbacks: email@murarisumit.in