skip to Main Content

Is there a way to check my AWS root account Free Tier usage via CLI?

I do not have access to AWS Console (i.e no root password), but I do have the root access key. Therefore, while I cannot use the (browser) billing dashboard approach, I believe I should have full CLI access to check all data.

I tried to search the CLI documentation, but to no avail.

I hope to retrieve similar data as to the Top Free Tier Service by Usage from the AWS Billing Console.

2

Answers


  1. You can use the Cost Explorer API to achieve this:

    aws ce get-cost-and-usage ...
    

    You’ll need to use Expression and supply the necessary parameters to return free tier usage params.

    https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_Expression.html

    Login or Signup to reply.
  2. You can use the get-cost-and-usage command to retrieve Free Tier usage information.

    example:

    aws ce get-cost-and-usage --time-period Start=2023-01-01,End=2023-01-31 --granularity MONTHLY --metrics "BlendedCost" --group-by Type=DIMENSION,Key=SERVICE Type=TAG,Key=USAGE_TYPE
    

    You can adjust the --time-period parameter to query for different months or time ranges.

    P.s The BlendedCost metric includes information about the cost, and you can check if you have exceeded your Free Tier limits or not.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search