Skip to content

aws ce get-cost-and-usage-with-resources --granularity MONTHLY returns 'for hourly granularity is 14 days' massage. #7382

Answered by aBurmeseDev
suito-venus asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @suito-venus, thanks for reaching out.

I researched the error you're getting and found out in the API documentation that the start date has to be within past 14 days.

TimePeriod
Sets the start and end dates for retrieving Amazon Web Services costs. The range must be within the last 14 days (the start date cannot be earlier than 14 days ago). The start date is inclusive, but the end date is exclusive.

The required date range seems to ignore granularity as even if you're requesting MONTHLY, it wouldn't work unless you enter the date within 14 days ago. For example, the command below would work since the range is within past 14 days:

aws ce get-cost-and-usage-with-resources  \
--time-pe…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@suito-venus
Comment options

Answer selected by tim-finnigan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants