> ## 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.

# Rds reserved instance payment pending remediation

### Triage and Remediation

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

    <AccordionGroup>
      <Accordion title="Using Console" defaultOpen="true">
        To remediate the issue of RDS Reserved Instances having a status of "Payment Pending" in AWS, you can follow these step-by-step instructions using the AWS Management Console:

        1. **Sign in to the AWS Management Console**: Go to [https://aws.amazon.com/](https://aws.amazon.com/), click on "Sign In to the Console", and enter your credentials.

        2. **Navigate to the RDS Console**: Once you are logged in, navigate to the Amazon RDS console by clicking on "Services" in the top menu bar, selecting "RDS" under the Database category.

        3. **Identify the RDS Reserved Instances with Payment Pending Status**:
           * In the RDS console, click on the "Reserved Instances" in the left-hand menu.
           * Look for the Reserved Instances with a status of "Payment Pending". These instances are the ones that need to be remediated.

        4. **Select the Reserved Instance**:
           * Click on the checkbox next to the RDS Reserved Instance with the "Payment Pending" status to select it.

        5. **Modify the Reserved Instance**:
           * Click on the "Actions" dropdown menu above the list of Reserved Instances.
           * Select "Modify Reserved Instances" from the dropdown menu.

        6. **Update the Payment Information**:
           * In the Modify Reserved Instances page, update the payment information for the selected Reserved Instance.
           * You may need to update the payment method or resolve any payment issues to ensure that the status changes from "Payment Pending" to "Active".

        7. **Save Changes**:
           * Once you have updated the payment information, click on the "Modify Reserved Instances" button to save the changes.

        8. **Verify the Status**:
           * After saving the changes, go back to the list of Reserved Instances and verify that the status of the selected Reserved Instance has changed from "Payment Pending" to "Active".

        By following these steps, you should be able to remediate the issue of RDS Reserved Instances having a status of "Payment Pending" in AWS using the AWS Management Console.

        #
      </Accordion>

      <Accordion title="Using CLI">
        To remediate the misconfiguration of RDS Reserved Instances having a status of "Payment Pending" in AWS using AWS CLI, follow these steps:

        1. List all the Reserved Instances in your AWS account to identify the one with the status "Payment Pending":

        ```bash theme={null}
        aws rds describe-reserved-db-instances
        ```

        2. Identify the Reserved Instance with the status "Payment Pending" in the output.

        3. Modify the Reserved Instance to change its status from "Payment Pending" to "Active" by using the `modify-db-instance` command:

        ```bash theme={null}
        aws rds modify-db-instance --db-instance-identifier <your-db-instance-identifier> --reserved-db-instance-id <your-reserved-instance-id> --apply-immediately
        ```

        Replace `<your-db-instance-identifier>` with the identifier of your RDS DB instance and `<your-reserved-instance-id>` with the ID of the Reserved Instance that has the status "Payment Pending".

        4. Wait for the modification to be completed. You can check the status of the Reserved Instance again using the `describe-reserved-db-instances` command:

        ```bash theme={null}
        aws rds describe-reserved-db-instances
        ```

        5. Verify that the status of the Reserved Instance has been successfully changed to "Active".

        By following these steps, you can remediate the misconfiguration of RDS Reserved Instances having a status of "Payment Pending" in AWS using the AWS CLI.
      </Accordion>

      <Accordion title="Using Python">
        To remediate the issue of RDS Reserved Instances having a status of "Payment Pending" in AWS using Python, you can follow these steps:

        1. Import the necessary Python libraries:

        ```python theme={null}
        import boto3
        ```

        2. Initialize the AWS RDS client:

        ```python theme={null}
        rds_client = boto3.client('rds')
        ```

        3. Describe all the Reserved Instances for RDS:

        ```python theme={null}
        reserved_instances = rds_client.describe_reserved_db_instances()
        ```

        4. Iterate through each Reserved Instance and check if its status is "Payment Pending":

        ```python theme={null}
        for reserved_instance in reserved_instances['ReservedDBInstances']:
            if reserved_instance['State'] == 'payment-pending':
                reserved_instance_id = reserved_instance['ReservedDBInstanceId']
                # Modify the status of the Reserved Instance to active
                rds_client.modify_reserved_db_instances(
                    ReservedDBInstanceId=reserved_instance_id,
                    ReservedDBInstancePaymentType='ALL_UPFRONT'  # You can choose the appropriate payment type
                )
        ```

        5. After running the above script, the status of the RDS Reserved Instances with "Payment Pending" should be remediated to the desired status.

        Please note that you need to have the necessary permissions to describe and modify RDS Reserved Instances in your AWS account. Also, ensure that you have the AWS SDK for Python (Boto3) installed in your environment.
      </Accordion>

      <Accordion title="Using Terraform">
        Terraform cannot change the payment or status of an RDS Reserved Instance; that state is controlled entirely by AWS billing and your payment method, and there is no Terraform resource for “aws-database-rds-ri” or RDS RI purchases.

        You must resolve this in the AWS console / billing system (e.g., update payment method, reprocess the RI purchase, or cancel/replace it) and then let Terraform continue to manage only RDS instance resources (e.g., `aws_db_instance`), not the reservations themselves.
      </Accordion>
    </AccordionGroup>
  </Tab>
</Tabs>
