Skip to content

How do I cancel pending maintenance in Amazon RDS for PostgreSQL?

3 minute read
0

I want to cancel pending maintenance action in Amazon Relational Database Service (Amazon RDS) for PostgreSQL.

Resolution

Note: If you receive errors when you run AWS Command Line Interface (AWS CLI) commands, then see Troubleshooting errors for the AWS CLI. Also, make sure that you're using the most recent AWS CLI version.

Before you begin, make sure that you have the AWS CLI installed and configured with the correct permissions. Also, make sure that you have the correct permissions for the Amazon RDS instances that you want to cancel pending maintenance for.

View the pending modifications of the next maintenance window

To view the pending modifications of the next maintenance window, run the describe-db-instances command, and then check the PendingModifiedValues field.

Cancel your pending maintenance in Amazon RDS for PostgreSQL

Complete the following steps:

  1. To check the pending maintenance of an Amazon RDS instance, run the following describe-pending-maintenance-actions command:

    aws rds describe-pending-maintenance-actions --resource-identifier RESOURCE_IDENTIFIER

    Note: Replace RESOURCE_IDENTIFIER with the resource identifier of your instance.

    Example output:

    {
        "PendingMaintenanceActions": [
            {
                "ResourceIdentifier": "arn:aws:rds:ap-southeast-2:123456789012:db:testsnapshot",
                "PendingMaintenanceActionDetails": [
                    {
                        "Action": "system-update",
                        "OptInStatus": "next-maintenance",
                        "CurrentApplyDate": "2024-07-10T12:51:00+00:00",
                        "Description": "New Operating System update is available"
                    }
                ]
            }
        ]
    }
  2. To cancel the pending maintenance actions of an Amazon RDS instance, run the following apply-pending-maintenance-action command:

    aws rds apply-pending-maintenance-action --resource-identifier RESOURCE_IDENTIFIER --apply-action system-update --opt-in-type undo-opt-in

    Note: Replace RESOURCE_IDENTIFIER with the resource identifier of your instance.

    Example output:

    {
        "ResourcePendingMaintenanceActions": {
            "ResourceIdentifier": "arn:aws:rds:ap-southeast-2:111122223333:db:testsnapshot",
            "PendingMaintenanceActionDetails": [
                {
                    "Action": "system-update",
                    "Description": "New Operating System update is available"
                }
            ]
        }
    }

    Note: In the previous command, apply-action defines the pending action to apply to the resource. Valid values for apply-action are system-update, db-upgrade, hardware-maintenance, and ca-certificate-rotation. The opt-in-type is a value that specifies the type of opt-in request or undoes an opt-in request. Valid values for opt-in-type are immediate, next-maintenance, or undo-opt-in. An opt-in request of type immediate can't be undone.

Cancel a pending modification of an Amazon RDS instance class

Complete the following steps:

  1. To identify the pending modification of an Amazon RDS instance class, use the Amazon Aurora and RDS console or run the describe-db-instances command. Then, check the PendingModifiedValues field.

    aws rds describe-db-instances --db-instance-identifier DB_INSTANCE_IDENTIFIER --query 'DBInstances[*].[DBInstanceIdentifier, PendingModifiedValues]'

    Note: Replace DB_INSTANCE_IDENTIFIER with your DB instance identifier. Example output:

    "PendingModifiedValues": {t3.small}
  2. To cancel the pending modification of an Amazon RDS instance class, run the modify-db-instance command:

    aws rds modify-db-instance --db-instance-identifier DB_INSTANCE_IDENTIFIER --db-instance-class db.t3.micro --apply-immediately

    Note: Replace DB_INSTANCE_IDENTIFIER with your DB instance identifier.

  3. Confirm that the pending modification is no longer pending:

    aws rds describe-db-instances --db-instance-identifier DB_INSTANCE_IDENTIFIER --query 'DBInstances[*].[DBInstanceIdentifier, PendingModifiedValues]'

    Note: Replace DB_INSTANCE_IDENTIFIER with your DB instance identifier. Example output:

    "PendingModifiedValues": {}

For more information, see View pending maintenance and Schedule modification settings.

AWS OFFICIALUpdated 2 years ago