Skip to content

Get-CECostAndUsageWithResource : Hourly timePeriod is not supported for this request #3037

Answered by ashishdhingra
50ur48h asked this question in Q&A
Discussion options

You must be logged in to vote

@50ur48h Good afternoon. Just checked with service team. Looks like you are using the API incorrectly. The GetCostAndUsageWithResources mentions that TimePeriod range must be within the last 14 days (the start date cannot be earlier than 14 days ago). Take explicit note of the fact that the start date cannot be earlier than 14 days ago. Also, based on testing you would also need to have RESOURCE_ID as one of the DIMENSION in either GroupBy or Filter clause. So the below .NET SDK code appears to work:

using Amazon.CostExplorer;
using Amazon.CostExplorer.Model;

Amazon.AWSConfigs.LoggingConfig.LogResponses = Amazon.ResponseLoggingOption.Always;
Amazon.AWSConfigs.LoggingConfig.LogTo = Amazon.L…

Replies: 6 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@github-actions
Comment options

Answer selected by github-actions
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. service-api This issue is due to a problem in a service API, not the SDK implementation. module/sdk-generated
2 participants
Converted from issue

This discussion was converted from issue #3036 on August 23, 2023 16:18.