Skip to content

aws.compute_optimizer.get_recommendation_preferences

Example SQL Queries

SELECT * FROM
aws.compute_optimizer.get_recommendation_preferences
WHERE
"resource_type" = 'VALUE';

Description

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.

Table Definition

Column NameColumn Data Type
resource_type Required Input Column

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.

VARCHAR
scope Input Column

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.

STRUCT(
"name" VARCHAR,
"value" VARCHAR
)
Show child fields
scope.name

The name of the scope.

The following scopes are possible:

  • Organization - Specifies that the recommendation preference applies at the organization level, for all member accounts of an organization.

  • AccountId - Specifies that the recommendation preference applies at the account level, for all resources of a given resource type in an account.

  • ResourceArn - Specifies that the recommendation preference applies at the individual resource level.

scope.value

The value of the scope.

If you specified the name of the scope as:

  • Organization - The value must be ALL_ACCOUNTS.

  • AccountId - The value must be a 12-digit Amazon Web Services account ID.

  • ResourceArn - The value must be the Amazon Resource Name (ARN) of an EC2 instance or an Auto Scaling group.

Only EC2 instance and Auto Scaling group ARNs are currently supported.

_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.

_aws_region Input Column

The AWS region to use.

VARCHAR
enhanced_infrastructure_metrics

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.

VARCHAR
external_metrics_preference

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.

STRUCT(
"source" VARCHAR
)
Show child fields
external_metrics_preference.source

Contains the source options for external metrics preferences.

inferred_workload_types

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.

VARCHAR
look_back_period

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.

VARCHAR
preferred_resources

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.

STRUCT(
"name" VARCHAR,
"include_list" VARCHAR[],
"effective_include_list" VARCHAR[],
"exclude_list" VARCHAR[]
)[]
Show child fields
preferred_resources[]
Show child fields
preferred_resources[].effective_include_list[]
preferred_resources[].exclude_list[]
preferred_resources[].include_list[]
preferred_resources[].name

The name of the preferred resource list.

savings_estimation_mode

Describes the savings estimation mode used for calculating savings opportunity.

Only the account manager or delegated administrator of your organization can activate this preference.

VARCHAR
utilization_preferences

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.

STRUCT(
"metric_name" VARCHAR,
"metric_parameters" STRUCT(
"threshold" VARCHAR,
"headroom" VARCHAR
)
)[]
Show child fields
utilization_preferences[]
Show child fields
utilization_preferences[].metric_name

The name of the resource utilization metric name to customize.

utilization_preferences[].metric_parameters

The parameters to set when customizing the resource utilization thresholds.

Show child fields
utilization_preferences[].metric_parameters.headroom

The headroom value in percentage used for the specified metric parameter.

The following lists the valid values for CPU and memory utilization.

  • CPU utilization: PERCENT_30 | PERCENT_20 | PERCENT_0

  • Memory utilization: PERCENT_30 | PERCENT_20 | PERCENT_10

utilization_preferences[].metric_parameters.threshold

The threshold value used for the specified metric parameter.

You can only specify the threshold value for CPU utilization.