Skip to content

Commit 1a07f4c

Browse files
authored
fix: Fix roles option merge (#4)
* fix: Fix roles option merge * fix: Remove tfplans
1 parent e68041d commit 1a07f4c

File tree

18 files changed

+126
-34
lines changed

18 files changed

+126
-34
lines changed

.github/workflows/pre-commit.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ on:
88

99
env:
1010
TERRAFORM_DOCS_VERSION: v0.16.0
11-
TFLINT_VERSION: v0.41.0
1211

1312
jobs:
1413
collectInputs:

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,5 @@ override.tf.json
2929
# Include override files you do wish to add to version control using negated pattern
3030
#
3131
# !example_override.tf
32+
33+
tfplan*

.pre-commit-config.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ repos:
1616
args: ["."]
1717

1818
- repo: https://github.com/bridgecrewio/checkov.git
19-
rev: "2.2.168" # Get the latest from: https://github.com/bridgecrewio/checkov/releases
19+
rev: "2.2.246" # Get the latest from: https://github.com/bridgecrewio/checkov/releases
2020
hooks:
2121
- id: checkov
22+
args: [--skip-check, "CKV2_GHA_1"] #Flase positive for top-level permissions
2223

2324
- repo: https://github.com/pre-commit/pre-commit-hooks
2425
rev: "v4.3.0" # Get the latest from: https://github.com/pre-commit/pre-commit-hooks/releases

.tflint.hcl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
config {
2+
ignore_module = {
3+
"Invicton-Labs/deepmerge/null" = true
4+
}
5+
}
6+
17
rule "terraform_deprecated_interpolation" {
28
enabled = true
39
}

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ _Additional information that should be made public, for ex. how to solve known i
9999
| <a name="input_query_acceleration_max_scale_factor"></a> [query\_acceleration\_max\_scale\_factor](#input\_query\_acceleration\_max\_scale\_factor) | Specifies the maximum scale factor for leasing compute resources for query acceleration. The scale factor is used as a multiplier based on warehouse size. | `number` | `null` | no |
100100
| <a name="input_regex_replace_chars"></a> [regex\_replace\_chars](#input\_regex\_replace\_chars) | Terraform regular expression (regex) string.<br>Characters matching the regex will be removed from the ID elements.<br>If not set, `"/[^a-zA-Z0-9-]/"` is used to remove all characters other than hyphens, letters and digits. | `string` | `null` | no |
101101
| <a name="input_resource_monitor"></a> [resource\_monitor](#input\_resource\_monitor) | Specifies the name of a resource monitor that is explicitly assigned to the warehouse. | `string` | `null` | no |
102-
| <a name="input_roles"></a> [roles](#input\_roles) | Roles created on the warehouse level | `any` | `{}` | no |
102+
| <a name="input_roles"></a> [roles](#input\_roles) | Roles created on the warehouse level | <pre>map(object({<br> enabled = optional(bool, true)<br> descriptor_name = optional(string, "snowflake-role")<br> comment = optional(string)<br> role_ownership_grant = optional(string)<br> granted_roles = optional(list(string))<br> granted_to_roles = optional(list(string))<br> granted_to_users = optional(list(string))<br> warehouse_grants = optional(list(string))<br> }))</pre> | `{}` | no |
103103
| <a name="input_scaling_policy"></a> [scaling\_policy](#input\_scaling\_policy) | Specifies the policy for automatically starting and shutting down clusters in a multi-cluster warehouse running in Auto-scale mode. | `string` | `null` | no |
104104
| <a name="input_stage"></a> [stage](#input\_stage) | ID element. Usually used to indicate role, e.g. 'prod', 'staging', 'source', 'build', 'test', 'deploy', 'release' | `string` | `null` | no |
105105
| <a name="input_statement_queued_timeout_in_seconds"></a> [statement\_queued\_timeout\_in\_seconds](#input\_statement\_queued\_timeout\_in\_seconds) | Object parameter that specifies the time, in seconds, a SQL statement (query, DDL, DML, etc.) can be queued on a warehouse before it is canceled by the system. | `number` | `null` | no |
@@ -113,15 +113,16 @@ _Additional information that should be made public, for ex. how to solve known i
113113
| Name | Source | Version |
114114
|------|--------|---------|
115115
| <a name="module_roles_deep_merge"></a> [roles\_deep\_merge](#module\_roles\_deep\_merge) | Invicton-Labs/deepmerge/null | 0.1.5 |
116-
| <a name="module_snowflake_role"></a> [snowflake\_role](#module\_snowflake\_role) | getindata/role/snowflake | 1.0.3 |
116+
| <a name="module_snowflake_custom_role"></a> [snowflake\_custom\_role](#module\_snowflake\_custom\_role) | getindata/role/snowflake | 1.0.3 |
117+
| <a name="module_snowflake_default_role"></a> [snowflake\_default\_role](#module\_snowflake\_default\_role) | getindata/role/snowflake | 1.0.3 |
117118
| <a name="module_this"></a> [this](#module\_this) | cloudposse/label/null | 0.25.0 |
118119
| <a name="module_warehouse_label"></a> [warehouse\_label](#module\_warehouse\_label) | cloudposse/label/null | 0.25.0 |
119120

120121
## Outputs
121122

122123
| Name | Description |
123124
|------|-------------|
124-
| <a name="output_roles"></a> [roles](#output\_roles) | Functional roles created for warehouse |
125+
| <a name="output_roles"></a> [roles](#output\_roles) | Access roles created for warehouse |
125126
| <a name="output_warehouse"></a> [warehouse](#output\_warehouse) | Details of the warehouse |
126127

127128
## Providers

examples/complete/.env.dist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
SNOWFLAKE_USER=
2+
SNOWFLAKE_PASSWORD=
3+
SNOWFLAKE_ROLE=
4+
SNOWFLAKE_ACCOUNT=

examples/complete/.envrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#Override defaults
2+
command -v dotenv && test -f .env && dotenv

examples/complete/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.env

examples/complete/Makefile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
init:
2+
terraform init
3+
4+
plan:
5+
terraform plan -out tfplan
6+
7+
apply:
8+
terraform apply tfplan
9+
10+
destroy:
11+
terraform destroy

examples/complete/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ module "terraform_snowflake_warehouse" {
6262
granted_to_roles = [snowflake_role.this_admin.name]
6363
}
6464
custom_role = {
65-
privileges = ["USAGE", "MODIFY"]
65+
warehouse_grants = ["USAGE", "MODIFY"]
6666
granted_to_roles = [snowflake_role.this_dev.name]
6767
}
6868
}

0 commit comments

Comments
 (0)