diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 1f08dec..62f2029 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -1,26 +1,26 @@
repos:
- repo: https://github.com/gruntwork-io/pre-commit
# When updating, also check if tflint version in pre-commit workflow can be updated.
- rev: "v0.1.23" # Get the latest from: https://github.com/gruntwork-io/pre-commit/releases
+ rev: "v0.1.25" # Get the latest from: https://github.com/gruntwork-io/pre-commit/releases
hooks:
- id: terraform-validate # It should be the first step as it runs terraform init required by tflint
- id: terraform-fmt
- id: tflint
- repo: https://github.com/terraform-docs/terraform-docs
- rev: "v0.18.0" # Get the latest from: https://github.com/terraform-docs/terraform-docs/releases
+ rev: "v0.19.0" # Get the latest from: https://github.com/terraform-docs/terraform-docs/releases
hooks:
- id: terraform-docs-go
args: ["."]
- repo: https://github.com/bridgecrewio/checkov.git
- rev: "3.2.192" # Get the latest from: https://github.com/bridgecrewio/checkov/releases
+ rev: "3.2.350" # Get the latest from: https://github.com/bridgecrewio/checkov/releases
hooks:
- id: checkov
args: [--skip-check, "CKV_TF_1"] # Terraform module sources do not use a git url with a commit hash revision
- repo: https://github.com/pre-commit/pre-commit-hooks
- rev: "v4.6.0" # Get the latest from: https://github.com/pre-commit/pre-commit-hooks/releases
+ rev: "v5.0.0" # Get the latest from: https://github.com/pre-commit/pre-commit-hooks/releases
hooks:
- id: check-merge-conflict
args: ["--assume-in-merge"]
diff --git a/README.md b/README.md
index 40e888f..e2ad1bd 100644
--- a/README.md
+++ b/README.md
@@ -88,8 +88,8 @@ module "snowflake_storage_integration" {
| [create\_default\_roles](#input\_create\_default\_roles) | Whether the default roles should be created | `bool` | `false` | no |
| [enabled](#input\_enabled) | Whether the storage integration is enabled | `bool` | `true` | no |
| [name](#input\_name) | Name of the resource | `string` | n/a | yes |
-| [name\_scheme](#input\_name\_scheme) | Naming scheme configuration for the resource. This configuration is used to generate names using context provider:
- `properties` - list of properties to use when creating the name - is superseded by `var.context_templates`
- `delimiter` - delimited used to create the name from `properties` - is superseded by `var.context_templates`
- `context_template_name` - name of the context template used to create the name
- `replace_chars_regex` - regex to use for replacing characters in property-values created by the provider - any characters that match the regex will be removed from the name
- `extra_values` - map of extra label-value pairs, used to create a name |
object({| `{}` | no | -| [roles](#input\_roles) | Roles created in the database scope |
properties = optional(list(string), ["environment", "name"])
delimiter = optional(string, "_")
context_template_name = optional(string, "snowflake-warehouse")
replace_chars_regex = optional(string, "[^a-zA-Z0-9_]")
extra_values = optional(map(string))
})
map(object({| `{}` | no | +| [name\_scheme](#input\_name\_scheme) | Naming scheme configuration for the resource. This configuration is used to generate names using context provider:
name_scheme = optional(object({
properties = optional(list(string))
delimiter = optional(string)
context_template_name = optional(string)
replace_chars_regex = optional(string)
extra_labels = optional(map(string))
}))
comment = optional(string)
role_ownership_grant = optional(string)
granted_roles = optional(list(string))
granted_to_roles = optional(list(string))
granted_to_users = optional(list(string))
integration_grants = optional(object({
all_privileges = optional(bool)
with_grant_option = optional(bool, false)
privileges = optional(list(string))
}))
}))
object({| `{}` | no | +| [roles](#input\_roles) | Roles created in the database scope |
properties = optional(list(string), ["environment", "name"])
delimiter = optional(string, "_")
context_template_name = optional(string, "snowflake-warehouse")
replace_chars_regex = optional(string, "[^a-zA-Z0-9_]")
extra_values = optional(map(string))
uppercase = optional(bool, true)
})
map(object({| `{}` | no | | [storage\_allowed\_locations](#input\_storage\_allowed\_locations) | Explicitly limits external stages that use the integration to reference one or more storage locations | `list(string)` | n/a | yes | | [storage\_aws\_object\_acl](#input\_storage\_aws\_object\_acl) | Value of "bucket-owner-full-control" enables support for AWS access control lists (ACLs) to grant the bucket owner full control | `string` | `null` | no | | [storage\_aws\_role\_arn](#input\_storage\_aws\_role\_arn) | AWS Role ARN | `string` | `null` | no | @@ -102,8 +102,8 @@ module "snowflake_storage_integration" { | Name | Source | Version | |------|--------|---------| | [roles\_deep\_merge](#module\_roles\_deep\_merge) | Invicton-Labs/deepmerge/null | 0.1.5 | -| [snowflake\_custom\_role](#module\_snowflake\_custom\_role) | getindata/role/snowflake | 3.0.1 | -| [snowflake\_default\_role](#module\_snowflake\_default\_role) | getindata/role/snowflake | 3.0.1 | +| [snowflake\_custom\_role](#module\_snowflake\_custom\_role) | getindata/role/snowflake | 3.1.0 | +| [snowflake\_default\_role](#module\_snowflake\_default\_role) | getindata/role/snowflake | 3.1.0 | ## Outputs diff --git a/examples/complete/main.tf b/examples/complete/main.tf index db80010..cbdf4ac 100644 --- a/examples/complete/main.tf +++ b/examples/complete/main.tf @@ -20,6 +20,9 @@ module "storage_integration" { roles = { readonly = { granted_to_roles = [snowflake_account_role.dev_role.name] + name_scheme = { + uppercase = false + } } } } diff --git a/locals.tf b/locals.tf index 8dfa8cd..a2df9db 100644 --- a/locals.tf +++ b/locals.tf @@ -8,6 +8,7 @@ locals { prefix = "sti" storage-integration = var.name } + uppercase = var.name_scheme.uppercase } #This needs to be the same as an object in roles variable diff --git a/main.tf b/main.tf index 583b544..62273a2 100644 --- a/main.tf +++ b/main.tf @@ -12,7 +12,7 @@ data "context_label" "this" { } resource "snowflake_storage_integration" "this" { - name = data.context_label.this.rendered + name = var.name_scheme.uppercase ? upper(data.context_label.this.rendered) : data.context_label.this.rendered comment = var.comment enabled = var.enabled @@ -35,7 +35,7 @@ module "snowflake_default_role" { for_each = local.default_roles source = "getindata/role/snowflake" - version = "3.0.1" + version = "3.1.0" context_templates = var.context_templates @@ -64,7 +64,7 @@ module "snowflake_custom_role" { for_each = local.custom_roles source = "getindata/role/snowflake" - version = "3.0.1" + version = "3.1.0" context_templates = var.context_templates diff --git a/variables.tf b/variables.tf index 6358f10..53168f7 100644 --- a/variables.tf +++ b/variables.tf @@ -75,6 +75,7 @@ variable "roles" { context_template_name = optional(string) replace_chars_regex = optional(string) extra_labels = optional(map(string)) + uppercase = optional(bool) })) comment = optional(string) role_ownership_grant = optional(string) @@ -98,6 +99,7 @@ variable "name_scheme" { - `context_template_name` - name of the context template used to create the name - `replace_chars_regex` - regex to use for replacing characters in property-values created by the provider - any characters that match the regex will be removed from the name - `extra_values` - map of extra label-value pairs, used to create a name + - `uppercase` - convert name to uppercase EOT type = object({ properties = optional(list(string), ["environment", "name"]) @@ -105,6 +107,7 @@ variable "name_scheme" { context_template_name = optional(string, "snowflake-warehouse") replace_chars_regex = optional(string, "[^a-zA-Z0-9_]") extra_values = optional(map(string)) + uppercase = optional(bool, true) }) default = {} }
name_scheme = optional(object({
properties = optional(list(string))
delimiter = optional(string)
context_template_name = optional(string)
replace_chars_regex = optional(string)
extra_labels = optional(map(string))
uppercase = optional(bool)
}))
comment = optional(string)
role_ownership_grant = optional(string)
granted_roles = optional(list(string))
granted_to_roles = optional(list(string))
granted_to_users = optional(list(string))
integration_grants = optional(object({
all_privileges = optional(bool)
with_grant_option = optional(bool, false)
privileges = optional(list(string))
}))
}))