GetEffectiveRecommendationPreferences - AWS Compute Optimizer


Returns the recommendation preferences that are in effect for a given resource, such as enhanced infrastructure metrics. Considers all applicable preferences that you might have set at the resource, account, and organization level.

When you create a recommendation preference, you can set its status to Active or Inactive. Use this action to view the recommendation preferences that are in effect, or Active.

Request Syntax

{ "resourceArn": "string" }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.


The Amazon Resource Name (ARN) of the resource for which to confirm effective recommendation preferences. Only EC2 instance and Auto Scaling group ARNs are currently supported.

Type: String

Required: Yes

Response Syntax

{ "enhancedInfrastructureMetrics": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.


The status of the enhanced infrastructure metrics recommendation preference. Considers all applicable preferences that you might have set at the resource, account, and organization level.

A status of Active confirms that the preference is applied in the latest recommendation refresh, and a status of Inactive confirms that it's not yet applied to recommendations.

To validate whether the preference is applied to your last generated set of recommendations, review the effectiveRecommendationPreferences value in the response of the GetAutoScalingGroupRecommendations and GetEC2InstanceRecommendations actions.

For more information, see Enhanced infrastructure metrics in the AWS Compute Optimizer User Guide.

Type: String

Valid Values: Active | Inactive


For information about the errors that are common to all actions, see Common Errors.


You do not have sufficient access to perform this action.

HTTP Status Code: 400


An internal error has occurred. Try your call again.

HTTP Status Code: 500


The value supplied for the input parameter is out of range or not valid.

HTTP Status Code: 400


The request must contain either a valid (registered) AWS access key ID or X.509 certificate.

HTTP Status Code: 400


The account is not opted in to AWS Compute Optimizer.

HTTP Status Code: 400


A resource that is required for the action doesn't exist.

HTTP Status Code: 400


The request has failed due to a temporary failure of the server.

HTTP Status Code: 500


The request was denied due to request throttling.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: