Here's a one-liner I assembled to give a Nova-like experience with awscli (i.e. I just need a few high-level details of all my instances).
aws ec2 describe-instances --profile my-profile --output table --query \ 'Reservations[*].{\ id:Instances[0].InstanceId,\ key:Instances[0].KeyName,\ security_group:Instances[0].SecurityGroups[0].GroupName,\ public_ip:Instances[0].PublicIpAddress,\ status:Instances[0].State.Name,\ name:Instances[0].Tags[0].Value}'
This yields output like the following:
--------------------------------------------------------------------------------------------------- | DescribeInstances | +------------+--------------------+-----------------+--------------+------------------+-----------+ | id | key | name | public_ip | security_group | status | +------------+--------------------+-----------------+--------------+------------------+-----------+ | i-3dd9871f| user-01-dev | salt-master-01 | 192.168.1.1 | linux | running | | i-41173864| user-34-dev | None | None | mine | stopped | | i-3001421a| user-02-dev | toolbox | None | apache | stopped | +------------+--------------------+-----------------+--------------+------------------+-----------+That is all.
No comments:
Post a Comment