Skip to content

Instantly share code, notes, and snippets.

@reecestart
Created February 14, 2018 04:12
Show Gist options
  • Save reecestart/1c0e99bd75002f2bbf4914a7f8fcebc1 to your computer and use it in GitHub Desktop.
Save reecestart/1c0e99bd75002f2bbf4914a7f8fcebc1 to your computer and use it in GitHub Desktop.
Bash script to get the RI Utilization given a start and end date, granularity either daily or monthly
#!/usr/bin/env
# To check RI Utilization
echo "What is your Start Date for checking RI Utilization? (YYYY-MM-DD)"
read startDate
startDateString="Start=$startDate"
echo "What is your End Date for checking RI Utilization? (YYYY-MM-DD)"
read endDate
endDateString="End=$endDate"
timePeriod="$startDateString,$endDateString"
echo "What granularity are you interested in? (DAILY or MONTHLY)"
read granularity
aws ce get-reservation-utilization --region us-east-1 --time-period $timePeriod --granularity $granularity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment