More Info:
Your AWS Elasticsearch Reserved Instances (RIs) should be renewed before expiration in order to get a significant discount on the hourly charges.Risk Level
LowAddress
Cost OptimisationCompliance Standards
CBPTriage and Remediation
Remediation
Using Console
Using Console
To remediate the Elasticsearch Reserved Instance Lease Expiration in the next 30 days issue for AWS using the AWS console, follow these steps:
- Login to your AWS console.
- Go to the Elasticsearch service.
- Click on the “Reserved Instances” option in the left-hand menu.
- Identify the Elasticsearch Reserved Instance that is expiring in the next 30 days.
- Click on the “Modify Reserved Instance” button.
- Select the “Extend the term of this Reserved Instance” option.
- Choose the desired term length for the extension.
- Review the changes and click on the “Purchase” button to complete the reservation extension.
Using CLI
Using CLI
To remediate the Elasticsearch Reserved Instance Lease Expiration issue in AWS using AWS CLI, follow these steps:
- Open the AWS CLI on your local machine or EC2 instance.
-
Run the following command to list all the Elasticsearch Reserved Instances in your AWS account:
- Identify the Reserved Instance that has an expiration date within the next 30 days.
-
Run the following command to modify the Reserved Instance:
Replace
<Reserved Instance ID>
with the ID of the Reserved Instance that needs to be modified, and<New Offering ID>
with the ID of the new Elasticsearch Reserved Instance offering that you want to use. Note: You can use theaws es describe-elasticsearch-instance-type-offerings
command to list all the Elasticsearch Reserved Instance offerings available in your account. -
Verify that the Reserved Instance has been modified by running the following command:
Replace
<Reserved Instance ID>
with the ID of the Reserved Instance that you modified. - Repeat steps 3 to 5 for all the Elasticsearch Reserved Instances that have an expiration date within the next 30 days.
Using Python
Using Python
To remediate the Elasticsearch Reserved Instance Lease Expiration in the next 30 days issue on AWS using Python, you can follow these steps:Replace Replace
- Import the necessary AWS SDK modules in Python:
- Set up the AWS credentials and region:
- Create an Elasticsearch client:
- Retrieve the list of Elasticsearch domains:
- Loop through each domain and check if there are any reserved instances expiring in the next 30 days:
- To remediate the issue, you can either renew the reserved instance or purchase a new one. To renew the reserved instance, use the following code:
OFFERING_ID
with the ID of the reserved instance offering, and RESERVATION_NAME
with a name for the reservation.- If you want to purchase a new reserved instance, use the following code:
OFFERING_ID
with the ID of the reserved instance offering, and RESERVATION_NAME
with a name for the reservation.By following these steps, you should be able to remediate the Elasticsearch Reserved Instance Lease Expiration in the next 30 days issue on AWS using Python.