Last active
June 17, 2016 16:50
-
-
Save algotrader-dotcom/b4479b79644c87992267535cc53bb43c to your computer and use it in GitHub Desktop.
AWS CLI cheat sheet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1. List all ec2 running with output table | |
| $aws ec2 describe-instances --filters "Name=instance-state-name,Values=running" --output table | |
| 2. List all ec2 running with output table, with some fields only | |
| $aws ec2 describe-instances --filters "Name=instance-state-name,Values=running" --query 'Reservations[].Instances[].[Placement.AvailabilityZone, State.Name, InstanceId,InstanceType,Platform,Tags.Value,State.Code,Tags.Values]' --output table | |
| ------------------------------------------------------------------------------------------- | |
| | DescribeInstances | | |
| +---------------+----------+-------------+-------------+----------+-------+------+--------+ | |
| | eu-central-1a| running | i-0afd59b7 | m3.xlarge | None | None | 16 | None | | |
| | eu-central-1a| running | i-dfff5b62 | m4.xlarge | windows | None | 16 | None | | |
| | eu-central-1a| running | i-dffc5862 | m3.medium | None | None | 16 | None | | |
| | eu-central-1a| running | i-697fdfd4 | c3.2xlarge | None | None | 16 | None | | |
| +---------------+----------+-------------+-------------+----------+-------+------+-------- | |
| 3. Create AMI from running instance | |
| $aws ec2 create-image --instance-id i-0b09a25c58929de26 --name "My server" --no-reboot | |
| 4. | |
| ### AWS CLI Ref ### | |
| http://docs.aws.amazon.com/cli/latest/reference/index.html#cli-aws |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment