Skip to content

aws.ce.get_savings_plans_purchase_recommendation

Example SQL Queries

SELECT * FROM
aws.ce.get_savings_plans_purchase_recommendation
WHERE
"savings_plans_type" = 'VALUE'
AND "term_in_years" = 'VALUE'
AND "payment_option" = 'VALUE'
AND "lookback_period_in_days" = 'VALUE';

Description

Retrieves the Savings Plans recommendations for your account. First use StartSavingsPlansPurchaseRecommendationGeneration to generate a new set of recommendations, and then use GetSavingsPlansPurchaseRecommendation to retrieve them.

Table Definition

Column NameColumn Data Type
lookback_period_in_days Required Input Column

The lookback period that's used to generate the recommendation.

VARCHAR
payment_option Required Input Column

The payment option that's used to generate these recommendations.

VARCHAR
savings_plans_type Required Input Column

The Savings Plans recommendation type that's requested.

VARCHAR
term_in_years Required Input Column

The savings plan recommendation term that's used to generate these recommendations.

VARCHAR
account_scope Input Column

The account scope that you want your recommendations for. Amazon Web Services calculates recommendations including the management account and member accounts if the value is set to PAYER. If the value is LINKED, recommendations are calculated for individual member accounts only.

VARCHAR
filter Input Column

You can filter your recommendations by Account ID with the LINKED_ACCOUNT dimension. To filter your recommendations by Account ID, specify Key as LINKED_ACCOUNT and Value as the comma-separated Acount ID(s) that you want to see Savings Plans purchase recommendations for.

For GetSavingsPlansPurchaseRecommendation, the Filter doesn't include CostCategories or Tags. It only includes Dimensions. With Dimensions, Key must be LINKED_ACCOUNT and Value can be a single Account ID or multiple comma-separated Account IDs that you want to see Savings Plans Purchase Recommendations for. AND and OR operators are not supported.

STRUCT(
"dimensions" STRUCT(
"key" VARCHAR,
"values" VARCHAR[],
"match_options" VARCHAR[]
),
"tags" STRUCT(
"key" VARCHAR,
"values" VARCHAR[],
"match_options" VARCHAR[]
),
"cost_categories" STRUCT(
"key" VARCHAR,
"values" VARCHAR[],
"match_options" VARCHAR[]
)
)
Show child fields
filter.cost_categories

The filter that's based on CostCategory values.

Show child fields
filter.cost_categories.key

The unique name of the Cost Category.

filter.cost_categories.match_options[]
filter.cost_categories.values[]
filter.dimensions

The specific Dimension to use for Expression.

Show child fields
filter.dimensions.key

The names of the metadata types that you can use to filter and group your results. For example, AZ returns a list of Availability Zones.

Not all dimensions are supported in each API. Refer to the documentation for each specific API to see what is supported.

LINK_ACCOUNT_NAME and SERVICE_CODE can only be used in CostCategoryRule.

ANOMALY_TOTAL_IMPACT_ABSOLUTE and ANOMALY_TOTAL_IMPACT_PERCENTAGE can only be used in AnomalySubscriptions.

filter.dimensions.match_options[]
filter.dimensions.values[]
filter.tags

The specific Tag to use for Expression.

Show child fields
filter.tags.key

The key for the tag.

filter.tags.match_options[]
filter.tags.values[]
next_page_token Input Column

The token for the next set of retrievable results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.

VARCHAR
page_size Input Column

The number of recommendations that you want returned in a single response object.

BIGINT
_aws_profile Input Column

The AWS profile defines the AWS identity used. It can be defined via credentials or by assuming a IAM role.

STRUCT(
"type" VARCHAR,
"name" VARCHAR,
"account_id" VARCHAR,
"via_profile_name" VARCHAR,
"assumed_role_arn" VARCHAR,
"organization" STRUCT(
"account_name" VARCHAR,
"id" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[],
"master_account" STRUCT(
"id" VARCHAR,
"email" VARCHAR
),
"parents" STRUCT(
"type" VARCHAR,
"id" VARCHAR,
"name" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[]
)[]
)
)
Show child fields
_aws_profile.account_id

The AWS account id

_aws_profile.assumed_role_arn

The ARN of the assumed role

_aws_profile.name

The unique name of the profile.

_aws_profile.organization

Information about this profile's membership in the AWS organization.

Show child fields
_aws_profile.organization.account_name

The name of account speciifed by the organization

_aws_profile.organization.id

The organization id

_aws_profile.organization.master_account
Show child fields
_aws_profile.organization.master_account.email

The organization master account email address

_aws_profile.organization.master_account.id

The organization master account id

_aws_profile.organization.parents[]
Show child fields
_aws_profile.organization.parents[].id

The id of the parent

_aws_profile.organization.parents[].name

The name of the parent

_aws_profile.organization.parents[].tags[]
Show child fields
_aws_profile.organization.parents[].tags[].key
_aws_profile.organization.parents[].tags[].value
_aws_profile.organization.parents[].type

The type of parent can be an organization unit or a root

_aws_profile.organization.tags[]
Show child fields
_aws_profile.organization.tags[].key
_aws_profile.organization.tags[].value
_aws_profile.type

The type of profile, either 'credentials' or 'assumed_role'

_aws_profile.via_profile_name

This IAM role for this profile is assumed by first utilizing another profile with this name to obtain credentials.

metadata

Information that regards this specific recommendation set.

STRUCT(
"recommendation_id" VARCHAR,
"generation_timestamp" VARCHAR,
"additional_metadata" VARCHAR
)
Show child fields
metadata.additional_metadata

Additional metadata that might be applicable to the recommendation.

metadata.generation_timestamp

The timestamp that shows when the recommendations were generated.

metadata.recommendation_id

The unique identifier for the recommendation set.

savings_plans_purchase_recommendation

Contains your request parameters, Savings Plan Recommendations Summary, and Details.

STRUCT(
"account_scope" VARCHAR,
"savings_plans_type" VARCHAR,
"term_in_years" VARCHAR,
"payment_option" VARCHAR,
"lookback_period_in_days" VARCHAR,
"savings_plans_purchase_recommendation_details" STRUCT(
"savings_plans_details" STRUCT(
"region" VARCHAR,
"instance_family" VARCHAR,
"offering_id" VARCHAR
),
"account_id" VARCHAR,
"upfront_cost" VARCHAR,
"estimated_roi" VARCHAR,
"currency_code" VARCHAR,
"estimated_sp_cost" VARCHAR,
"estimated_on_demand_cost" VARCHAR,
"estimated_on_demand_cost_with_current_commitment" VARCHAR,
"estimated_savings_amount" VARCHAR,
"estimated_savings_percentage" VARCHAR,
"hourly_commitment_to_purchase" VARCHAR,
"estimated_average_utilization" VARCHAR,
"estimated_monthly_savings_amount" VARCHAR,
"current_minimum_hourly_on_demand_spend" VARCHAR,
"current_maximum_hourly_on_demand_spend" VARCHAR,
"current_average_hourly_on_demand_spend" VARCHAR,
"recommendation_detail_id" VARCHAR
)[],
"savings_plans_purchase_recommendation_summary" STRUCT(
"estimated_roi" VARCHAR,
"currency_code" VARCHAR,
"estimated_total_cost" VARCHAR,
"current_on_demand_spend" VARCHAR,
"estimated_savings_amount" VARCHAR,
"total_recommendation_count" VARCHAR,
"daily_commitment_to_purchase" VARCHAR,
"hourly_commitment_to_purchase" VARCHAR,
"estimated_savings_percentage" VARCHAR,
"estimated_monthly_savings_amount" VARCHAR,
"estimated_on_demand_cost_with_current_commitment" VARCHAR
)
)
Show child fields
savings_plans_purchase_recommendation.account_scope

The account scope that you want your recommendations for. Amazon Web Services calculates recommendations that include the management account and member accounts if the value is set to PAYER. If the value is LINKED, recommendations are calculated for individual member accounts only.

savings_plans_purchase_recommendation.lookback_period_in_days

The lookback period in days that's used to generate the recommendation.

savings_plans_purchase_recommendation.payment_option

The payment option that's used to generate the recommendation.

savings_plans_purchase_recommendation.savings_plans_purchase_recommendation_details[]
Show child fields
savings_plans_purchase_recommendation.savings_plans_purchase_recommendation_details[].account_id

The AccountID the recommendation is generated for.

savings_plans_purchase_recommendation.savings_plans_purchase_recommendation_details[].currency_code

The currency code that Amazon Web Services used to generate the recommendations and present potential savings.

savings_plans_purchase_recommendation.savings_plans_purchase_recommendation_details[].current_average_hourly_on_demand_spend

The average value of hourly On-Demand spend over the lookback period of the applicable usage type.

savings_plans_purchase_recommendation.savings_plans_purchase_recommendation_details[].current_maximum_hourly_on_demand_spend

The highest value of hourly On-Demand spend over the lookback period of the applicable usage type.

savings_plans_purchase_recommendation.savings_plans_purchase_recommendation_details[].current_minimum_hourly_on_demand_spend

The lowest value of hourly On-Demand spend over the lookback period of the applicable usage type.

savings_plans_purchase_recommendation.savings_plans_purchase_recommendation_details[].estimated_average_utilization

The estimated utilization of the recommended Savings Plans.

savings_plans_purchase_recommendation.savings_plans_purchase_recommendation_details[].estimated_monthly_savings_amount

The estimated monthly savings amount based on the recommended Savings Plans.

savings_plans_purchase_recommendation.savings_plans_purchase_recommendation_details[].estimated_on_demand_cost

The remaining On-Demand cost estimated to not be covered by the recommended Savings Plans, over the length of the lookback period.

savings_plans_purchase_recommendation.savings_plans_purchase_recommendation_details[].estimated_on_demand_cost_with_current_commitment

The estimated On-Demand costs you expect with no additional commitment, based on your usage of the selected time period and the Savings Plans you own.

savings_plans_purchase_recommendation.savings_plans_purchase_recommendation_details[].estimated_roi

The estimated return on investment that's based on the recommended Savings Plans that you purchased. This is calculated as estimatedSavingsAmount/ estimatedSPCost*100.

savings_plans_purchase_recommendation.savings_plans_purchase_recommendation_details[].estimated_savings_amount

The estimated savings amount that's based on the recommended Savings Plans over the length of the lookback period.

savings_plans_purchase_recommendation.savings_plans_purchase_recommendation_details[].estimated_savings_percentage

The estimated savings percentage relative to the total cost of applicable On-Demand usage over the lookback period.

savings_plans_purchase_recommendation.savings_plans_purchase_recommendation_details[].estimated_sp_cost

The cost of the recommended Savings Plans over the length of the lookback period.

savings_plans_purchase_recommendation.savings_plans_purchase_recommendation_details[].hourly_commitment_to_purchase

The recommended hourly commitment level for the Savings Plans type and the configuration that's based on the usage during the lookback period.

savings_plans_purchase_recommendation.savings_plans_purchase_recommendation_details[].recommendation_detail_id

Contains detailed information about a specific Savings Plan recommendation.

savings_plans_purchase_recommendation.savings_plans_purchase_recommendation_details[].savings_plans_details

Details for your recommended Savings Plans.

Show child fields
savings_plans_purchase_recommendation.savings_plans_purchase_recommendation_details[].savings_plans_details.instance_family

A group of instance types that Savings Plans applies to.

savings_plans_purchase_recommendation.savings_plans_purchase_recommendation_details[].savings_plans_details.offering_id

The unique ID that's used to distinguish Savings Plans from one another.

savings_plans_purchase_recommendation.savings_plans_purchase_recommendation_details[].savings_plans_details.region

A collection of Amazon Web Services resources in a geographic area. Each Amazon Web Services Region is isolated and independent of the other Regions.

savings_plans_purchase_recommendation.savings_plans_purchase_recommendation_details[].upfront_cost

The upfront cost of the recommended Savings Plans, based on the selected payment option.

savings_plans_purchase_recommendation.savings_plans_purchase_recommendation_summary

Summary metrics for your Savings Plans Recommendations.

Show child fields
savings_plans_purchase_recommendation.savings_plans_purchase_recommendation_summary.currency_code

The currency code that Amazon Web Services used to generate the recommendations and present potential savings.

savings_plans_purchase_recommendation.savings_plans_purchase_recommendation_summary.current_on_demand_spend

The current total on demand spend of the applicable usage types over the lookback period.

savings_plans_purchase_recommendation.savings_plans_purchase_recommendation_summary.daily_commitment_to_purchase

The recommended Savings Plans cost on a daily (24 hourly) basis.

savings_plans_purchase_recommendation.savings_plans_purchase_recommendation_summary.estimated_monthly_savings_amount

The estimated monthly savings amount that's based on the recommended Savings Plans purchase.

savings_plans_purchase_recommendation.savings_plans_purchase_recommendation_summary.estimated_on_demand_cost_with_current_commitment

The estimated On-Demand costs you expect with no additional commitment. It's based on your usage of the selected time period and the Savings Plans you own.

savings_plans_purchase_recommendation.savings_plans_purchase_recommendation_summary.estimated_roi

The estimated return on investment that's based on the recommended Savings Plans and estimated savings.

savings_plans_purchase_recommendation.savings_plans_purchase_recommendation_summary.estimated_savings_amount

The estimated total savings over the lookback period, based on the purchase of the recommended Savings Plans.

savings_plans_purchase_recommendation.savings_plans_purchase_recommendation_summary.estimated_savings_percentage

The estimated savings relative to the total cost of On-Demand usage, over the lookback period. This is calculated as estimatedSavingsAmount/ CurrentOnDemandSpend*100.

savings_plans_purchase_recommendation.savings_plans_purchase_recommendation_summary.estimated_total_cost

The estimated total cost of the usage after purchasing the recommended Savings Plans. This is a sum of the cost of Savings Plans during this term, and the remaining On-Demand usage.

savings_plans_purchase_recommendation.savings_plans_purchase_recommendation_summary.hourly_commitment_to_purchase

The recommended hourly commitment that's based on the recommendation parameters.

savings_plans_purchase_recommendation.savings_plans_purchase_recommendation_summary.total_recommendation_count

The aggregate number of Savings Plans recommendations that exist for your account.

savings_plans_purchase_recommendation.savings_plans_type

The requested Savings Plans recommendation type.

savings_plans_purchase_recommendation.term_in_years

The Savings Plans recommendation term in years. It's used to generate the recommendation.