Created
July 26, 2018 16:19
-
-
Save justinclayton/73ebcc7e5386b9faac698cc5b8b98605 to your computer and use it in GitHub Desktop.
Yesterday's AWS Costs
This file contains 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
aws ce get-cost-and-usage \ | |
--granularity DAILY \ | |
--time-period Start=$(date -v-1d +%Y-%m-%d),End=$(date +%Y-%m-%d) \ | |
--metrics UnblendedCost \ | |
| jq -r '.ResultsByTime[].Total.UnblendedCost.Amount' \ | |
| ruby -e 'puts "$#{gets.to_f.round(2)}"' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment