Skip to content

Instantly share code, notes, and snippets.

@sebsto
Created February 12, 2015 16:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sebsto/505c91bf53bc77c4b921 to your computer and use it in GitHub Desktop.
Save sebsto/505c91bf53bc77c4b921 to your computer and use it in GitHub Desktop.
Select two AZ with a default subnet in (comma separated)
aws ec2 describe-subnets --query 'Subnets[?DefaultForAz == `true`] | @[0:2][].AvailabilityZone' --output text | sed -e 's/\t/,/g’
@sebsto
Copy link
Author

sebsto commented Feb 12, 2015

This requires at least these version of JMESPath and AWSCLI
[ec2-user@ip-1-1-2-61 ~]$ pip list | grep jmes
jmespath (0.6.1)
[ec2-user@ip-1-1-2-61 ~]$ pip list | grep aws
aws-cfn-bootstrap (1.4)
awscli (1.7.4)
[ec2-user@ip-1-1-2-61 ~]$ pip list | grep boto
boto (2.35.2)
botocore (0.85.0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment