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 Troubleshoot AWS CLI errors. 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:
-
To check the pending maintenance of an Amazon RDS instance, run the following describe-pending-maintenance-actions command:
Note: Replace example-resource-identifier with the resource identifier of your instance.
aws rds describe-pending-maintenance-actions --resource-identifier example-resource--identifier
Example output:
{
"PendingMaintenanceActions": [
{
"ResourceIdentifier": "arn:aws:rds:ap-southeast-2:123456789:db:testsnapshot",
"PendingMaintenanceActionDetails": [
{
"Action": "system-update",
"OptInStatus": "next-maintenance",
"CurrentApplyDate": "2024-07-10T12:51:00+00:00",
"Description": "New Operating System update is available"
}
]
}
]
}
-
To cancel the pending maintenance actions of an Amazon RDS instance, run the following apply-pending-maintenance-action command:
Note: Replace example-resource-identifier with the resource identifier of your instance.
aws rds apply-pending-maintenance-action --resource-identifier example-resource-identifier --apply-action system-update --opt-in-type undo-opt-in
Example output:
{
"ResourcePendingMaintenanceActions": {
"ResourceIdentifier": "arn:aws:rds:ap-southeast-2:375292631967: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, an 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:
-
To identify the pending modification of an Amazon RDS instance class, use the Amazon RDS console or run the describe-db-instances command. Then, check the PendingModifiedValues field.
Note: Replace example-instance-identifier with your DB instance identifier.
aws rds describe-db-instances --db-instance-identifier example-instance-identifier --query 'DBInstances[*].[DBInstanceIdentifier, PendingModifiedValues]'
Example output:
"PendingModifiedValues": {t3.small}
-
To cancel the pending modification of an Amazon RDS instance class, run the modify-db-instance command:
Note: Replace example-instance-identifier with your DB instance identifier.
aws rds modify-db-instance --db-instance-identifier example-instance-identifier --db-instance-class db.t3.micro --apply-immediately
-
Confirm that the pending modification was cancelled:
Note: Replace example-instance-identifier with your DB instance identifier.
aws rds describe-db-instances --db-instance-identifier example-db-instance-identifier --query 'DBInstances[*].[DBInstanceIdentifier, PendingModifiedValues]'
Example output:
"PendingModifiedValues": {}
For more information, see View pending maintenance and Schedule modification settings.