Skip to content

Commit e35ea51

Browse files
committed
Update README with SecretsManager details
1 parent 14029b3 commit e35ea51

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,36 @@ Support for this can be enabled my making your Cloudwatch Event look like this.
102102
If you supply `USE_IAM_AUTH` with a value of `true`, the `PGPASSWORD` var may be omitted in the CloudWatch event.
103103
If you still provide it, it will be ignored.
104104

105+
#### SecretsManager-based Postgres authentication
106+
107+
If you prefer to not send DB details/credentials in the event parameters, you can store such details in SecretsManager and just provide the SecretId, then the function will fetch your DB details/credentials from the secret value.
108+
109+
NOTE: the execution role for the Lambda function must have access to GetSecretValue for the given secret.
110+
111+
Support for this can be enabled by setting the SECRETS_MANAGER_SECRET_ID, so your Cloudwatch Event looks like this:
112+
113+
```json
114+
115+
{
116+
"SECRETS_MANAGER_SECRET_ID": "my/secret/id",
117+
"S3_BUCKET" : "db-backups",
118+
"ROOT": "hourly-backups"
119+
}
120+
```
121+
122+
If you supply `SECRETS_MANAGER_SECRET_ID`, you can ommit the 'PG*' keys, and they will be fetched from your SecretsManager secret value instead with the following mapping:
123+
124+
| Secret Value | PG-Key |
125+
| ------------- | ------------- |
126+
| username | PGUSER |
127+
| password | PGPASSWORD |
128+
| dbname | PGDATABASE |
129+
| host | PGHOST |
130+
| port | PGPORT |
131+
132+
133+
You can provide overrides in your event to any PG* keys as event parameters will take precedence over secret values.
134+
105135
## Developer
106136

107137
#### Bundling a new `pg_dump` binary

0 commit comments

Comments
 (0)