GetRecommendation - AWS Billing and Cost Management

GetRecommendation

Returns both the current and recommended resource configuration and the estimated cost impact for a recommendation.

The recommendationId is only valid for up to a maximum of 24 hours as recommendations are refreshed daily. To retrieve the recommendationId, use the ListRecommendations API.

Request Syntax

{ "recommendationId": "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.

recommendationId

The ID for the recommendation.

Type: String

Required: Yes

Response Syntax

{ "accountId": "string", "actionType": "string", "costCalculationLookbackPeriodInDays": number, "currencyCode": "string", "currentResourceDetails": { ... }, "currentResourceType": "string", "estimatedMonthlyCost": number, "estimatedMonthlySavings": number, "estimatedSavingsOverCostCalculationLookbackPeriod": number, "estimatedSavingsPercentage": number, "implementationEffort": "string", "lastRefreshTimestamp": number, "recommendationId": "string", "recommendationLookbackPeriodInDays": number, "recommendedResourceDetails": { ... }, "recommendedResourceType": "string", "region": "string", "resourceArn": "string", "resourceId": "string", "restartNeeded": boolean, "rollbackPossible": boolean, "source": "string", "tags": [ { "key": "string", "value": "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.

accountId

The account that the recommendation is for.

Type: String

actionType

The type of action you can take by adopting the recommendation.

Type: String

Valid Values: Rightsize | Stop | Upgrade | PurchaseSavingsPlans | PurchaseReservedInstances | MigrateToGraviton

costCalculationLookbackPeriodInDays

The lookback period used to calculate cost impact for a recommendation.

Type: Integer

currencyCode

The currency code used for the recommendation.

Type: String

currentResourceDetails

The details for the resource.

Type: ResourceDetails object

Note: This object is a Union. Only one member of this object can be specified or returned.

currentResourceType

The type of resource.

Type: String

Valid Values: Ec2Instance | LambdaFunction | EbsVolume | EcsService | Ec2AutoScalingGroup | Ec2InstanceSavingsPlans | ComputeSavingsPlans | SageMakerSavingsPlans | Ec2ReservedInstances | RdsReservedInstances | OpenSearchReservedInstances | RedshiftReservedInstances | ElastiCacheReservedInstances | RdsDbInstanceStorage | RdsDbInstance

estimatedMonthlyCost

The estimated monthly cost of the current resource. For Reserved Instances and Savings Plans, it refers to the cost for eligible usage.

Type: Double

estimatedMonthlySavings

The estimated monthly savings amount for the recommendation.

Type: Double

estimatedSavingsOverCostCalculationLookbackPeriod

The estimated savings amount over the lookback period used to calculate cost impact for a recommendation.

Type: Double

estimatedSavingsPercentage

The estimated savings percentage relative to the total cost over the cost calculation lookback period.

Type: Double

implementationEffort

The effort required to implement the recommendation.

Type: String

Valid Values: VeryLow | Low | Medium | High | VeryHigh

lastRefreshTimestamp

The time when the recommendation was last generated.

Type: Timestamp

recommendationId

The ID for the recommendation.

Type: String

recommendationLookbackPeriodInDays

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

Type: Integer

recommendedResourceDetails

The details about the recommended resource.

Type: ResourceDetails object

Note: This object is a Union. Only one member of this object can be specified or returned.

recommendedResourceType

The resource type of the recommendation.

Type: String

Valid Values: Ec2Instance | LambdaFunction | EbsVolume | EcsService | Ec2AutoScalingGroup | Ec2InstanceSavingsPlans | ComputeSavingsPlans | SageMakerSavingsPlans | Ec2ReservedInstances | RdsReservedInstances | OpenSearchReservedInstances | RedshiftReservedInstances | ElastiCacheReservedInstances | RdsDbInstanceStorage | RdsDbInstance

region

The AWS Region of the resource.

Type: String

resourceArn

The Amazon Resource Name (ARN) of the resource.

Type: String

resourceId

The unique identifier for the resource. This is the same as the Amazon Resource Name (ARN), if available.

Type: String

restartNeeded

Whether or not implementing the recommendation requires a restart.

Type: Boolean

rollbackPossible

Whether or not implementing the recommendation can be rolled back.

Type: Boolean

source

The source of the recommendation.

Type: String

Valid Values: ComputeOptimizer | CostExplorer

tags

A list of tags associated with the resource for which the recommendation exists.

Type: Array of Tag objects

Array Members: Minimum number of 1 item. Maximum number of 100 items.

Errors

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

AccessDeniedException

You are not authorized to use this operation with the given parameters.

HTTP Status Code: 400

InternalServerException

An error on the server occurred during the processing of your request. Try again later.

HTTP Status Code: 500

ResourceNotFoundException

The specified Amazon Resource Name (ARN) in the request doesn't exist.

HTTP Status Code: 400

ThrottlingException

The request was denied due to request throttling.

HTTP Status Code: 400

ValidationException

The input fails to satisfy the constraints specified by an AWS service.

HTTP Status Code: 400

See Also

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