Repository navigation
Description
Problem
Redshift signs in with a database username and password only. The docs say AWS IAM authentication is not available for Redshift, unlike MySQL and PostgreSQL (databases/redshift.mdx:19), and the Redshift connection type declares no AWS sign-in fields, only ~/.pgpass and connection options (apple/TablePro/Core/Plugins/PluginMetadataRegistry+CuratedDefaults.swift:509). Teams that grant Redshift access through IAM or IAM Identity Center have to mint a temporary password by hand.
The AWS sign-in machinery already exists for RDS: AWS IAM (Profile) and AWS IAM (SSO), with assume-role chains, credential_process and the IAM Identity Center browser sign-in (connections/aws-iam.mdx:66-92).
Separately, a password command runs with no context. It gets TablePro's environment plus a few tool paths (apple/TablePro/Core/Process/CLIToolEnvironment.swift:17-25) and nothing about the connection. A command that needs the host, port, user or database, the shape aws rds generate-db-auth-token and aws redshift get-cluster-credentials both take, has to hardcode those values a second time, where they drift.
Proposed solution
- AWS IAM (Profile) and AWS IAM (SSO) on Redshift, reusing the RDS profile resolution and SSO sign-in. A provisioned cluster calls
GetClusterCredentialsWithIAM, orGetClusterCredentialswith a database user; a Serverless workgroup callsredshift-serverless GetCredentials. Sign in with the returned user and temporary password, minted per sign-in like the RDS token. - In a password command, substitute
{host},{port},{user}and{database}, shell-quoted, and export the same values asTABLEPRO_HOST,TABLEPRO_PORT,TABLEPRO_USERandTABLEPRO_DATABASE. - Let a command say how long its result lasts, and reuse the result for that long instead of running the command on every reconnect.
Done when: a Redshift connection signs in through an IAM Identity Center profile on a provisioned cluster and on Serverless, and a password command that reads {host} works across two connections with different hosts.
Alternatives considered
Run aws redshift get-cluster-credentials by hand and paste the temporary password, or hardcode the host and user in the command and keep them in sync by hand.
Platform
macOS
Related database type
N/A / General
Activity