> ## Documentation Index
> Fetch the complete documentation index at: https://cloudanix.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Dms auto minor version upgrade check remediation

### Triage and Remediation

<Tabs>
  <Tab title="Remediation">
    ### Remediation

    <AccordionGroup>
      <Accordion title="Using Console" defaultOpen="true">
        To remediate the misconfiguration of enabling DMS automatic minor version upgrades for AWS RDS using the AWS Management Console, follow these step-by-step instructions:

        1. **Login to AWS Console**: Go to the AWS Management Console ([https://aws.amazon.com/console/](https://aws.amazon.com/console/)) and log in using your credentials.

        2. **Navigate to RDS Service**: Once you are logged in, navigate to the RDS service by typing "RDS" in the search bar and selecting the RDS service from the dropdown.

        3. **Select the RDS Instance**: In the RDS dashboard, select the RDS instance for which you want to disable DMS automatic minor version upgrades by clicking on its name.

        4. **Modify the RDS Instance**: In the RDS instance details page, click on the "Modify" button located at the top of the page.

        5. **Modify DMS Automatic Minor Version Upgrades Setting**: Scroll down to the "Backup" section of the modify instance page. Look for the "Enable automatic minor version upgrades" option and uncheck the  checkbox next to it to disable automatic minor version upgrades for DMS.

        6. **Review and Apply Changes**: Review the other settings to ensure they are correct. Once you have unchecked the "Enable automatic minor version upgrades" option, scroll down and click on the "Continue" button.

        7. **Apply Changes**: Review the summary of changes and click on the "Modify DB Instance" button to apply the changes.

        8. **Monitor the Modification**: AWS will start applying the changes to the RDS instance. You can monitor the progress of the modification in the RDS console. Once the modification is complete, the DMS automatic minor version upgrades will be disabled for the RDS instance.

        By following these steps, you will be able to remediate the misconfiguration of enabling DMS automatic minor version upgrades for anAWS RDS instance using the AWS Management Console.

        #
      </Accordion>

      <Accordion title="Using CLI">
        To remediate the misconfiguration of having DMS Automatic Minor Version Upgrades enabled for an AWS RDS instance using AWS CLI, you can follow these steps:

        1. **Disable DMS Automatic Minor Version Upgrades**: You can disable DMS Automatic Minor Version Upgrades for an RDS instance by modifying the DB instance with the AWS CLI. Here's the command to disable it:

           ```bash theme={null}
           aws rds modify-db-instance --db-instance-identifier your-db-instance-name --no-auto-minor-version-upgrade
           ```

           Replace `your-db-instance-name` with the actual identifier of your RDS instance.

        2. **Verify the Change**: You can verify that the modification was successful by describing the RDS instance and checking the `AutoMinorVersionUpgrade` parameter. Here's the command to describe the RDS instance:

           ```bash theme={null}
           aws rds describe-db-instances --db-instance-identifier your-db-instance-name
           ```

           Ensure that the `AutoMinorVersionUpgrade` parameter is set to `false` after the modification.

        3. **Monitor the RDS Instance**: After making the change, monitor the RDS instance for any impact or issues resulting from the modification. Ensure that the instance is running smoothly without any disruptions.

        By following these steps, you can remediate the misconfiguration of having DMS Automatic Minor Version Upgrades enabled for an AWS RDS instance using AWS CLI.
      </Accordion>

      <Accordion title="Using Python">
        To remediate the misconfiguration of enabling DMS Automatic Minor Version Upgrades for AWS RDS using Python, you can follow these steps:

        1. **Install the Boto3 library**: Boto3 is the AWS SDK for Python, which allows Python developers to write software that makes use of services like Amazon S3 and Amazon EC2. You can install it using pip:

        ```bash theme={null}
        pip install boto3
        ```

        2. **Write a Python script** to update the DMS Automatic Minor Version Upgrades setting for your RDS instance. Here is an example script that uses Boto3 to disable the automatic minor version upgrades:

        ```python theme={null}
        import boto3

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

        # Specify the RDS instance identifier
        instance_identifier = 'your_rds_instance_identifier'

        # Disable automatic minor version upgrades for the specified RDS instance
        response = client.modify_db_instance(
            DBInstanceIdentifier=instance_identifier,
            AutoMinorVersionUpgrade=False
        )

        # Print the response for verification
        print(response)
        ```

        3. **Run the Python script**: Save the above script in a file, e.g., `remediate_dms_auto_minor_upgrade.py`, and run it using Python:

        ```bash theme={null}
        python remediate_dms_auto_minor_upgrade.py
        ```

        4. **Verify the remediation**: After running the script, check the AWS Management Console or use the AWS CLI to verify that the DMS Automatic Minor Version Upgrades setting has been successfully disabled for the specified RDS instance.

        By following these steps, you can remediate the misconfiguration of enabling DMS Automatic Minor Version Upgrades for an AWS RDS instance using Python and Boto3.
      </Accordion>

      <Accordion title="Using Terraform">
        ```hcl theme={null}
        resource "aws_db_instance" "THIS_DB" {
          identifier = "YOUR_DB_IDENTIFIER"

          engine               = "mysql"                       # replace as needed
          instance_class       = "db.t3.micro"                # replace as needed
          allocated_storage    = 20                           # replace as needed
          username             = "YOUR_MASTER_USERNAME"
          password             = "YOUR_MASTER_PASSWORD"
          db_subnet_group_name = aws_db_subnet_group.DB_SUBNET.name
          vpc_security_group_ids = [
            aws_security_group.DB_SG.id,
          ]

          # Enable automatic minor version upgrades
          auto_minor_version_upgrade = true
        }
        ```

        For Aurora or other RDS clusters, set it on each cluster instance:

        ```hcl theme={null}
        resource "aws_rds_cluster_instance" "THIS_CLUSTER_INSTANCE" {
          identifier         = "YOUR_INSTANCE_IDENTIFIER"
          cluster_identifier = aws_rds_cluster.THIS_CLUSTER.id
          instance_class     = "db.r6g.large"                 # replace as needed
          engine             = aws_rds_cluster.THIS_CLUSTER.engine

          # Enable automatic minor version upgrades
          auto_minor_version_upgrade = true
        }
        ```

        This change is an in-place modification and does not force replacement of the instance; RDS will then automatically apply supported minor version updates during the configured maintenance window.

        Verification: `terraform plan` should show `auto_minor_version_upgrade` changing from `false` (or `null`) to `true` on the affected `aws_db_instance` and/or `aws_rds_cluster_instance` resources, with an `in-place update` (no `-/+` replacement).
      </Accordion>
    </AccordionGroup>
  </Tab>
</Tabs>
