|
3 | 3 | page_title: "redshift_grant Resource - terraform-provider-redshift" |
4 | 4 | subcategory: "" |
5 | 5 | description: |- |
6 | | - Defines access privileges for user group. Privileges include access options such as being able to read data in tables and views, write data, create tables, and drop tables. Use this command to give specific privileges for a table, database, schema, function, procedure, language, or column. |
| 6 | + Defines access privileges for users and groups. Privileges include access options such as being able to read data in tables and views, write data, create tables, and drop tables. Use this command to give specific privileges for a table, database, schema, function, procedure, language, or column. |
7 | 7 | --- |
8 | 8 |
|
9 | 9 | # redshift_grant (Resource) |
10 | 10 |
|
11 | | -Defines access privileges for user group. Privileges include access options such as being able to read data in tables and views, write data, create tables, and drop tables. Use this command to give specific privileges for a table, database, schema, function, procedure, language, or column. |
| 11 | +Defines access privileges for users and groups. Privileges include access options such as being able to read data in tables and views, write data, create tables, and drop tables. Use this command to give specific privileges for a table, database, schema, function, procedure, language, or column. |
12 | 12 |
|
| 13 | +## Example Usage |
13 | 14 |
|
| 15 | +```terraform |
| 16 | +resource "redshift_grant" "user" { |
| 17 | + user = "john" |
| 18 | + schema = "my_schema" |
| 19 | + object_type = "schema" |
| 20 | + privileges = ["create", "usage"] |
| 21 | +} |
| 22 | +
|
| 23 | +resource "redshift_grant" "group" { |
| 24 | + group = "analysts" |
| 25 | + schema = "my_schema" |
| 26 | + object_type = "schema" |
| 27 | + privileges = ["usage"] |
| 28 | +} |
| 29 | +``` |
14 | 30 |
|
15 | 31 | <!-- schema generated by tfplugindocs --> |
16 | 32 | ## Schema |
17 | 33 |
|
18 | 34 | ### Required |
19 | 35 |
|
20 | | -- **group** (String) The name of the group to grant privileges on. |
21 | 36 | - **object_type** (String) The Redshift object type to grant privileges on (one of: table, schema, database). |
22 | | -- **privileges** (Set of String) The list of privileges to apply as default privileges. See [GRANT command documentation](https://docs.aws.amazon.com/redshift/latest/dg/r_GRANT.html) to see what privileges are available to which object type. An empty list could be provided to revoke all privileges for this group |
| 37 | +- **privileges** (Set of String) The list of privileges to apply as default privileges. See [GRANT command documentation](https://docs.aws.amazon.com/redshift/latest/dg/r_GRANT.html) to see what privileges are available to which object type. An empty list could be provided to revoke all privileges for this user or group |
23 | 38 |
|
24 | 39 | ### Optional |
25 | 40 |
|
| 41 | +- **group** (String) The name of the group to grant privileges on. Either `group` or `user` parameter must be set. |
26 | 42 | - **id** (String) The ID of this resource. |
27 | 43 | - **objects** (Set of String) The objects upon which to grant the privileges. An empty list (the default) means to grant permissions on all objects of the specified type. Only has effect if `object_type` is set to `table`. |
28 | | -- **schema** (String) The database schema to grant privileges on for this group. |
| 44 | +- **schema** (String) The database schema to grant privileges on. |
| 45 | +- **user** (String) The name of the user to grant privileges on. Either `user` or `group` parameter must be set. |
29 | 46 |
|
30 | 47 |
|
0 commit comments