Triage and Remediation
Remediation
Using Console
Using Console
To remediate the misconfiguration of RDS Reserved Instances (RIs) not having corresponding DB instances in AWS, you can follow these steps using the AWS Management Console:
-
Identify the Unused RDS Reserved Instances:
- Go to the AWS Management Console and navigate to the RDS service.
- Click on “Reserved Instances” in the left-hand menu to view all the reserved instances.
- Look for RDS Reserved Instances that do not have corresponding active DB instances.
-
Verify the Status of the DB Instances:
- Check the status of the DB instances associated with the RDS Reserved Instances. Ensure that they are active and running.
-
Associate RDS RIs with DB Instances:
- If you find any RDS Reserved Instances that are not associated with any active DB instances, you can associate them by following these steps:
- Select the unused RDS Reserved Instance.
- Click on the “Actions” dropdown menu and select “Modify Reserved Instances”.
- In the “Modify Reserved Instances” wizard, choose the active DB instance that you want to associate with the RI.
- Click on “Add DB Instance” and select the appropriate DB instance.
- Review the changes and click on “Modify Reserved Instances” to associate the RI with the DB instance.
- If you find any RDS Reserved Instances that are not associated with any active DB instances, you can associate them by following these steps:
-
Verify the Association:
- After associating the RDS Reserved Instances with the corresponding DB instances, verify that the association is successful.
- Check the Reserved Instances dashboard to ensure that all RIs now have corresponding active DB instances.
Using CLI
Using CLI
To remediate the misconfiguration where RDS Reserved Instances (RIs) do not have corresponding DB instances in AWS RDS using AWS CLI, follow these steps:
-
Identify the unassociated RDS Reserved Instances:
Run the following AWS CLI command to list all the RDS Reserved Instances:
-
Identify the DB instances associated with each RDS Reserved Instance:
Run the following AWS CLI command to list all the DB instances in your AWS account:
- Compare the RDS Reserved Instances with the DB instances to identify any unassociated RIs.
-
Associate the unassociated RDS Reserved Instances with the corresponding DB instances:
Run the following AWS CLI command to modify the RDS Reserved Instance to associate it with a specific DB instance:
Replace
<RI_ID>
with the ID of the unassociated RDS Reserved Instance and<DB_INSTANCE_ID>
with the ID of the corresponding DB instance. -
Verify the association:
Run the following AWS CLI command to describe the RDS Reserved Instance and verify that it is now associated with the correct DB instance:
Replace
<RI_ID>
with the ID of the RDS Reserved Instance.
Using Python
Using Python
To remediate the misconfiguration of RDS Reserved Instances (RIs) not having corresponding DB instances in AWS using Python, you can follow these steps:
- List all the RDS Reserved Instances and DB Instances using the AWS SDK for Python (Boto3):
- Create a dictionary mapping the DB Instance IDs to their corresponding RIs:
- Identify the RIs without corresponding DB Instances and release them:
- Optionally, you can also create new RIs for the DB Instances that do not have corresponding RIs:
- Run the Python script to remediate the misconfiguration of RDS RIs not having corresponding DB instances in AWS.