Skip to content

Commit 0205f55

Browse files
authored
fix: Avoid picking hashicorp/vault provider (#4)
Signed-off-by: Yoan Blanc <yblanc@edgelab.ch>
1 parent 37da693 commit 0205f55

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,29 @@ In particular:
88
- It creates a "owner" role, [that owns the database (in PostgreSQL parlance)](https://www.postgresql.org/docs/current/ddl-priv.html) and have all the permissions there.
99
- It creates a set of default roles that can be assumed when working on the database:
1010

11-
- A "read-only" role `${DBNAME}_ro`, that is only able to read objects
11+
- A "read-only" role `${DBNAME}_ro`, that is only able to read objects;
1212
- A "read-write" role `${DBNAME}_rw`, that is only able to write into that database, but not create objects.
1313

1414
These roles can be assumed by developers or operators, when they have been granted the right to do so. These persons then have automatically the associated rights on that database.
1515

16+
- It creates a set of Vault policies (when `vault_backend_path` is provided).
17+
18+
- `${vault_backend_path}/${DB_NAME}`, that obtain credentials for the owner;
19+
- `${vault_backend_path}/${DB_NAME}_ro`, that obtains credentials for the `${DB_NAME}_ro` role;
20+
- `${vault_backend_path}/${DB_NAME}_rw`, that obtains credentials for the `${DB_NAME}_rw` role.
21+
22+
1623
## Usage
1724

1825
```hcl
1926
module "foo" {
20-
source = "git@github.com:edgelaboratories/terraform-postgresql-db?ref=v0.1.0"
27+
source = "git@github.com:edgelaboratories/terraform-postgresql-db?ref=v0.3.1"
2128
2229
database = "foo"
2330
owner = "admin"
2431
owner_password = "admin"
32+
33+
vault_backend_path = "postgresql/elmer"
34+
vault_db_connection_name = "elmer"
2535
}
2636
```

provider.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,9 @@ terraform {
33
postgresql = {
44
source = "cyrilgdn/postgresql"
55
}
6+
7+
vault = {
8+
source = "cyrilgdn/vault"
9+
}
610
}
711
}

0 commit comments

Comments
 (0)