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

Set default session parameters at the account level #1848

Open
wesleyhillyext opened this issue Jun 1, 2023 · 0 comments
Open

Set default session parameters at the account level #1848

wesleyhillyext opened this issue Jun 1, 2023 · 0 comments
Labels
category:resource feature-request Used to mark issues with provider's missing functionalities resource:object_parameter Issue connected to the snowflake_object_parameter resource

Comments

@wesleyhillyext
Copy link

Snowflake supports setting session parameters defaults at the account level. For example:

ALTER ACCOUNT SET ABORT_DETACHED_QUERY = TRUE;
ALTER ACCOUNT SET TIMEZONE = 'UTC';
SHOW PARAMETERS IN ACCOUNT;

I've tried to use the new snowflake_account_parameter or snowflake_object_parameter resources to specify these for all our accounts in terraform, but so far I haven't managed to get it to work.

Using snowflake_account_parameter just complains that these settings aren't valid account parameters:

resource snowflake_account_parameter timezone {
  key = "TIMEZONE"
  value = "UTC"
}

Complains that TIMEZONE is not a valid key (I shortened the message):

Error: expected key to be one of [MULTI_STATEMENT_COUNT ...], got TIMEZONE

Okay, so I figured that this is what the on_account parameter to snowflake_object_parameter is meant for. This:

resource snowflake_object_parameter timezone {
  on_account = true
  key = "TIMEZONE"
  value = "UTC"
}

Gives this error with a set of expected keys which doesn't match any pattern I can think of:

Error: expected key to be one of [STATEMENT_TIMEOUT_IN_SECONDS ...], got TIMEZONE

Trying the following makes it complain that there's no such thing as a session parameter, but parameters.go lists the TIMEZONE parameter as type ParameterType{ParameterTypeSession}:

resource snowflake_object_parameter timezone {
  object_type = "SESSION"
  object_identifier {
    name = ""
  }
  on_account = true
  key = "TIMEZONE"
  value = "UTC"
}

Trying to call it a user parameter (as all session parameters can be set at the user level) just gets me back to it complaining that TIMEZONE is not a valid key:

resource snowflake_object_parameter timezone {
  object_type = "USER"
  object_identifier {
    name = ""
  }
  on_account = true
  key = "TIMEZONE"
  value = "UTC"
}

Is there a way that setting session parameter defaults at the account level is meant to work? If not, please consider that a feature request. I don't have a strong opinion on whether its added to snowflake_account_parameter or snowflake_object_parameter { on_account = true }, as the distinction between the two isn't clear to me and seems kind of arbitrary.

@wesleyhillyext wesleyhillyext added the feature-request Used to mark issues with provider's missing functionalities label Jun 1, 2023
@sfc-gh-jcieslak sfc-gh-jcieslak added category:resource resource:object_parameter Issue connected to the snowflake_object_parameter resource labels May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:resource feature-request Used to mark issues with provider's missing functionalities resource:object_parameter Issue connected to the snowflake_object_parameter resource
Projects
None yet
Development

No branches or pull requests

2 participants