CLI get-usage-forecast filtering expression

0

Hi, i'm having a problem on finding the correct way of passing the parameter values to the following filtering expression for the get-usage-forecast. Can anyone help me with knowing how to writing the values for this expression?

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

1개 답변
0
수락된 답변

Your filter has two issues.

  1. The Key value "USAGE_TYPE_GROUP is missing a double-quote at the end.
  2. Since you need to pass the filter as a single value as a JSON, you want to enclose the filter JSON within a single quotes ('').

The working command looks like the following:

aws ce get-usage-forecast --time-period Start=2022-10-22,End=2023-01-07 --granularity MONTHLY --metric USAGE_QUANTITY --filter '{"Dimensions": {"Key":"USAGE_TYPE_GROUP", "Values": ["EC2: ELB - Running Hours", "EC2: Running Hours", "RDS: Running Hours"]}}'
AWS
Taka_M
답변함 일 년 전
  • Thanks a lot for your help, that worked perfectly. I didn't know about enclosing the JSON within single quotes...

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠