Skip to content

Commit

Permalink
chore: rename database ownership variables
Browse files Browse the repository at this point in the history
  • Loading branch information
moss2k13 committed Aug 5, 2024
1 parent 54e18b3 commit e667437
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ When upgrading from `v1.x`, expect most of the resources to be recreated - if re
| <a name="input_context"></a> [context](#input\_context) | Single object for setting entire context at once.<br>See description of individual variables for details.<br>Leave string and numeric variables as `null` to use default value.<br>Individual variable settings (non-null) override settings in context object,<br>except for attributes, tags, and additional\_tag\_map, which are merged. | `any` | <pre>{<br> "additional_tag_map": {},<br> "attributes": [],<br> "delimiter": null,<br> "descriptor_formats": {},<br> "enabled": true,<br> "environment": null,<br> "id_length_limit": null,<br> "label_key_case": null,<br> "label_order": [],<br> "label_value_case": null,<br> "labels_as_tags": [<br> "unset"<br> ],<br> "name": null,<br> "namespace": null,<br> "regex_replace_chars": null,<br> "stage": null,<br> "tags": {},<br> "tenant": null<br>}</pre> | no |
| <a name="input_create_default_roles"></a> [create\_default\_roles](#input\_create\_default\_roles) | Whether the default roles should be created | `bool` | `false` | no |
| <a name="input_data_retention_time_in_days"></a> [data\_retention\_time\_in\_days](#input\_data\_retention\_time\_in\_days) | Number of days for which Snowflake retains historical data for performing Time Travel actions (SELECT, CLONE, UNDROP) on the object. A value of 0 effectively disables Time Travel for the specified database, schema, or table | `number` | `null` | no |
| <a name="input_database_ownership_account_role_name"></a> [database\_ownership\_account\_role\_name](#input\_database\_ownership\_account\_role\_name) | The fully qualified name of the account role to which database privileges will be granted | `string` | `null` | no |
| <a name="input_database_ownership_grant"></a> [database\_ownership\_grant](#input\_database\_ownership\_grant) | The name of the account role to which database privileges will be granted | `string` | `null` | no |
| <a name="input_default_ddl_collation"></a> [default\_ddl\_collation](#input\_default\_ddl\_collation) | Specifies a default collation specification for all schemas and tables added to the database. | `string` | `null` | no |
| <a name="input_delimiter"></a> [delimiter](#input\_delimiter) | Delimiter to be used between ID elements.<br>Defaults to `-` (hyphen). Set to `""` to use no delimiter at all. | `string` | `null` | no |
| <a name="input_descriptor_formats"></a> [descriptor\_formats](#input\_descriptor\_formats) | Describe additional descriptors to be output in the `descriptors` output map.<br>Map of maps. Keys are names of descriptors. Values are maps of the form<br>`{<br> format = string<br> labels = list(string)<br>}`<br>(Type is `any` so the map values can later be enhanced to provide additional options.)<br>`format` is a Terraform format string to be passed to the `format()` function.<br>`labels` is a list of labels, in order, to pass to `format()` function.<br>Label values will be normalized before being passed to `format()` so they will be<br>identical to how they appear in `id`.<br>Default is `{}` (`descriptors` output will be empty). | `any` | `{}` | no |
Expand Down Expand Up @@ -129,7 +129,7 @@ When upgrading from `v1.x`, expect most of the resources to be recreated - if re
|------|-------------|
| <a name="output_catalog"></a> [catalog](#output\_catalog) | The database parameter that specifies the default catalog to use for Iceberg tables |
| <a name="output_data_retention_time_in_days"></a> [data\_retention\_time\_in\_days](#output\_data\_retention\_time\_in\_days) | Data retention days for the database |
| <a name="output_database_ownership_account_role_name"></a> [database\_ownership\_account\_role\_name](#output\_database\_ownership\_account\_role\_name) | The fully qualified name of the account role to which database ownership will be granted |
| <a name="output_database_ownership_grant"></a> [database\_ownership\_grant](#output\_database\_ownership\_grant) | The name of the account role to which database ownership will be granted |
| <a name="output_database_roles"></a> [database\_roles](#output\_database\_roles) | Snowflake Database roles |
| <a name="output_default_ddl_collation"></a> [default\_ddl\_collation](#output\_default\_ddl\_collation) | Specifies a default collation specification for all schemas and tables added to the database. |
| <a name="output_enable_console_output"></a> [enable\_console\_output](#output\_enable\_console\_output) | If true, enables stdout/stderr fast path logging for anonymous stored procedures |
Expand Down
4 changes: 2 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ module "snowflake_schema" {
}

resource "snowflake_grant_ownership" "database_ownership" {
count = var.database_ownership_account_role_name != null ? 1 : 0
count = var.database_ownership_grant != null ? 1 : 0

account_role_name = var.database_ownership_account_role_name
account_role_name = var.database_ownership_grant
outbound_privileges = "REVOKE"
on {
object_type = "DATABASE"
Expand Down
4 changes: 2 additions & 2 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ output "schemas" {
value = module.snowflake_schema
}

output "database_ownership_account_role_name" {
description = "The fully qualified name of the account role to which database ownership will be granted"
output "database_ownership_grant" {
description = "The name of the account role to which database ownership will be granted"
value = one(snowflake_grant_ownership.database_ownership[*])
}
4 changes: 2 additions & 2 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,8 @@ variable "schemas" {
default = {}
}

variable "database_ownership_account_role_name" {
description = "The fully qualified name of the account role to which database privileges will be granted"
variable "database_ownership_grant" {
description = "The name of the account role to which database privileges will be granted"
type = string
default = null
}

0 comments on commit e667437

Please sign in to comment.