Usage Forecast Filtering Expression

0

Hi! I'm trying to get usage forecast from CLI here but i can't find the right syntax for passing values inside the --filter expression. Can anyone please help me with that? Is there a place where i can find the valid values?

In the following example i tried passing parameters as they were passed on the URL of Cost Explorer UI:

aws ce get-usage-forecast --time-period Start=2022-10-10,End=2023-01-07 --granularity MONTHLY --metric USAGE_QUANTITY --filter {"Dimensions": {"Key":"UsageTypeGroup", "Values": ["EC2: Running Hours"]}}

Response: aws ce get-usage-forecast --time-period Start=2022-10-10,End=2023-01-07 --granularity MONTHLY --metric USAGE_QUANTITY --filter {"Dimensions": {"Key":"UsageTypeGroup", "Values": ["EC2: Running Hours"]}}

feita há 2 anos188 visualizações
2 Respostas
1

It looks like your dimension key value is wrong. When I use USAGE_TYPE_GROUP I get a valid response:

$ aws ce get-usage-forecast --time-period Start=2023-02-01,End=2023-07-01 --granularity MONTHLY --metric USAGE_QUANTITY --filter '{"Dimensions": {"Key":"USAGE_TYPE_GROUP", "Values": ["EC2: Running Hours"]}}' | jq .

{
  "Total": {
...
  }
}
respondido há um ano
1

You can find valid values in the AWS Command Line Reference. For get-usage-forecast in particular, you can find valid values here: https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ce/get-usage-forecast.html

AWS
respondido há 2 meses

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas