ec2_instance_recommendations
Creates, updates, deletes, gets or lists an ec2_instance_recommendations resource.
Overview
| Name | ec2_instance_recommendations |
| Type | Resource |
| Id | aws.compute_optimizer.ec2_instance_recommendations |
Fields
The following fields are returned by SELECT queries:
- get_ec2_instance_recommendations
| Name | Datatype | Description |
|---|---|---|
errors | array | 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. |
instance_recommendations | array | An array of objects that describe instance recommendations. |
next_token | string | 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. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_ec2_instance_recommendations | select | region | Returns Amazon EC2 instance recommendations. 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 Compute Optimizer User Guide. | |
export_ec2_instance_recommendations | exec | region, s3DestinationConfig | Exports optimization recommendations for Amazon EC2 instances. Recommendations are exported in a comma-separated values (.csv) file, and its metadata in a JavaScript Object Notation (JSON) (.json) file, to an existing Amazon Simple Storage Service (Amazon S3) bucket that you specify. For more information, see Exporting Recommendations in the Compute Optimizer User Guide. You can have only one Amazon EC2 instance export job in progress per Amazon Web Services Region. |
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_ec2_instance_recommendations
Returns Amazon EC2 instance recommendations. 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 Compute Optimizer User Guide.
SELECT
errors,
instance_recommendations,
next_token
FROM aws.compute_optimizer.ec2_instance_recommendations
WHERE region = '{{ region }}' -- required
;
Lifecycle Methods
- export_ec2_instance_recommendations
Exports optimization recommendations for Amazon EC2 instances. Recommendations are exported in a comma-separated values (.csv) file, and its metadata in a JavaScript Object Notation (JSON) (.json) file, to an existing Amazon Simple Storage Service (Amazon S3) bucket that you specify. For more information, see Exporting Recommendations in the Compute Optimizer User Guide. You can have only one Amazon EC2 instance export job in progress per Amazon Web Services Region.
EXEC aws.compute_optimizer.ec2_instance_recommendations.export_ec2_instance_recommendations
@region='{{ region }}' --required
@@json=
'{
"accountIds": "{{ accountIds }}",
"filters": "{{ filters }}",
"fieldsToExport": "{{ fieldsToExport }}",
"s3DestinationConfig": "{{ s3DestinationConfig }}",
"fileFormat": "{{ fileFormat }}",
"includeMemberAccounts": {{ includeMemberAccounts }},
"recommendationPreferences": "{{ recommendationPreferences }}"
}'
;