Add net.clojars.savya/psql-clj-aws to authenticate to RDS/Aurora with a
short-lived IAM token, not a static password. iam-spec returns a normal spec
with the token as :password and sslmode=require:
(require '[psql.aws :as aws]
'[psql.pool :as pool]
'[next.jdbc :as jdbc])
(def spec (aws/iam-spec :host "mydb.abc123.us-east-1.rds.amazonaws.com"
:user "appuser"
:dbname "app"
:region "us-east-1"))
(jdbc/execute! spec ["SELECT 1"])
;; or pool it: (pool/pooled-db spec {})
The token is signed locally with the default AWS credential chain. No API call is made. Pass :credentials-provider to override the chain. Tokens last about 15 minutes. Refresh the spec and rebuild the pool at intervals.
Can you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |