Skip to content

Commit

Permalink
[docs] switch to terraform-plugin-docs (#319)
Browse files Browse the repository at this point in the history
Rather than use our doc generation code, use
<https://github.com/hashicorp/terraform-plugin-docs>, which is much more flexible.


## References
* github.com/hashicorp/terraform-plugin-docs
  • Loading branch information
ryanking committed Dec 2, 2020
1 parent 17452c8 commit 2bbcddf
Show file tree
Hide file tree
Showing 36 changed files with 928 additions and 534 deletions.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -101,7 +101,7 @@ clean: ## clean the repo
.PHONY: clean

docs:
go run ./docgen
go run github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs
.PHONY: docs

check-docs: docs ## check that docs have been generated
Expand Down
112 changes: 0 additions & 112 deletions docgen/main.go

This file was deleted.

31 changes: 24 additions & 7 deletions docs/data-sources/system_get_aws_sns_iam_policy.md
@@ -1,11 +1,28 @@
---
page_title: "snowflake_system_get_aws_sns_iam_policy Data Source - terraform-provider-snowflake"
subcategory: ""
description: |-
---

# snowflake_system_get_aws_sns_iam_policy
# Data Source `snowflake_system_get_aws_sns_iam_policy`

<!-- These docs are auto-generated by code in ./docgen, run by with make docs. Manual edits will be overwritten. -->

## properties

| NAME | TYPE | DESCRIPTION | OPTIONAL | REQUIRED | COMPUTED | DEFAULT |
|---------------------------|--------|-----------------------------------------------------------------|----------|-----------|----------|---------|
| aws_sns_topic_arn | string | Amazon Resource Name (ARN) of the SNS topic for your S3 bucket | false | true | false | |
| aws_sns_topic_policy_json | string | IAM policy for Snowflake’s SQS queue to subscribe to this topic | false | false | true | |


## Schema

### Required

- **aws_sns_topic_arn** (String, Required) Amazon Resource Name (ARN) of the SNS topic for your S3 bucket

### Optional

- **id** (String, Optional) The ID of this resource.

### Read-only

- **aws_sns_topic_policy_json** (String, Read-only) IAM policy for Snowflake’s SQS queue to subscribe to this topic


28 changes: 25 additions & 3 deletions docs/index.md
@@ -1,11 +1,17 @@
---
page_title: "Provider: Snowflake"
description: Manage SnowflakeDB with Terraform.
---

# Snowflake Provider

This is a terraform provider plugin for managing [Snowflake](https://www.snowflake.com/) accounts.
Coverage is focused on part of Snowflake related to access control.

## Example

```hcl
## Example Provider Configuration

```terraform
provider snowflake {
// required
username = "..."
Expand All @@ -18,10 +24,26 @@ provider snowflake {
private_key_path = "..."
// optional
role = "..."
role = "..."
}
```

## Configuration Schema

## Schema

### Optional

- **account** (String, Optional)
- **browser_auth** (Boolean, Optional)
- **oauth_access_token** (String, Optional)
- **password** (String, Optional)
- **private_key_path** (String, Optional)
- **region** (String, Optional)
- **role** (String, Optional)
- **username** (String, Optional)


## Authentication

The Snowflake provider support multiple ways to authenticate:
Expand Down
33 changes: 19 additions & 14 deletions docs/resources/account_grant.md
@@ -1,18 +1,23 @@
---
page_title: "snowflake_account_grant Resource - terraform-provider-snowflake"
subcategory: ""
description: |-
---

# snowflake_account_grant
# Resource `snowflake_account_grant`

<!-- These docs are auto-generated by code in ./docgen, run by with make docs. Manual edits will be overwritten. -->

**Note**: The snowflake_account_grant resource creates exclusive attachments of grants.
Across the entire Snowflake account, all of the accounts to which a single grant is attached must be declared
by a single snowflake_account_grant resource. This means that even any snowflake_account that have the attached
grant via any other mechanism (including other Terraform resources) will have that attached grant revoked by this resource.
These resources do not enforce exclusive attachment of a grant, it is the user's responsibility to enforce this.

## properties

| NAME | TYPE | DESCRIPTION | OPTIONAL | REQUIRED | COMPUTED | DEFAULT |
|-------------------|--------|---------------------------------------------------------------------------------------------|----------|-----------|----------|---------|
| privilege | string | The privilege to grant on the schema. | true | false | false | "USAGE" |
| roles | set | Grants privilege to these roles. | true | false | false | |
| with_grant_option | bool | When this is set to true, allows the recipient role to grant the privileges to other roles. | true | false | false | false |


## Schema

### Optional

- **id** (String, Optional) The ID of this resource.
- **privilege** (String, Optional) The privilege to grant on the schema.
- **roles** (Set of String, Optional) Grants privilege to these roles.
- **with_grant_option** (Boolean, Optional) When this is set to true, allows the recipient role to grant the privileges to other roles.


34 changes: 24 additions & 10 deletions docs/resources/database.md
@@ -1,14 +1,28 @@
---
page_title: "snowflake_database Resource - terraform-provider-snowflake"
subcategory: ""
description: |-
---

# snowflake_database
# Resource `snowflake_database`

<!-- These docs are auto-generated by code in ./docgen, run by with make docs. Manual edits will be overwritten. -->

## properties

| NAME | TYPE | DESCRIPTION | OPTIONAL | REQUIRED | COMPUTED | DEFAULT |
|-----------------------------|--------|-------------------------------------------------------------------------------|----------|-----------|----------|---------|
| comment | string | | true | false | false | "" |
| data_retention_time_in_days | int | | true | false | true | |
| from_database | string | Specify a database to create a clone from. | true | false | false | |
| from_share | map | Specify a provider and a share in this map to create a database from a share. | true | false | false | |
| name | string | | false | true | false | |


## Schema

### Required

- **name** (String, Required)

### Optional

- **comment** (String, Optional)
- **data_retention_time_in_days** (Number, Optional)
- **from_database** (String, Optional) Specify a database to create a clone from.
- **from_share** (Map of String, Optional) Specify a provider and a share in this map to create a database from a share.
- **id** (String, Optional) The ID of this resource.


46 changes: 27 additions & 19 deletions docs/resources/database_grant.md
@@ -1,20 +1,28 @@
---
page_title: "snowflake_database_grant Resource - terraform-provider-snowflake"
subcategory: ""
description: |-
---

# Resource `snowflake_database_grant`





## Schema

### Required

- **database_name** (String, Required) The name of the database on which to grant privileges.

### Optional

- **id** (String, Optional) The ID of this resource.
- **privilege** (String, Optional) The privilege to grant on the database.
- **roles** (Set of String, Optional) Grants privilege to these roles.
- **shares** (Set of String, Optional) Grants privilege to these shares.
- **with_grant_option** (Boolean, Optional) When this is set to true, allows the recipient role to grant the privileges to other roles.


# snowflake_database_grant

<!-- These docs are auto-generated by code in ./docgen, run by with make docs. Manual edits will be overwritten. -->

**Note**: The snowflake_database_grant resource creates exclusive attachments of grants.
Across the entire Snowflake account, all of the databases to which a single grant is attached must be declared
by a single snowflake_database_grant resource. This means that even any snowflake_database that have the attached
grant via any other mechanism (including other Terraform resources) will have that attached grant revoked by this resource.
These resources do not enforce exclusive attachment of a grant, it is the user's responsibility to enforce this.

## properties

| NAME | TYPE | DESCRIPTION | OPTIONAL | REQUIRED | COMPUTED | DEFAULT |
|-------------------|--------|---------------------------------------------------------------------------------------------|----------|-----------|----------|---------|
| database_name | string | The name of the database on which to grant privileges. | false | true | false | |
| privilege | string | The privilege to grant on the database. | true | false | false | "USAGE" |
| roles | set | Grants privilege to these roles. | true | false | false | |
| shares | set | Grants privilege to these shares. | true | false | false | |
| with_grant_option | bool | When this is set to true, allows the recipient role to grant the privileges to other roles. | true | false | false | false |
38 changes: 23 additions & 15 deletions docs/resources/integration_grant.md
@@ -1,19 +1,27 @@
---
page_title: "snowflake_integration_grant Resource - terraform-provider-snowflake"
subcategory: ""
description: |-
---

# snowflake_integration_grant
# Resource `snowflake_integration_grant`

<!-- These docs are auto-generated by code in ./docgen, run by with make docs. Manual edits will be overwritten. -->

**Note**: The snowflake_integration_grant resource creates exclusive attachments of grants.
Across the entire Snowflake account, all of the integrations to which a single grant is attached must be declared
by a single snowflake_integration_grant resource. This means that even any snowflake_integration that have the attached
grant via any other mechanism (including other Terraform resources) will have that attached grant revoked by this resource.
These resources do not enforce exclusive attachment of a grant, it is the user's responsibility to enforce this.

## properties

| NAME | TYPE | DESCRIPTION | OPTIONAL | REQUIRED | COMPUTED | DEFAULT |
|-------------------|--------|---------------------------------------------------------------------------------------------|----------|-----------|----------|---------|
| integration_name | string | Identifier for the integration; must be unique for your account. | false | true | false | |
| privilege | string | The privilege to grant on the integration. | true | false | false | "USAGE" |
| roles | set | Grants privilege to these roles. | true | false | false | |
| with_grant_option | bool | When this is set to true, allows the recipient role to grant the privileges to other roles. | true | false | false | false |


## Schema

### Required

- **integration_name** (String, Required) Identifier for the integration; must be unique for your account.

### Optional

- **id** (String, Optional) The ID of this resource.
- **privilege** (String, Optional) The privilege to grant on the integration.
- **roles** (Set of String, Optional) Grants privilege to these roles.
- **with_grant_option** (Boolean, Optional) When this is set to true, allows the recipient role to grant the privileges to other roles.


0 comments on commit 2bbcddf

Please sign in to comment.