code-dumps/aws/ec2-with-public-ip.sh

7 lines
213 B
Bash
Raw Normal View History

2024-10-24 23:09:21 +08:00
#!/usr/bin/env bash
aws sts get-caller-identity --query Account
aws ec2 describe-instances --query 'Reservations[].Instances[?PublicIpAddress != `null`].[InstanceId, PublicIpAddress]' --output text
echo "= = ="