Skip to main content

More Info:

It is recommended that RDS database instances use instance types from a limited set based on the database workload deployed.

Risk Level

Medium

Address

Operational Maturity, Reliability, Security

Compliance Standards

CBP

Triage and Remediation

Remediation

Using Console

To remediate the misconfiguration of an RDS instance being of the desired type in AWS, you can follow these steps using the AWS Management Console:
  1. Login to AWS Console: Go to the AWS Management Console (https://aws.amazon.com/) and login using your credentials.
  2. Navigate to RDS Service: Click on the “Services” dropdown in the top navigation bar and select “RDS” under the Database category.
  3. Identify the RDS Instance: In the RDS dashboard, locate the RDS instance that needs to be remediated in terms of its type.
  4. Modify the Instance: Select the RDS instance by clicking on its name. In the instance details page, click on the “Modify” button at the top.
  5. Choose Instance Type: In the Modify DB Instance window, scroll down to the “DB Instance Class” section. Here, you can select the desired instance type from the dropdown list.
  6. Confirm and Apply Changes: After selecting the desired instance type, scroll down to the bottom of the page and click on the “Continue” button. Review the summary of changes and click on the “Modify DB Instance” button to apply the changes.
  7. Monitor the Modification: The modification process will start, and you can monitor the progress in the RDS dashboard. Once the modification is completed, the RDS instance will be of the desired type.
By following these steps, you can remediate the misconfiguration of an RDS instance being of the desired type in AWS using the AWS Management Console.

To remediate the misconfiguration of an RDS instance not being of the desired type in AWS using AWS CLI, follow these steps:
  1. Identify the current instance type: Run the following AWS CLI command to describe the RDS instance and note down the current instance type:
    aws rds describe-db-instances --db-instance-identifier <your-rds-instance-id>
    
  2. Choose the desired instance type: Determine the desired instance type that you want to change the RDS instance to. You can refer to the AWS documentation for available RDS instance types.
  3. Modify the RDS instance: Use the following AWS CLI command to modify the RDS instance to the desired instance type:
    aws rds modify-db-instance --db-instance-identifier <your-rds-instance-id> --db-instance-class <desired-instance-type> --apply-immediately
    
  4. Monitor the modification: Monitor the modification progress by running the following command:
    aws rds describe-db-instances --db-instance-identifier <your-rds-instance-id>
    
  5. Verify the instance type: Once the modification is completed, verify that the RDS instance is now of the desired type by running the describe command again:
    aws rds describe-db-instances --db-instance-identifier <your-rds-instance-id>
    
By following these steps, you can remediate the misconfiguration of an RDS instance not being of the desired type in AWS using AWS CLI.
To remediate the misconfiguration of an RDS instance not being of the desired type in AWS using Python, you can use the AWS SDK for Python (Boto3) to modify the instance type. Here are the step-by-step instructions:
  1. Install Boto3: Before you can start using Boto3 in Python, you need to install it. You can install it using pip:
pip install boto3
  1. Configure AWS Credentials: Make sure you have your AWS credentials configured either through environment variables, AWS CLI, or IAM roles.
  2. Write Python script to modify RDS instance type: Create a Python script with the following code to modify the RDS instance type:
import boto3

# Initialize the RDS client
client = boto3.client('rds')

# Define the RDS instance identifier and the desired instance class
instance_identifier = 'your_rds_instance_identifier'
desired_instance_class = 'db.t2.large'  # Replace with the desired instance class

# Modify the RDS instance to the desired instance class
response = client.modify_db_instance(
    DBInstanceIdentifier=instance_identifier,
    DBInstanceClass=desired_instance_class,
    ApplyImmediately=True
)

print(f"RDS instance {instance_identifier} is being modified to {desired_instance_class}...")

# Wait for the modification to complete
client.get_waiter('db_instance_modified').wait(DBInstanceIdentifier=instance_identifier)

print(f"RDS instance {instance_identifier} has been successfully modified to {desired_instance_class}.")
  1. Replace the placeholders: Replace your_rds_instance_identifier with the actual RDS instance identifier and db.t2.large with the desired instance class.
  2. Run the Python script: Save the Python script and run it. It will modify the RDS instance to the desired instance type.
By following these steps, you can remediate the misconfiguration of an RDS instance not being of the desired type in AWS using Python and Boto3.

Additional Reading: