recommendation_preferences
Creates, updates, deletes, gets or lists a recommendation_preferences resource.
Overview
| Name | recommendation_preferences |
| Type | Resource |
| Id | aws.compute_optimizer.recommendation_preferences |
Fields
The following fields are returned by SELECT queries:
- get_recommendation_preferences
| Name | Datatype | Description |
|---|---|---|
enhanced_infrastructure_metrics | string | The 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_preference | object | An 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_types | string | The 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_period | string | The 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_resources | array | The 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_type | string | The 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_mode | string | Describes 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) |
scope | object | An 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_preferences | array | The 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_recommendation_preferences | select | region | 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. | |
put_recommendation_preferences | replace | region, resourceType | 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. | |
delete_recommendation_preferences | delete | region | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- get_recommendation_preferences
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
- put_recommendation_preferences
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
- delete_recommendation_preferences
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
;