More Info:
All your AWS RDS Reserved Instances (RI) should have corresponding database instances running within the same account or within any AWS accounts members of an AWS OrganizationRisk Level
LowAddress
Cost OptimisationCompliance Standards
- Cloudanix Best Practice
Triage and Remediation
- 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.
Using Terraform
Using Terraform
Terraform cannot modify or list AWS RDS Reserved Instances or create RI Marketplace listings; those operations are not exposed in the Substitute:
hashicorp/aws provider, so this check cannot be remediated via Terraform.You must use the AWS CLI or Console as in the verified fix:- To modify the Reserved Instance to match an existing DB instance class (permanent for remainder of term):
- Or to sell the unused RI on the Reserved Instance Marketplace (irreversible listing):
{{UPSTREAM_RESERVED_DB_INSTANCE_ID}}with the RI ID from the finding.{{AWS_REGION}}with the region of the RI.<NEW_INSTANCE_CLASS>with a valid RDS class in the same instance family/region as the RI.{{DB_INSTANCE_COUNT}}with the number of instances covered by the RI you want to sell.<MONTHS_REMAINING>and<PRICE_IN_USD>per your desired listing.
terraform plan will show no changes related to RDS Reserved Instances. You must verify via aws rds describe-reserved-db-instances or the RDS Console that the RI is now matched to a running DB instance or listed on the RI Marketplace.
