Manage a login

Set or remove a login's expiry, rotate its password, or revoke it.

Last updated 18 November 2026View as Markdown

Replace ewdb-0123456789ab with your database's id and login-id with the login's id from GET /rds/api/instances/{id}/logins.

Prerequisites

  • rds:ModifyDBLogin for the expiry, rds:RotateDBLoginPassword to rotate, rds:DeleteDBLogin to revoke; rds:DescribeDBLogins to see the Logins tab.
  • The database is available. Otherwise the console's buttons are disabled and the API answers 409 This database is <status>. Logins can be changed once it is available.
  • In the console, also rds:DescribeDBInstances to open the database's page (without it the page is not found).

Set or remove the expiry

  1. Open the database, then choose Logins.
  2. On the login's row, choose Expiry.
  3. Choose 1 day, 7 days, 30 days (the default), 90 days or 1 year, then Set expiry. On a login that has an expiry, Remove expiry clears it. An exact date is set through the CLI, the API or Terraform.

The expiry is the role's VALID UNTIL, any time from five minutes to two years ahead. After that time Postgres refuses the password on both ports. Sessions that are still open are ended within five minutes. An expiry outside that window is refused with 400 The expiry must be at least five minutes from now. or The expiry can be at most two years from now.; to cut someone off now, revoke the login. An expired login stays listed, marked expired, until you revoke it or give it a new expiry.

Rotate the password

  1. On the login's row, choose Rotate.
  2. Choose Rotate password, or Rotate and end sessions to also end the sessions the old password opened.

The new password is filed as a new version of the same secret. The person who could reveal the old password reveals the new one. The old password is refused at the next connection, and sessions it opened keep running unless you end them. If the database refuses the new password, the secret goes back to the previous version and the old password keeps working.

Revoke the login

  1. On the login's row, choose Revoke.
  2. Choose Revoke to confirm.

Result

Revoking ends the login's open sessions, drops its role (anything it owns in the database's own database goes to the master user) and deletes its secret. A role already gone from the server is removed from the list with a warning. Every change is on Activity (phase logins).

If a change is refused

  • 409 The role “alice” is not on the server any more. Revoke the login and create it again. (expiry or rotation).
  • 409 The role “alice” on the server is not the one this login created, so it was left alone.
  • 409 The organization has no enabled encryption key, so the new password could not be filed in Secrets. (rotation).
Did this page help you?