Redshift is a supported plugin for the database secrets engine. This
plugin generates database credentials dynamically based on configured roles for
the AWS Redshift database service, and also supports Static
Roles.
See the database secrets engine docs for
more information about setting up the database secrets engine.
Configure a role that maps a name in Vault to a SQL statement to execute which
creates the database credential:
$ vault write database/roles/my-role \
db_name=my-redshift-database \
creation_statements="CREATE USER \"{{name}}\" WITH PASSWORD '{{password}}' VALID UNTIL '{{expiration}}'; \
GRANT SELECT ON ALL TABLES IN SCHEMA public TO \"{{name}}\";" \
default_ttl="1h" \
max_ttl="24h"
Success! Data written to: database/roles/my-role
$ vault write database/roles/my-role \ db_name=my-redshift-database \ creation_statements="CREATE USER \"{{name}}\" WITH PASSWORD '{{password}}' VALID UNTIL '{{expiration}}'; \ GRANT SELECT ON ALL TABLES IN SCHEMA public TO \"{{name}}\";" \ default_ttl="1h" \ max_ttl="24h"Success! Data written to: database/roles/my-role