More Info:
Scale up any Amazon ElasticSearch (ES) clusters that appear to run low on disk space to help mitigate any issues.Risk Level
LowAddress
Reliability, Operational MaturityCompliance Standards
CBPTriage and Remediation
Remediation
Using Console
Using Console
To remediate the Elasticsearch free storage space issue in AWS, follow these steps:
- Login to your AWS console and navigate to the Elasticsearch service.
- Select the Elasticsearch domain that you want to remediate.
- Click on the “Modify” button.
- Scroll down to the “EBS Volume” section.
- Increase the “EBS Volume Size” to provide more storage space.
- Click on the “Save Changes” button.
- Wait for the Elasticsearch domain to update and the new storage space to be available.
- Verify that the Elasticsearch domain now has free storage space by checking the Elasticsearch dashboard or running a query.
Using CLI
Using CLI
To remediate the Elasticsearch misconfiguration of not having free storage space in AWS using AWS CLI, follow these steps:Replace This command should return a value greater than the current storage usage.
- Open the AWS CLI on your local machine or use the AWS CLI in the AWS Management Console.
- Run the following command to list all the Elasticsearch domains in your AWS account:
- Identify the Elasticsearch domain that has the misconfiguration of not having free storage space.
- Run the following command to update the Elasticsearch domain configuration and set the storage type to EBS and the EBS volume size to a value greater than the current storage usage:
<domain-name>
with the name of the Elasticsearch domain and <new-volume-size>
with the desired EBS volume size in gigabytes.- Wait for the Elasticsearch domain to be updated. This may take several minutes.
- Run the following command to verify that the Elasticsearch domain has free storage space:
- Repeat steps 4-6 for any other Elasticsearch domains that have the misconfiguration of not having free storage space.
Using Python
Using Python
To remediate the Elasticsearch misconfiguration of not having free storage space in AWS using Python, you can follow these steps:By following these steps, you can remediate the Elasticsearch misconfiguration of not having free storage space in AWS using Python.
- Import the necessary Python modules:
- Initialize a boto3 Elasticsearch client:
- Get the Elasticsearch domain name:
- Get the Elasticsearch domain configuration:
- Get the current storage space usage:
- Get the maximum storage space limit:
- Calculate the required free storage space:
- If the current storage space usage is greater than or equal to the required free storage space, then increase the storage limit:
- Print a message indicating whether the storage limit was increased: