terraform-provider-snowflake icon indicating copy to clipboard operation
terraform-provider-snowflake copied to clipboard

Default timezone user parameter

Open jglapa opened this issue 2 years ago • 0 comments

Is your feature request related to a problem? Please describe.

We host multiple users in a snowflake account where each requires a different default timezone setting.

Describe the solution you'd like

provide an additional field on the snowflake_user resource e.g. default_timezone

Describe alternatives you've considered

I could use the snowsql provider aidanmelen/snowsql but doesn't feel right. Setting timezone per session in the applications is problematic.

resource "snowsql_exec" "timezone_for_users" {
  name     = "user_time_zone"

  create {
    statements = <<-EOT
      ALTER USER "${snowflake_user.my_user.name}" SET TIMEZONE = 'Etc/UTC'
    EOT
  }

  delete {
    statements = <<-EOT
      ALTER USER "${snowflake_user.my_user.name}" UNSET TIMEZONE
    EOT
  }

  depends_on = [
    snowflake_user.my_user
  ]
}


jglapa avatar Sep 19 '22 10:09 jglapa