Add users to DocumentDB via constructor [@aws-cdk/aws-docdb]
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 4.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 83
Description
### Feature description
Ability to create DocumentDB users via `DatabaseCluster` constructor
### Use Case
The main reason is separation of concerns. Master user has root access, it could be too dangerous for clients to use root user. We would like to have user with read/write rights only for database clients.
### Proposed Solution
Add additional parameter `users` to `DatabaseCluster` constructor. Example of usage:
```
import { DatabaseCluster } from '@aws-cdk/aws-docdb';
new DatabaseCluster(this, 'Cluster Name', {
masterUser: {
username: 'super-power'
},
users: [{
username: 'api',
pwd: 'maga2020',
db: 'admin',
roles: [{ db: 'db-name', role: 'readWrite' }]
}]
);
```
Parameters name and structure of object inspired by [mongo shell documentation](https://docs.mongodb.com/manual/reference/method/db.createUser/), I don't have strong preference related to naming or structure.
### This is a :rocket: Feature Request
Contributor guide
Research direction
Start at the DatabaseCluster constructor in the @aws-cdk/aws-docdb package and review its existing masterUser configuration. Define how the proposed users and roles structure should map to DocumentDB, then verify that clients can receive non-root read/write access while the master user remains separate.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, typescript
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100