Aws costs

aws_month_end

Calculate the last day of the current month using GNU date. Starts from the 27th of the current month and increments until the day rolls over, then returns the last valid date. Requires GNU date.

Exit codes

  • 0: Always

Output on stdout

  • Last day of the current month in YYYY-MM-DD format

aws_cost_last_month

Retrieve AWS cost and usage for last month, grouped by service. Filters to services with non-zero blended cost and outputs JSON. Requires aws-cli and jq.

Exit codes

  • 0: Success
  • 1: aws-cli or jq failed

Output on stdout

  • JSON object of service names to blended cost, sorted by amount

aws_cost_this_month

Retrieve AWS cost and usage for the current month to date, grouped by service. Filters to services with non-zero blended cost and outputs JSON. Requires aws-cli and jq.

Exit codes

  • 0: Success
  • 1: aws-cli or jq failed

Output on stdout

  • JSON object of service names to blended cost, sorted by amount

aws_cost_forecast

Retrieve the AWS cost forecast for the remainder of the current month. Requires aws-cli and jq.

Exit codes

  • 0: Success
  • 1: aws-cli or jq failed

Output on stdout

  • JSON forecast object from the AWS Cost Explorer API