Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/guidesmiths/pg-microuser
A container for creating postgres microservice user accounts
https://github.com/guidesmiths/pg-microuser
Last synced: about 1 month ago
JSON representation
A container for creating postgres microservice user accounts
- Host: GitHub
- URL: https://github.com/guidesmiths/pg-microuser
- Owner: guidesmiths
- Created: 2017-02-28T16:59:27.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-02T15:44:39.000Z (almost 7 years ago)
- Last Synced: 2024-12-18T09:45:24.480Z (about 1 month ago)
- Language: Shell
- Size: 5.86 KB
- Stars: 2
- Watchers: 11
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# pg-microuser
Creates PostgresSQL roles and schemas for microservices## Create Role
```
# Create gs_admin_ro role which will have read only access to all microservice schemas
docker run -it \
-e PGHOST=myhost \
-e PGDATABASE=mydb \
-e PGUSER=superuser \
-e PGPASSWORD=supersecret \
quay.io/guidesmiths/pg-microuser create-role gs_admin_ro reallysecret# Create gs_admin_rw role which will have full access to all microservice schemas
docker run -it \
-e PGHOST=myhost \
-e PGDATABASE=mydb \
-e PGUSER=superuser \
-e PGPASSWORD=supersecret \
quay.io/guidesmiths/pg-microuser create-role gs_admin_rw reallyreallysecret# Create gs_svc_1 role which will have full access to a single schema
docker run -it \
-e PGHOST=myhost \
-e PGDATABASE=mydb \
-e PGUSER=superuser \
-e PGPASSWORD=supersecret \
quay.io/guidesmiths/pg-microuser create-role gs_svc_1 secret1
```## Create Schema
```
# Create a schema for gs_svc_1 role and grant appropriate access to the gs_admin_ro and gs_admin_rw
docker run -it
-e PGHOST=myhost \
-e PGDATABASE=mydb \
-e PGUSER=superuser \
-e PGPASSWORD=supersecret \
quay.io/guidesmiths/pg-microuser create-schema gs_svc_1 gs_admin_ro gs_admin_rw
```## Create Both
Wrapper for create-role and create-schema
```
docker run -it
-e PGHOST=myhost \
-e PGDATABASE=mydb \
-e PGUSER=superuser \
-e PGPASSWORD=supersecret \
quay.io/guidesmiths/pg-microuser create-both gs_svc_1 secret1 gs_admin_ro gs_admin_rw
```