Skip to content
This repository was archived by the owner on Jan 17, 2025. It is now read-only.

Commit dda3a09

Browse files
authored
Merge pull request #55 from brainly/update-documentation
Update documentation with recent changes
2 parents 6cc2587 + af3cfb2 commit dda3a09

File tree

6 files changed

+73
-57
lines changed

6 files changed

+73
-57
lines changed

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ release: ## Release new provider version
4848
@git tag $$RELEASE_VERSION
4949
@git push origin $$RELEASE_VERSION
5050

51+
.PHONY: doc
52+
doc: ## Generate documentation files
53+
@go generate
54+
5155
.PHONY: help
5256
help: ## Show this help message
5357
@grep -Eh '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

docs/resources/default_privileges.md

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,38 @@ description: |-
1010

1111
Defines the default set of access privileges to be applied to objects that are created in the future by the specified user. By default, users can change only their own default access privileges. Only a superuser can specify default privileges for other users.
1212

13-
13+
## Example Usage
14+
15+
```terraform
16+
resource "redshift_default_privileges" "group" {
17+
group = "analysts"
18+
owner = "root"
19+
object_type = "table"
20+
privileges = ["select"]
21+
}
22+
23+
resource "redshift_default_privileges" "user" {
24+
user = "john"
25+
owner = "root"
26+
object_type = "table"
27+
privileges = ["select", "update", "insert", "delete", "drop", "references"]
28+
}
29+
```
1430

1531
<!-- schema generated by tfplugindocs -->
1632
## Schema
1733

1834
### Required
1935

20-
- **group** (String) The name of the group to which grant default privileges on.
2136
- **object_type** (String) The Redshift object type to set the default privileges on (one of: table).
22-
- **owner** (String) Target user for which to alter default privileges.
37+
- **owner** (String) The name of the user for which default privileges are defined. Only a superuser can specify default privileges for other users.
2338
- **privileges** (Set of String) The list of privileges to apply as default privileges. See [ALTER DEFAULT PRIVILEGES command documentation](https://docs.aws.amazon.com/redshift/latest/dg/r_ALTER_DEFAULT_PRIVILEGES.html) to see what privileges are available to which object type.
2439

2540
### Optional
2641

42+
- **group** (String) The name of the group to which the specified default privileges are applied.
2743
- **id** (String) The ID of this resource.
28-
- **schema** (String) The database schema to set default privileges for this group.
44+
- **schema** (String) If set, the specified default privileges are applied to new objects created in the specified schema. In this case, the user or user group that is the target of ALTER DEFAULT PRIVILEGES must have CREATE privilege for the specified schema. Default privileges that are specific to a schema are added to existing global default privileges. By default, default privileges are applied globally to the entire database.
45+
- **user** (String) The name of the user to which the specified default privileges are applied.
2946

3047

docs/resources/grant.md

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,45 @@
33
page_title: "redshift_grant Resource - terraform-provider-redshift"
44
subcategory: ""
55
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.
77
---
88

99
# redshift_grant (Resource)
1010

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.
1212

13+
## Example Usage
1314

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+
```
1430

1531
<!-- schema generated by tfplugindocs -->
1632
## Schema
1733

1834
### Required
1935

20-
- **group** (String) The name of the group to grant privileges on.
2136
- **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
2338

2439
### Optional
2540

41+
- **group** (String) The name of the group to grant privileges on. Either `group` or `user` parameter must be set.
2642
- **id** (String) The ID of this resource.
2743
- **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.
2946

3047

docs/resources/privilege.md

Lines changed: 0 additions & 48 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
resource "redshift_default_privileges" "group" {
2+
group = "analysts"
3+
owner = "root"
4+
object_type = "table"
5+
privileges = ["select"]
6+
}
7+
8+
resource "redshift_default_privileges" "user" {
9+
user = "john"
10+
owner = "root"
11+
object_type = "table"
12+
privileges = ["select", "update", "insert", "delete", "drop", "references"]
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
resource "redshift_grant" "user" {
2+
user = "john"
3+
schema = "my_schema"
4+
object_type = "schema"
5+
privileges = ["create", "usage"]
6+
}
7+
8+
resource "redshift_grant" "group" {
9+
group = "analysts"
10+
schema = "my_schema"
11+
object_type = "schema"
12+
privileges = ["usage"]
13+
}

0 commit comments

Comments
 (0)