Skip to content

Instantly share code, notes, and snippets.

@tfentonz
Last active December 1, 2016 05:04
Show Gist options
  • Save tfentonz/68df48fa80d7b3822e7c443eb76dbdf6 to your computer and use it in GitHub Desktop.
Save tfentonz/68df48fa80d7b3822e7c443eb76dbdf6 to your computer and use it in GitHub Desktop.
Amazon CLI Commands

Amazon CLI Commands

EC2

Get instance public hostname

Substitute <NAME> for instance name.

$ aws ec2 describe-instances --query 'Reservations[].Instances[].PublicDnsName' --filters Name=tag:Name,Values=<NAME> --output text 
ec2-123-45-67-8.ap-southeast-2.compute.amazonaws.com

IAM

Get user arn

$ aws iam get-user --user-name bob --query 'User.Arn' --output text
arn:aws:iam::123456789012:user/bob
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment