Bird
0
0

You execute this AWS CLI command but receive a syntax error:

medium📝 Troubleshoot Q6 of 15
AWS - Account and Billing
You execute this AWS CLI command but receive a syntax error:
aws ce get-cost-and-usage --time-period Start=2023-05-01,End=2023-05-31 --metrics UsageQuantity --filter '{"Dimensions":{"Key":"USAGE_TYPE","Values":["Free Tier"]}}'

What is the cause of the error?
AThe value "Free Tier" should be "FreeTier" without a space
BThe --metrics parameter cannot be UsageQuantity
CThe time period dates are in the wrong format
DThe filter JSON must use single quotes instead of double quotes
Step-by-Step Solution
Solution:
  1. Step 1: Check filter values

    The correct value for free tier usage is "FreeTier" without a space.
  2. Step 2: Validate metrics

    UsageQuantity is valid for usage data.
  3. Step 3: Verify date format

    Dates are correctly formatted as YYYY-MM-DD.
  4. Step 4: JSON quoting

    Using double quotes inside single quotes is valid in CLI.
  5. Final Answer:

    The value "Free Tier" should be "FreeTier" without a space is the cause: incorrect "Free Tier" value.
  6. Quick Check:

    Filter values must match exact AWS keys [OK]
Quick Trick: Use exact filter values like 'FreeTier' without spaces [OK]
Common Mistakes:
MISTAKES
  • Adding spaces in filter values
  • Misformatting JSON filter
  • Using invalid metrics

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes