Skip to main content

recommendation_preferences

Creates, updates, deletes, gets or lists a recommendation_preferences resource.

Overview

Namerecommendation_preferences
TypeResource
Idaws.compute_optimizer.recommendation_preferences

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
enhanced_infrastructure_metricsstringThe status of the enhanced infrastructure metrics recommendation preference. When the recommendations page is refreshed, a status of Active confirms that the preference is applied to the recommendations, and a status of Inactive confirms that the preference isn't yet applied to recommendations. For more information, see Enhanced infrastructure metrics in the Compute Optimizer User Guide. (Active, Inactive)
external_metrics_preferenceobjectAn object that describes the external metrics recommendation preference. If the preference is applied in the latest recommendation refresh, an object with a valid source value appears in the response. If the preference isn't applied to the recommendations already, then this object doesn't appear in the response.
inferred_workload_typesstringThe status of the inferred workload types recommendation preference. When the recommendations page is refreshed, a status of Active confirms that the preference is applied to the recommendations, and a status of Inactive confirms that the preference isn't yet applied to recommendations. (Active, Inactive)
look_back_periodstringThe preference to control the number of days the utilization metrics of the Amazon Web Services resource are analyzed. If the preference isn’t set, this object is null. (DAYS_14, DAYS_32, DAYS_93)
preferred_resourcesarrayThe preference to control which resource type values are considered when generating rightsizing recommendations. This object resolves any wildcard expressions and returns the effective list of candidate resource type values. If the preference isn’t set, this object is null.
resource_typestringThe target resource type of the recommendation preference to create. The Ec2Instance option encompasses standalone instances and instances that are part of Auto Scaling groups. The AutoScalingGroup option encompasses only instances that are part of an Auto Scaling group. (Ec2Instance, AutoScalingGroup, EbsVolume, LambdaFunction, NotApplicable, EcsService, License, RdsDBInstance, AuroraDBClusterStorage, Idle)
savings_estimation_modestringDescribes the savings estimation mode used for calculating savings opportunity. Only the account manager or delegated administrator of your organization can activate this preference. (AfterDiscounts, BeforeDiscounts)
scopeobjectAn object that describes the scope of the recommendation preference. Recommendation preferences can be created at the organization level (for management accounts of an organization only), account level, and resource level. For more information, see Activating enhanced infrastructure metrics in the Compute Optimizer User Guide.
utilization_preferencesarrayThe preference to control the resource’s CPU utilization threshold, CPU utilization headroom, and memory utilization headroom. If the preference isn’t set, this object is null. This preference is only available for the Amazon EC2 instance resource type.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_recommendation_preferencesselectregionReturns existing recommendation preferences, such as enhanced infrastructure metrics. Use the scope parameter to specify which preferences to return. You can specify to return preferences for an organization, a specific account ID, or a specific EC2 instance or Auto Scaling group Amazon Resource Name (ARN). For more information, see Activating enhanced infrastructure metrics in the Compute Optimizer User Guide.
put_recommendation_preferencesreplaceregion, resourceTypeCreates a new recommendation preference or updates an existing recommendation preference, such as enhanced infrastructure metrics. For more information, see Activating enhanced infrastructure metrics in the Compute Optimizer User Guide.
delete_recommendation_preferencesdeleteregionDeletes a recommendation preference, such as enhanced infrastructure metrics. For more information, see Activating enhanced infrastructure metrics in the Compute Optimizer User Guide.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

Returns existing recommendation preferences, such as enhanced infrastructure metrics. Use the scope parameter to specify which preferences to return. You can specify to return preferences for an organization, a specific account ID, or a specific EC2 instance or Auto Scaling group Amazon Resource Name (ARN). For more information, see Activating enhanced infrastructure metrics in the Compute Optimizer User Guide.

SELECT
enhanced_infrastructure_metrics,
external_metrics_preference,
inferred_workload_types,
look_back_period,
preferred_resources,
resource_type,
savings_estimation_mode,
scope,
utilization_preferences
FROM aws.compute_optimizer.recommendation_preferences
WHERE region = '{{ region }}' -- required
;

REPLACE examples

Creates a new recommendation preference or updates an existing recommendation preference, such as enhanced infrastructure metrics. For more information, see Activating enhanced infrastructure metrics in the Compute Optimizer User Guide.

REPLACE aws.compute_optimizer.recommendation_preferences
SET
resourceType = '{{ resourceType }}',
scope = '{{ scope }}',
enhancedInfrastructureMetrics = '{{ enhancedInfrastructureMetrics }}',
inferredWorkloadTypes = '{{ inferredWorkloadTypes }}',
externalMetricsPreference = '{{ externalMetricsPreference }}',
lookBackPeriod = '{{ lookBackPeriod }}',
utilizationPreferences = '{{ utilizationPreferences }}',
preferredResources = '{{ preferredResources }}',
savingsEstimationMode = '{{ savingsEstimationMode }}'
WHERE
region = '{{ region }}' --required
AND resourceType = '{{ resourceType }}' --required;

DELETE examples

Deletes a recommendation preference, such as enhanced infrastructure metrics. For more information, see Activating enhanced infrastructure metrics in the Compute Optimizer User Guide.

DELETE FROM aws.compute_optimizer.recommendation_preferences
WHERE region = '{{ region }}' --required
;