Created
May 24, 2014 08:55
-
-
Save thara/ab8fedfb217327f60469 to your computer and use it in GitHub Desktop.
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
| #!/bin/sh | |
| instanceType=t1.micro | |
| region=ap-northeast-1 | |
| availabilityZone=${region}b | |
| productDescription=Linux/UNIX | |
| offeringType="Linux Utilization" | |
| duration=$((60*60*24*365)) | |
| filters=`cat <<EOS | |
| [ | |
| { | |
| "Name": "instance-type", | |
| "Values": ["${instanceType}"] | |
| }, | |
| { | |
| "Name": "availability-zone", | |
| "Values": ["${availabilityZone}"] | |
| }, | |
| { | |
| "Name": "duration", | |
| "Values": ["${duration}"] | |
| }, | |
| { | |
| "Name": "product-description", | |
| "Values": ["${productDescription}"] | |
| } | |
| ] | |
| EOS` | |
| # echo \'$filters\' | |
| echo $filters | xargs -0 aws ec2 describe-reserved-instances \ | |
| --offering-type "${offeringType}" \ | |
| --filters \ | |
| | jq '.ReservedInstancesOfferings[].ReservedInstancesOfferringID' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment