Amazon Redshift will no longer support the use of Python UDFs after June 30, 2026.
We will start enforcing it in phases. For more information on the details of Python end of life
and migration options, see the
blog post
Federating individual users with SQL
You can persistently bind an individual database user to an IdP user's propagated IAM identity, regardless of the account or resource identity federation mode. Use this approach to pilot selected users or move an existing user to IdP user sign-in.
This approach applies to clusters and workgroups that don't have an Amazon Redshift application
registered with IAM Identity Center. When an Amazon Redshift application is registered, an IdP user who
signs in with trusted identity propagation for IAM is mapped to the IAM Identity Center user
<namespace>:<user-name>, and bindings created with
FEDERATION aren't used.
Syntax
CREATE USER name [ WITH ] [ option [ ... ] ] FEDERATION { WITH GROUPS | WITHOUT GROUPS }; ALTER USER name FEDERATION { WITH GROUPS | WITHOUT GROUPS }; ALTER USER name RESET FEDERATION;
For CREATE USER, FEDERATION is one trailing clause after the
password and other user options. For ALTER USER, the federation form is a
standalone statement and can't be combined with other options.
Without group roles
FEDERATION WITHOUT GROUPS binds the user to the IdP user whose identity exactly matches the user name. The session
receives the user's permissions, stored role memberships, and owned objects. IAM Identity
Center group roles apply only when the effective resource mode is
Federate users and groups.
With group roles
FEDERATION WITH GROUPS binds the user to the IdP user and enables group roles in every identity federation mode.
For the session only, Amazon Redshift adds each eligible existing role whose name exactly matches one of
the IdP user's IAM Identity Center groups. Trusted identity propagation for IAM never
creates group roles.
Remove a persistent binding
RESET FEDERATION removes the persistent binding without changing the user's password, grants, role
memberships, or owned objects.
-
Under Default, the IdP user's next sign-in uses the IAM role user when one exists and is otherwise rejected.
-
Under Federate users or Federate users and groups, the same-named user is linked to the IdP user again on the next sign-in.
-
Use
FEDERATION WITHOUT GROUPS, notRESET FEDERATION, when the goal is to keep the binding but stop per-user group enablement. -
If the user isn't bound,
RESET FEDERATIONsucceeds and changes nothing. -
If the user is bound to another identity provider,
RESET FEDERATIONfails with an error. The other binding isn't changed.
Usage notes
-
ALTER USER ... FEDERATIONandRESET FEDERATIONrequire superuser orALTER USERprivilege.CREATE USER ... FEDERATIONrequiresCREATE USERprivilege. -
Run each federation statement outside a transaction block and stored procedure. After a user is federated, later
ALTER USERandDROP USERoperations for that user also require top-level execution. -
The user name is the identity, and matching is exact and case-sensitive. Unquoted names are converted to lowercase, so quote names that contain uppercase letters or characters such as
@or-. -
A federated name must be valid UTF-8, at most 120 bytes, and contain no colon, control character, or leading or trailing whitespace.
-
One identity can be persistently bound to only one user.
-
Superusers and password users can be federated. Because a superuser can't have
PASSWORD DISABLE, federate a superuser withALTER USER ... FEDERATIONand keep its password. To federate a superuser withCREATE USER, useCREATE USER ... PASSWORD '<password>' CREATEUSER FEDERATION .... Only a superuser can create a superuser. -
Users with a reserved namespace prefix, data-sharing users, and users owned by another identity provider can't be federated.
-
FEDERATIONcan't be combined withEXTERNALID. -
A password session doesn't carry the user's identity downstream. It can receive IAM Identity Center group roles when the user or effective resource mode enables groups, except when the user is a superuser or a member of a reserved
sys:role, or when an Amazon Redshift application is registered with IAM Identity Center for the cluster or workgroup. -
Renaming a bound user moves the binding to the new name. The old identity is evaluated independently at its next sign-in.
-
A connected session keeps its database identity. Group roles can change through periodic refresh.
Examples
Create a password-disabled user with per-user groups.
CREATE USER "alice@example.com" PASSWORD DISABLE FEDERATION WITH GROUPS; GRANT SELECT ON sales.orders TO "alice@example.com";
Persistently bind an existing user without per-user groups.
ALTER USER "alice@example.com" FEDERATION WITHOUT GROUPS;
Enable per-user groups.
ALTER USER "alice@example.com" FEDERATION WITH GROUPS;
Remove the persistent binding.
ALTER USER "alice@example.com" RESET FEDERATION;
Moving existing users
For an existing user whose name matches the IdP user, use
ALTER USER ... FEDERATION WITHOUT GROUPS. Setting the resource mode to
Federate users links the same-named user to the IdP user on their first
sign-in.
For a user whose name differs, rename it to the identity sent by the IdP, and then federate it.
ALTER USER "alice" RENAME TO "alice@example.com"; ALTER USER "alice@example.com" FEDERATION WITHOUT GROUPS;
Permissions held only by a shared IAM role user don't automatically apply when an IdP user signs in as themselves. Move shared access to database roles or IAM Identity Center group roles before changing the sign-in behavior.