GetEC2InstanceRecommendations
Returns Amazon EC2 instance recommendations.
AWS Compute Optimizer generates recommendations for Amazon Elastic Compute Cloud (Amazon EC2) instances that meet a specific set of requirements. For more information, see the Supported resources and requirements in the AWS Compute Optimizer User Guide.
Request Syntax
{ "accountIds": [ "string" ], "filters": [
"instanceArns": [ "string" ], "maxResults": number,
"nextToken": "string",
"recommendationPreferences": {
"cpuVendorArchitectures": [ "string" ] }}
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters (p. 132).
The request accepts the following data in JSON format.
accountIds (p. 37)
The ID of the AWS account for which to return instance recommendations.
If your account is the management account of an organization, use this parameter to specify the member account for which you want to return instance recommendations.
Only one account ID can be specified per request.
Type: Array of strings Required: No
filters (p. 37)
An array of objects to specify a filter that returns a more specific list of instance recommendations.
Type: Array of Filter (p. 87) objects Required: No
instanceArns (p. 37)
The Amazon Resource Name (ARN) of the instances for which to return recommendations.
Type: Array of strings
Response Syntax
Required: No maxResults (p. 37)
The maximum number of instance recommendations to return with a single request.
To retrieve the remaining results, make another request with the returned nextToken value.
Type: Integer Required: No nextToken (p. 37)
The token to advance to the next page of instance recommendations.
Type: String Required: No
recommendationPreferences (p. 37)
An object to specify the preferences for the Amazon EC2 instance recommendations to return in the response.
Type: RecommendationPreferences (p. 112) object Required: No
"instanceRecommendations": [ {
"accountId": "string",
"currentInstanceType": "string", "currentPerformanceRisk": "string", "effectiveRecommendationPreferences": { "cpuVendorArchitectures": [ "string" ], "enhancedInfrastructureMetrics": "string", "inferredWorkloadTypes": "string"
Response Elements
"nextToken": "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.
errors (p. 38)
An array of objects that describe errors of the request.
For example, an error is returned if you request recommendations for an instance of an unsupported instance family.
Type: Array of GetRecommendationError (p. 89) objects instanceRecommendations (p. 38)
An array of objects that describe instance recommendations.
Type: Array of InstanceRecommendation (p. 90) objects nextToken (p. 38)
The token to use to advance to the next page of instance recommendations.
This value is null when there are no more pages of instance recommendations to return.
Type: String
Errors
Errors
For information about the errors that are common to all actions, see Common Errors (p. 134).
AccessDeniedException
You do not have sufficient access to perform this action.
HTTP Status Code: 400 InternalServerException
An internal error has occurred. Try your call again.
HTTP Status Code: 500 InvalidParameterValueException
The value supplied for the input parameter is out of range or not valid.
HTTP Status Code: 400 MissingAuthenticationToken
The request must contain either a valid (registered) AWS access key ID or X.509 certificate.
HTTP Status Code: 400 OptInRequiredException
The account is not opted in to AWS Compute Optimizer.
HTTP Status Code: 400 ResourceNotFoundException
A resource that is required for the action doesn't exist.
HTTP Status Code: 400 ServiceUnavailableException
The request has failed due to a temporary failure of the server.
HTTP Status Code: 500 ThrottlingException
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:
• AWS Command Line Interface
• AWS SDK for .NET
• AWS SDK for C++
• AWS SDK for Go
• AWS SDK for Java V2
• AWS SDK for JavaScript
See Also
• AWS SDK for PHP V3
• AWS SDK for Python
• AWS SDK for Ruby V3
GetEC2RecommendationProjectedMetrics
GetEC2RecommendationProjectedMetrics
Returns the projected utilization metrics of Amazon EC2 instance recommendations.
Note
The Cpu and Memory metrics are the only projected utilization metrics returned when you run this action. Additionally, the Memory metric is returned only for resources that have the unified CloudWatch agent installed on them. For more information, see Enabling Memory Utilization with the CloudWatch Agent.
Request Syntax
{
"endTime": number, "instanceArn": "string", "period": number,
"recommendationPreferences": {
"cpuVendorArchitectures": [ "string" ] },
"startTime": number, "stat": "string"
}
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters (p. 132).
The request accepts the following data in JSON format.
endTime (p. 42)
The timestamp of the last projected metrics data point to return.
Type: Timestamp Required: Yes instanceArn (p. 42)
The Amazon Resource Name (ARN) of the instances for which to return recommendation projected metrics.
Type: String Required: Yes period (p. 42)
The granularity, in seconds, of the projected metrics data points.
Type: Integer Required: Yes
recommendationPreferences (p. 42)
An object to specify the preferences for the Amazon EC2 recommendation projected metrics to return in the response.
Type: RecommendationPreferences (p. 112) object
Response Syntax
Required: No startTime (p. 42)
The timestamp of the first projected metrics data point to return.
Type: Timestamp Required: Yes stat (p. 42)
The statistic of the projected metrics.
Type: String
Valid Values: Maximum | Average Required: Yes
Response Syntax
{ "recommendedOptionProjectedMetrics": [ {
"projectedMetrics": [ {
"name": "string",
"timestamps": [ number ], "values": [ number ] }
],
"rank": number,
"recommendedInstanceType": "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.
recommendedOptionProjectedMetrics (p. 43)
An array of objects that describes projected metrics.
Type: Array of RecommendedOptionProjectedMetric (p. 117) objects
Errors
For information about the errors that are common to all actions, see Common Errors (p. 134).
AccessDeniedException
You do not have sufficient access to perform this action.
HTTP Status Code: 400
See Also
InternalServerException
An internal error has occurred. Try your call again.
HTTP Status Code: 500 InvalidParameterValueException
The value supplied for the input parameter is out of range or not valid.
HTTP Status Code: 400 MissingAuthenticationToken
The request must contain either a valid (registered) AWS access key ID or X.509 certificate.
HTTP Status Code: 400 OptInRequiredException
The account is not opted in to AWS Compute Optimizer.
HTTP Status Code: 400 ResourceNotFoundException
A resource that is required for the action doesn't exist.
HTTP Status Code: 400 ServiceUnavailableException
The request has failed due to a temporary failure of the server.
HTTP Status Code: 500 ThrottlingException
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:
• AWS Command Line Interface
• AWS SDK for .NET
• AWS SDK for C++
• AWS SDK for Go
• AWS SDK for Java V2
• AWS SDK for JavaScript
• AWS SDK for PHP V3
• AWS SDK for Python
• AWS SDK for Ruby V3
GetEffectiveRecommendationPreferences
GetEffectiveRecommendationPreferences
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 (p. 132).
The request accepts the following data in JSON format.
resourceArn (p. 45)
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.
enhancedInfrastructureMetrics (p. 45)
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
Errors
GetAutoScalingGroupRecommendations (p. 28) and GetEC2InstanceRecommendations (p. 37) actions.
For more information, see Enhanced infrastructure metrics in the AWS Compute Optimizer User Guide.
Type: String
Valid Values: Active | Inactive
Errors
For information about the errors that are common to all actions, see Common Errors (p. 134).
AccessDeniedException
You do not have sufficient access to perform this action.
HTTP Status Code: 400 InternalServerException
An internal error has occurred. Try your call again.
HTTP Status Code: 500 InvalidParameterValueException
The value supplied for the input parameter is out of range or not valid.
HTTP Status Code: 400 MissingAuthenticationToken
The request must contain either a valid (registered) AWS access key ID or X.509 certificate.
HTTP Status Code: 400 OptInRequiredException
The account is not opted in to AWS Compute Optimizer.
HTTP Status Code: 400 ResourceNotFoundException
A resource that is required for the action doesn't exist.
HTTP Status Code: 400 ServiceUnavailableException
The request has failed due to a temporary failure of the server.
HTTP Status Code: 500 ThrottlingException
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:
See Also
• AWS Command Line Interface
• AWS SDK for .NET
• AWS SDK for C++
• AWS SDK for Go
• AWS SDK for Java V2
• AWS SDK for JavaScript
• AWS SDK for PHP V3
• AWS SDK for Python
• AWS SDK for Ruby V3
GetEnrollmentStatus
GetEnrollmentStatus
Returns the enrollment (opt in) status of an account to the AWS Compute Optimizer service.
If the account is the management account of an organization, this action also confirms the enrollment status of member accounts of the organization. Use the
GetEnrollmentStatusesForOrganization (p. 50) action to get detailed information about the enrollment status of member accounts of an organization.
Response Syntax
{
"lastUpdatedTimestamp": number, "memberAccountsEnrolled": boolean, "numberOfMemberAccountsOptedIn": number, "status": "string",
"statusReason": "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.
lastUpdatedTimestamp (p. 48)
The Unix epoch timestamp, in seconds, of when the account enrollment status was last updated.
Type: Timestamp
memberAccountsEnrolled (p. 48)
Confirms the enrollment status of member accounts of the organization, if the account is a management account of an organization.
Type: Boolean
numberOfMemberAccountsOptedIn (p. 48)
The count of organization member accounts that are opted in to the service, if your account is an organization management account.
Type: Integer status (p. 48)
The enrollment status of the account.
Type: String
Valid Values: Active | Inactive | Pending | Failed statusReason (p. 48)
The reason for the enrollment status of the account.
For example, an account might show a status of Pending because member accounts of an organization require more time to be enrolled in the service.
Type: String
Errors
Errors
For information about the errors that are common to all actions, see Common Errors (p. 134).
AccessDeniedException
You do not have sufficient access to perform this action.
HTTP Status Code: 400 InternalServerException
An internal error has occurred. Try your call again.
HTTP Status Code: 500 InvalidParameterValueException
The value supplied for the input parameter is out of range or not valid.
HTTP Status Code: 400 MissingAuthenticationToken
The request must contain either a valid (registered) AWS access key ID or X.509 certificate.
HTTP Status Code: 400 ServiceUnavailableException
The request has failed due to a temporary failure of the server.
HTTP Status Code: 500 ThrottlingException
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:
• AWS Command Line Interface
• AWS SDK for .NET
• AWS SDK for C++
• AWS SDK for Go
• AWS SDK for Java V2
• AWS SDK for JavaScript
• AWS SDK for PHP V3
• AWS SDK for Python
• AWS SDK for Ruby V3
GetEnrollmentStatusesForOrganization
GetEnrollmentStatusesForOrganization
Returns the AWS Compute Optimizer enrollment (opt-in) status of organization member accounts, if your account is an organization management account.
To get the enrollment status of standalone accounts, use the GetEnrollmentStatus (p. 48) action.
Request Syntax
{ "filters": [ {
"name": "string", "values": [ "string" ] }
],
"maxResults": number, "nextToken": "string"
}
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters (p. 132).
The request accepts the following data in JSON format.
filters (p. 50)
An array of objects to specify a filter that returns a more specific list of account enrollment statuses.
Type: Array of EnrollmentFilter (p. 84) objects Required: No
maxResults (p. 50)
The maximum number of account enrollment statuses to return with a single request. You can specify up to 100 statuses to return with each request.
To retrieve the remaining results, make another request with the returned nextToken value.
Type: Integer Required: No nextToken (p. 50)
The token to advance to the next page of account enrollment statuses.
Type: String Required: No
Response Syntax
{
Response Elements
"accountEnrollmentStatuses": [ {
"accountId": "string",
"lastUpdatedTimestamp": number, "status": "string",
"statusReason": "string"
} ],
"nextToken": "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.
accountEnrollmentStatuses (p. 50)
An array of objects that describe the enrollment statuses of organization member accounts.
Type: Array of AccountEnrollmentStatus (p. 71) objects nextToken (p. 50)
The token to use to advance to the next page of account enrollment statuses.
This value is null when there are no more pages of account enrollment statuses to return.
Type: String
Errors
For information about the errors that are common to all actions, see Common Errors (p. 134).
AccessDeniedException
You do not have sufficient access to perform this action.
HTTP Status Code: 400 InternalServerException
An internal error has occurred. Try your call again.
HTTP Status Code: 500 InvalidParameterValueException
The value supplied for the input parameter is out of range or not valid.
HTTP Status Code: 400 MissingAuthenticationToken
The request must contain either a valid (registered) AWS access key ID or X.509 certificate.
HTTP Status Code: 400 ServiceUnavailableException
The request has failed due to a temporary failure of the server.
See Also
HTTP Status Code: 500 ThrottlingException
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:
• AWS Command Line Interface
• AWS SDK for .NET
• AWS SDK for C++
• AWS SDK for Go
• AWS SDK for Java V2
• AWS SDK for JavaScript
• AWS SDK for PHP V3
• AWS SDK for Python
• AWS SDK for Ruby V3
GetLambdaFunctionRecommendations
GetLambdaFunctionRecommendations
Returns AWS Lambda function recommendations.
AWS Compute Optimizer generates recommendations for functions that meet a specific set of
requirements. For more information, see the Supported resources and requirements in the AWS Compute Optimizer User Guide.
Request Syntax
{ "accountIds": [ "string" ], "filters": [
"functionArns": [ "string" ], "maxResults": number,
"nextToken": "string"
}
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters (p. 132).
The request accepts the following data in JSON format.
accountIds (p. 53)
The ID of the AWS account for which to return function recommendations.
If your account is the management account of an organization, use this parameter to specify the member account for which you want to return function recommendations.
Only one account ID can be specified per request.
Type: Array of strings Required: No
filters (p. 53)
An array of objects to specify a filter that returns a more specific list of function recommendations.
Type: Array of LambdaFunctionRecommendationFilter (p. 104) objects Required: No
functionArns (p. 53)
The Amazon Resource Name (ARN) of the functions for which to return recommendations.
You can specify a qualified or unqualified ARN. If you specify an unqualified ARN without a function version suffix, Compute Optimizer will return recommendations for the latest ($LATEST) version of the function. If you specify a qualified ARN with a version suffix, Compute Optimizer will return recommendations for the specified function version. For more information about using function versions, see Using versions in the AWS Lambda Developer Guide.
Response Syntax
Type: Array of strings Required: No
maxResults (p. 53)
The maximum number of function recommendations to return with a single request.
To retrieve the remaining results, make another request with the returned nextToken value.
Type: Integer Required: No nextToken (p. 53)
The token to advance to the next page of function recommendations.
Type: String Required: No
Response Syntax
{ "lambdaFunctionRecommendations": [ {
"accountId": "string", "currentMemorySize": number, "currentPerformanceRisk": "string", "finding": "string",
Response Elements
] } ],
"nextToken": "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.
lambdaFunctionRecommendations (p. 54)
An array of objects that describe function recommendations.
Type: Array of LambdaFunctionRecommendation (p. 101) objects nextToken (p. 54)
The token to use to advance to the next page of function recommendations.
This value is null when there are no more pages of function recommendations to return.
Type: String
Errors
For information about the errors that are common to all actions, see Common Errors (p. 134).
AccessDeniedException
You do not have sufficient access to perform this action.
HTTP Status Code: 400 InternalServerException
An internal error has occurred. Try your call again.
HTTP Status Code: 500 InvalidParameterValueException
The value supplied for the input parameter is out of range or not valid.
HTTP Status Code: 400 LimitExceededException
The request exceeds a limit of the service.
HTTP Status Code: 400 MissingAuthenticationToken
The request must contain either a valid (registered) AWS access key ID or X.509 certificate.
HTTP Status Code: 400 OptInRequiredException
The account is not opted in to AWS Compute Optimizer.
See Also
HTTP Status Code: 400 ServiceUnavailableException
The request has failed due to a temporary failure of the server.
HTTP Status Code: 500 ThrottlingException
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:
• AWS Command Line Interface
• AWS SDK for .NET
• AWS SDK for C++
• AWS SDK for Go
• AWS SDK for Java V2
• AWS SDK for JavaScript
• AWS SDK for PHP V3
• AWS SDK for Python
• AWS SDK for Ruby V3
GetRecommendationPreferences
GetRecommendationPreferences
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 AWS Compute Optimizer User Guide.
Request Syntax
{
"maxResults": number, "nextToken": "string", "resourceType": "string", "scope": {
"name": "string", "value": "string"
}}
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters (p. 132).
The request accepts the following data in JSON format.
maxResults (p. 57)
The maximum number of recommendation preferences to return with a single request.
To retrieve the remaining results, make another request with the returned nextToken value.
Type: Integer Required: No nextToken (p. 57)
The token to advance to the next page of recommendation preferences.
Type: String Required: No resourceType (p. 57)
The target resource type of the recommendation preference for which to return preferences.
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.
Type: String
Valid Values: Ec2Instance | AutoScalingGroup
Response Syntax
Required: Yes scope (p. 57)
An object that describes the scope of the recommendation preference to return.
You can return recommendation preferences that are 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 AWS Compute Optimizer User Guide.
Type: Scope (p. 121) object Required: No
Response Syntax
{
"nextToken": "string",
"recommendationPreferencesDetails": [ {
"enhancedInfrastructureMetrics": "string", "inferredWorkloadTypes": "string",
"resourceType": "string",
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
nextToken (p. 58)
The token to use to advance to the next page of recommendation preferences.
This value is null when there are no more pages of recommendation preferences to return.
This value is null when there are no more pages of recommendation preferences to return.