Skip to content

Instantly share code, notes, and snippets.

@dbt4u
Created September 24, 2019 16:50
Show Gist options
  • Save dbt4u/6f4f045495beb75a0673306a8f5a4881 to your computer and use it in GitHub Desktop.
Save dbt4u/6f4f045495beb75a0673306a8f5a4881 to your computer and use it in GitHub Desktop.
List all AWS Services used by an account
aws ce get-cost-and-usage --time-period Start=$(date "+%Y-%m-01" -d "-1 Month"),End=$(date --date="$(date +'%Y-%m-01') - 1 second" -I) --granularity MONTHLY --metrics UsageQuantity --group-by Type=DIMENSION,Key=SERVICE | jq '.ResultsByTime[].Groups[] | select(.Metrics.UsageQuantity.Amount > 0) | .Keys[0]'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment