More Info:
All active Amazon Elasticsearch (ES) Reserved Instance purchases should be reviewed every 7 days to make sure that no unwanted RI purchase has been placed recently.Risk Level
LowAddress
Cost OptimisationCompliance Standards
CBPTriage and Remediation
Remediation
Using Console
Using Console
The issue “Elasticsearch Reserved Instance Recent Purchases Should Be Reviewed” indicates that there have been recent purchases of Amazon Elasticsearch Reserved Instances, and these purchases should be reviewed to ensure that they align with your current usage and requirements. Here are the steps to remediate this issue in AWS using the AWS Console:
- Log in to the AWS Management Console and navigate to the Amazon Elasticsearch Service console.
- Click on the “Reserved Instances” tab in the left-hand menu.
- Review the list of recently purchased Reserved Instances and identify any that are not aligned with your current usage or requirements.
- Select the Reserved Instance(s) that need to be modified or canceled.
- Click on the “Actions” dropdown menu and select “Modify Reserved Instances” or “Cancel Reserved Instances” as appropriate.
- Follow the prompts to modify or cancel the Reserved Instance(s).
- Once you have made any necessary changes, review the Reserved Instances again to ensure that they are aligned with your current usage and requirements.
Using CLI
Using CLI
The Elasticsearch Reserved Instance Recent Purchases Should Be Reviewed misconfiguration in AWS occurs when there are recent purchases of Elasticsearch reserved instances that have not been reviewed for accuracy. To remediate this issue, follow these steps using AWS CLI:Replace Replace
- Log in to your AWS account using the AWS CLI.
- Run the following command to list all Elasticsearch reserved instances:
- Review the output to identify any recent purchases that have not been reviewed.
- Run the following command to modify the Elasticsearch reserved instance to match your current usage:
<instance-id>
with the ID of the reserved instance that needs to be modified, <offering-id>
with the ID of the offering that you want to use, and <instance-count>
with the number of Elasticsearch instances that you want to reserve.- Review the output to ensure that the reserved instance has been modified correctly.
- Run the following command to confirm that the reservation has been applied:
<instance-id>
with the ID of the reserved instance that you modified.- Review the output to ensure that the reservation has been applied correctly.
Using Python
Using Python
The misconfiguration “Elasticsearch Reserved Instance Recent Purchases Should Be Reviewed” means that there are unused or underutilized Elasticsearch reserved instances that were recently purchased. To remediate this issue, you can use the following steps in Python:By following these steps, you can remediate the misconfiguration “Elasticsearch Reserved Instance Recent Purchases Should Be Reviewed” for AWS using Python.
- Get a list of all Elasticsearch reserved instances that are currently active and unused. You can use the
boto3
library to interact with AWS Elasticsearch service and retrieve the list of reserved instances. The following code snippet shows how to retrieve the list of reserved instances:
- Determine the utilization of each reserved instance. You can use CloudWatch metrics to determine the utilization of each reserved instance. The following code snippet shows how to retrieve the average CPU utilization metric for a reserved instance:
- Identify the reserved instances that have low utilization. You can set a threshold for the utilization and identify the reserved instances that have utilization below the threshold. For example, if you set the threshold to 20%, you can identify the reserved instances that have utilization below 20%.
- Review the list of reserved instances with low utilization and determine if they can be released or if the instance type can be changed to better match the workload. If the reserved instances can be released, you can use the
boto3
library to release the Elasticsearch reserved instances. The following code snippet shows how to release a reserved instance: