Prompting guidance
The following content provides guidance on the types of questions that the cost analysis capability in Amazon Q Developer supports, and how to structure your prompts to achieve the best results.
Supported question categories
With cost analysis in Amazon Q Developer, you can ask a wide variety of questions to understand your costs and usage. For best results, we recommend phrasing your questions similarly to the following question categories.
Question category | Example |
---|---|
Total costs | What were my costs last month? |
Costs for a specific dimension value | What were my costs for S3 last month? |
Costs broken down by a dimension | What were my costs by service last month? |
Top filter or bottom filter | What were my five most expensive services last month? |
Costs by charge type | Did we receive any credits last month? |
Costs for a relative time period | What were my costs last week? |
Costs for an absolute time period | What were my costs from 10/1/2024 to 10/7/2024? |
Time period aggregation | What were my costs for Q1? |
Total cost forecasts | What is our cost forecast for this month? |
Cost allocation tags | What was last month’s spend for tag key = “Application”, value = “web-app-1”? |
Cost categories | What was last month’s spend, broken down by cost category “cost center”? |
Month-over-month changes | What services increased the most between April and May? |
List items | What instance types did we use last month? |
Cost metrics | What were my net amortized costs last month? |
Amazon Q Developer is currently integrated with the following Cost Explorer APIs:
GetCostAndUsage
, GetCostForecast
,
GetDimensionValues
, GetCostCategories
,
GetTags
. Questions that require data from other Billing and Cost
Management APIs are not yet supported.
Prompting tips
Cost analysis in Amazon Q Developer works best when your prompts are clear and specific. For best results when analyzing your costs with Amazon Q Developer, we recommend that you follow these guidelines.
-
Specify the date range you’re interested in. You can express a date range as either an absolute date range (for example, "October 2024") or a relative date range (for example, “last month”).
-
Specify the dimension you’re interested in. For example, asking “How did last month’s costs break down by service?” will yield better results than “What am I being charged for?”.
-
Cost categories and cost allocation tags are both key-value pairs. To request cost data by cost category or cost allocation tag, precisely specify the key and, if applicable, the values of interest. For example, ask questions such as “What was last month’s spend, broken down by cost category ‘cost center’?” or “What was last month’s spend for tag key = ‘Application’, value = ‘web-app-1’?”. Amazon Q Developer can best understand your tag data if you follow Best Practices for Tagging Amazon Resources.
-
You can phrase your prompts as questions, commands, or descriptions of the cost data you want. For example, “What were my RDS costs last week?”, “Show me last week’s RDS costs”, and “RDS costs last week” are all valid prompts.
Unsupported question categories
The cost analysis capability in Amazon Q Developer does not support the following question categories. For these question categories, Amazon Q Developer provides responses that don't consider your account’s specific cost and usage data or, in rare cases, might provide inaccurate or unexpected responses to these questions.
Question category | Example |
---|---|
"Why" questions | Why did my costs increase last month? |
Data transfer | How much are we spending on data transfer? |
Free Tier | Why am I being charged as I thought my instance was part of Free Tier? |
Pricing | How much does an EC2 t3.xlarge instance cost? |
Cost optimization or savings | How can I lower my bill? |
Savings Plans or reserved instance utilization or coverage | What is my Savings Plan utilization rate? |
Savings Plans or reserved instance inventory | What active Savings Plans do I have? |
Invoices or payments | Did my last payment go through? |
Specific resources | Which EC2 instance did I spend the most on? |
Amazon Budgets | How much of my budget have I consumed? |
Amazon Cost Anomaly Detection | Have you detected any anomalies in my spending? |
Service categories | How much did we spend on databases in October? |
Usage types | How much did we spend on EBSVolumeUsage:io2 last month? |
API operations | What was the spend on the NatGateway operation yesterday? |
Usage amounts | How many EC2 instance hours did we use last month? |