Skip to content

Commit affaabc

Browse files
authored
Update doc for postgresql_grant_role (#151)
1 parent 34bc732 commit affaabc

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

website/docs/r/postgresql_grant_role.html.markdown

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ When using ``postgresql_grant_role`` resource it is likely because the PostgreSQ
1414

1515
~> **Note:** This resource needs PostgreSQL version 9 or above.
1616

17-
~> **Note:** `postgresql_grant_role` **cannot** be used in conjunction with `postgresql_role` or they will fight over what your role grants should be.
18-
1917
## Usage
2018

2119
```hcl
@@ -26,6 +24,24 @@ resource "postgresql_grant_role" "grant_root" {
2624
}
2725
```
2826

27+
~> **Note:** If you use `postgresql_grant_role` for a role that you also manage with a `postgresql_role` resource, you need to ignore the changes of the `roles` attribute in the `postgresql_role` resource or they will fight over what your role grants should be. e.g.:
28+
```hcl
29+
resource "postgresql_role" "bob" {
30+
role = "bob"
31+
32+
lifecycle {
33+
ignore_changes = [
34+
roles,
35+
]
36+
}
37+
}
38+
39+
resource "postgresql_grant_role" "bob_admin" {
40+
role = "bob"
41+
grant_role = "admin"
42+
}
43+
```
44+
2945
## Argument Reference
3046

3147
* `role` - (Required) The name of the role that is granted a new membership.

0 commit comments

Comments
 (0)