Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature]Snowflake: ALL modules output privileges granted #277

Merged
merged 2 commits into from
Jan 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions scripts/snowflake_generate_grant_all/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ type ModuleTemplate struct {

// required_providers: provider_name: version
Terraform map[string]map[string]map[string]string `json:"terraform,omitempty"`

// output name: arguments : values
Outputs map[string]map[string]interface{} `json:"output,omitempty"`
}

func main() {
Expand Down Expand Up @@ -116,6 +119,12 @@ func generateModule(name string, grant *resources.TerraformGrantResource) ([]byt
Locals: map[string]interface{}{
"privileges": privileges,
},
Outputs: map[string]map[string]interface{}{
"privileges": {
"value": "${local.privileges}",
"description": "Privileges that make up the ALL set.",
},
},
Terraform: map[string]map[string]map[string]string{
"required_providers": {
"snowflake": map[string]string{
Expand Down
4 changes: 3 additions & 1 deletion snowflake-account-grant-all/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

## Outputs

No output.
| Name | Description |
|------|-------------|
| privileges | Privileges that make up the ALL set. |

<!-- END -->
6 changes: 6 additions & 0 deletions snowflake-account-grant-all/main.tf.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,11 @@
"version": "\u003e= 0.20.0"
}
}
},
"output": {
"privileges": {
"description": "Privileges that make up the ALL set.",
"value": "${local.privileges}"
}
}
}
4 changes: 3 additions & 1 deletion snowflake-database-grant-all/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@

## Outputs

No output.
| Name | Description |
|------|-------------|
| privileges | Privileges that make up the ALL set. |

<!-- END -->
6 changes: 6 additions & 0 deletions snowflake-database-grant-all/main.tf.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,11 @@
"version": "\u003e= 0.20.0"
}
}
},
"output": {
"privileges": {
"description": "Privileges that make up the ALL set.",
"value": "${local.privileges}"
}
}
}
6 changes: 6 additions & 0 deletions snowflake-external-table-grant-all/main.tf.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,11 @@
"version": "\u003e= 0.20.0"
}
}
},
"output": {
"privileges": {
"description": "Privileges that make up the ALL set.",
"value": "${local.privileges}"
}
}
}
6 changes: 6 additions & 0 deletions snowflake-file-format-grant-all/main.tf.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,11 @@
"version": "\u003e= 0.20.0"
}
}
},
"output": {
"privileges": {
"description": "Privileges that make up the ALL set.",
"value": "${local.privileges}"
}
}
}
6 changes: 6 additions & 0 deletions snowflake-function-grant-all/main.tf.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,11 @@
"version": "\u003e= 0.20.0"
}
}
},
"output": {
"privileges": {
"description": "Privileges that make up the ALL set.",
"value": "${local.privileges}"
}
}
}
4 changes: 3 additions & 1 deletion snowflake-integration-grant-all/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

## Outputs

No output.
| Name | Description |
|------|-------------|
| privileges | Privileges that make up the ALL set. |

<!-- END -->
6 changes: 6 additions & 0 deletions snowflake-integration-grant-all/main.tf.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,11 @@
"version": "\u003e= 0.20.0"
}
}
},
"output": {
"privileges": {
"description": "Privileges that make up the ALL set.",
"value": "${local.privileges}"
}
}
}
6 changes: 6 additions & 0 deletions snowflake-materialized-view-grant-all/main.tf.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,11 @@
"version": "\u003e= 0.20.0"
}
}
},
"output": {
"privileges": {
"description": "Privileges that make up the ALL set.",
"value": "${local.privileges}"
}
}
}
6 changes: 6 additions & 0 deletions snowflake-procedure-grant-all/main.tf.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,11 @@
"version": "\u003e= 0.20.0"
}
}
},
"output": {
"privileges": {
"description": "Privileges that make up the ALL set.",
"value": "${local.privileges}"
}
}
}
4 changes: 3 additions & 1 deletion snowflake-resource-monitor-grant-all/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

## Outputs

No output.
| Name | Description |
|------|-------------|
| privileges | Privileges that make up the ALL set. |

<!-- END -->
6 changes: 6 additions & 0 deletions snowflake-resource-monitor-grant-all/main.tf.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,11 @@
"version": "\u003e= 0.20.0"
}
}
},
"output": {
"privileges": {
"description": "Privileges that make up the ALL set.",
"value": "${local.privileges}"
}
}
}
4 changes: 3 additions & 1 deletion snowflake-schema-grant-all/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

## Outputs

No output.
| Name | Description |
|------|-------------|
| privileges | Privileges that make up the ALL set. |

<!-- END -->
6 changes: 6 additions & 0 deletions snowflake-schema-grant-all/main.tf.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,11 @@
"version": "\u003e= 0.20.0"
}
}
},
"output": {
"privileges": {
"description": "Privileges that make up the ALL set.",
"value": "${local.privileges}"
}
}
}
6 changes: 6 additions & 0 deletions snowflake-sequence-grant-all/main.tf.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,11 @@
"version": "\u003e= 0.20.0"
}
}
},
"output": {
"privileges": {
"description": "Privileges that make up the ALL set.",
"value": "${local.privileges}"
}
}
}
4 changes: 3 additions & 1 deletion snowflake-stage-grant-all/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@

## Outputs

No output.
| Name | Description |
|------|-------------|
| privileges | Privileges that make up the ALL set. |

<!-- END -->
6 changes: 6 additions & 0 deletions snowflake-stage-grant-all/main.tf.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,11 @@
"version": "\u003e= 0.20.0"
}
}
},
"output": {
"privileges": {
"description": "Privileges that make up the ALL set.",
"value": "${local.privileges}"
}
}
}
6 changes: 6 additions & 0 deletions snowflake-stream-grant-all/main.tf.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,11 @@
"version": "\u003e= 0.20.0"
}
}
},
"output": {
"privileges": {
"description": "Privileges that make up the ALL set.",
"value": "${local.privileges}"
}
}
}
4 changes: 3 additions & 1 deletion snowflake-table-grant-all/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@

## Outputs

No output.
| Name | Description |
|------|-------------|
| privileges | Privileges that make up the ALL set. |

<!-- END -->
6 changes: 6 additions & 0 deletions snowflake-table-grant-all/main.tf.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,11 @@
"version": "\u003e= 0.20.0"
}
}
},
"output": {
"privileges": {
"description": "Privileges that make up the ALL set.",
"value": "${local.privileges}"
}
}
}
4 changes: 3 additions & 1 deletion snowflake-view-grant-all/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@

## Outputs

No output.
| Name | Description |
|------|-------------|
| privileges | Privileges that make up the ALL set. |

<!-- END -->
6 changes: 6 additions & 0 deletions snowflake-view-grant-all/main.tf.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,11 @@
"version": "\u003e= 0.20.0"
}
}
},
"output": {
"privileges": {
"description": "Privileges that make up the ALL set.",
"value": "${local.privileges}"
}
}
}
4 changes: 3 additions & 1 deletion snowflake-warehouse-grant-all/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

## Outputs

No output.
| Name | Description |
|------|-------------|
| privileges | Privileges that make up the ALL set. |

<!-- END -->
6 changes: 6 additions & 0 deletions snowflake-warehouse-grant-all/main.tf.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,11 @@
"version": "\u003e= 0.20.0"
}
}
},
"output": {
"privileges": {
"description": "Privileges that make up the ALL set.",
"value": "${local.privileges}"
}
}
}