Skip to content

Commit

Permalink
Merge pull request #55 from brainly/update-documentation
Browse files Browse the repository at this point in the history
Update documentation with recent changes
  • Loading branch information
winglot authored Feb 15, 2022
2 parents 6cc2587 + af3cfb2 commit dda3a09
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 57 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ release: ## Release new provider version
@git tag $$RELEASE_VERSION
@git push origin $$RELEASE_VERSION

.PHONY: doc
doc: ## Generate documentation files
@go generate

.PHONY: help
help: ## Show this help message
@grep -Eh '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
Expand Down
25 changes: 21 additions & 4 deletions docs/resources/default_privileges.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,38 @@ description: |-

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.


## Example Usage

```terraform
resource "redshift_default_privileges" "group" {
group = "analysts"
owner = "root"
object_type = "table"
privileges = ["select"]
}
resource "redshift_default_privileges" "user" {
user = "john"
owner = "root"
object_type = "table"
privileges = ["select", "update", "insert", "delete", "drop", "references"]
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- **group** (String) The name of the group to which grant default privileges on.
- **object_type** (String) The Redshift object type to set the default privileges on (one of: table).
- **owner** (String) Target user for which to alter default privileges.
- **owner** (String) The name of the user for which default privileges are defined. Only a superuser can specify default privileges for other users.
- **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.

### Optional

- **group** (String) The name of the group to which the specified default privileges are applied.
- **id** (String) The ID of this resource.
- **schema** (String) The database schema to set default privileges for this group.
- **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.
- **user** (String) The name of the user to which the specified default privileges are applied.


27 changes: 22 additions & 5 deletions docs/resources/grant.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,45 @@
page_title: "redshift_grant Resource - terraform-provider-redshift"
subcategory: ""
description: |-
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.
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.
---

# redshift_grant (Resource)

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

## Example Usage

```terraform
resource "redshift_grant" "user" {
user = "john"
schema = "my_schema"
object_type = "schema"
privileges = ["create", "usage"]
}
resource "redshift_grant" "group" {
group = "analysts"
schema = "my_schema"
object_type = "schema"
privileges = ["usage"]
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- **group** (String) The name of the group to grant privileges on.
- **object_type** (String) The Redshift object type to grant privileges on (one of: table, schema, database).
- **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
- **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

### Optional

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


48 changes: 0 additions & 48 deletions docs/resources/privilege.md

This file was deleted.

13 changes: 13 additions & 0 deletions examples/resources/redshift_default_privileges/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
resource "redshift_default_privileges" "group" {
group = "analysts"
owner = "root"
object_type = "table"
privileges = ["select"]
}

resource "redshift_default_privileges" "user" {
user = "john"
owner = "root"
object_type = "table"
privileges = ["select", "update", "insert", "delete", "drop", "references"]
}
13 changes: 13 additions & 0 deletions examples/resources/redshift_grant/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
resource "redshift_grant" "user" {
user = "john"
schema = "my_schema"
object_type = "schema"
privileges = ["create", "usage"]
}

resource "redshift_grant" "group" {
group = "analysts"
schema = "my_schema"
object_type = "schema"
privileges = ["usage"]
}

0 comments on commit dda3a09

Please sign in to comment.