More Info:
Your AWS RDS Reserved Instances (RIs) should be renewed before expiration in order to get the appropriate discount on the hourly charge for these instancesRisk Level
MediumAddress
Cost OptimisationCompliance Standards
CBPTriage and Remediation
Remediation
Using Console
Using Console
To renew RDS Reserved Instances before expiration in AWS RDS using the AWS Management Console, follow these steps:
- Login to AWS Console: Go to the AWS Management Console at https://aws.amazon.com/ and login with your credentials.
- Navigate to RDS Service: Click on the “Services” dropdown menu at the top of the page, then select “RDS” under the Database section.
- Select Reserved Instances: In the left-hand navigation pane, click on “Reserved Instances” to view the list of your existing reserved instances.
- Identify Expiring Reserved Instances: Look for the Reserved Instances that are nearing expiration (within 30 days) in the list displayed.
- Select the Reserved Instance: Click on the checkbox next to the Reserved Instance that you want to renew before expiration.
- Click on Actions: At the top of the Reserved Instances page, click on the “Actions” dropdown menu.
- Select Renew Reserved Instances: From the Actions dropdown menu, select “Renew Reserved Instances”.
- Review and Confirm: Review the details of the renewal, including the term length and payment options. Confirm that you want to renew the Reserved Instance.
- Complete the Renewal Process: Follow the on-screen instructions to complete the renewal process. You may need to provide payment information if the renewal involves additional charges.
- Verify Renewal: Once the renewal process is complete, verify that the Reserved Instance now shows an updated expiration date that is beyond the next 30 days.
Using CLI
Using CLI
To renew RDS Reserved Instances before expiration (30 days) in AWS using AWS CLI, follow these steps:Replace By following these steps, you can renew RDS Reserved Instances before expiration in AWS using the AWS CLI.
- List all the existing reserved instances to identify the ones that are expiring within the next 30 days:
- Identify the Reserved Instance that is expiring within the next 30 days and note down its Reserved Instance ID.
-
Modify the existing Reserved Instance to renew it for another term. You can do this by using the
modify-db-instance
command:
your-db-instance-id
with the DB instance identifier, your-reserved-instance-id
with the Reserved Instance ID, and new-reserved-offering-id
with the ID of the new Reserved Instance offering.- Verify that the Reserved Instance has been successfully renewed by describing the reserved instance again:
Using Python
Using Python
To remediate the misconfiguration of not renewing RDS Reserved Instances before expiration in AWS using Python, you can create a script that checks the expiration date of the reserved instances and automatically renews them if they are set to expire within the next 30 days. Here’s a step-by-step guide on how to do this:
-
Install Boto3: Make sure you have the Boto3 library installed in your Python environment. Boto3 is the AWS SDK for Python and allows you to interact with AWS services.
-
Create Python Script:
Create a Python script (e.g.,
renew_rds_reserved_instances.py
) with the following code: -
AWS Credentials:
Ensure that your AWS credentials are properly configured either through environment variables or
~/.aws/credentials
file. -
Run the Script:
Run the Python script using your preferred method (e.g.,
python renew_rds_reserved_instances.py
). The script will check all your RDS reserved instances and renew those that are set to expire within the next 30 days.