Skip to content

Commit

Permalink
fix: update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
joel authored and joel committed Jan 23, 2024
1 parent 7dbfaf4 commit a0fc2dd
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions docs/cognito.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[AWS Cognito](https://docs.aws.amazon.com/cognito/latest/developerguide/what-is-amazon-cognito.html) is an identity platform for web and mobile apps.

The Cognito Wrappers allows you to read data from your Cognito Userpool within your Postgres database.
The Cognito wrapper allows you to read data from your Cognito Userpool within your Postgres database.

## Preparation

Expand All @@ -20,9 +20,16 @@ create foreign data wrapper cognito_wrapper

### Secure your credentials (optional)

By default, Postgres stores FDW credentials inide `pg_catalog.pg_foreign_server` in plain text. Anyone with access to this table will be able to view these credentials. Wrappers is designed to work with [Vault](https://supabase.com/docs/guides/database/vault), which provides an additional level of security for storing credentials. We recommend using Vault to store your credentials.

By default, Postgres stores FDW credentials inide `pg_catalog.pg_foreign_server` in plain text. Anyone with access to this table will be able to view these credentials. Wrappers are designed to work with [Vault](https://supabase.com/docs/guides/database/vault), which provides an additional level of security for storing credentials. We recommend using Vault to store your credentials.

```sql
insert into vault.secrets (name, secret)
values (
'vault_secret_access_key',
'<secret access key>'
)
returning key_id;
```

### Connecting to Cognito

Expand Down Expand Up @@ -79,11 +86,8 @@ options (

The full list of foreign table options are below:

- `aws_access_key_id`: Obtained from AWS
- `aws_secret_access_key`: Obtained from AWS
- `region`: Region where your `UserPool` is located (e.g. `ap-southeast-1`)
- `endpoint_url`: (Optional): URL when running locally.
- `user_pool_id`: Correlate with the identifier for `UserPool`
- `object`: type of object we are querying. For now, only `users` is supported


## Query Pushdown Support

Expand Down

0 comments on commit a0fc2dd

Please sign in to comment.