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

Support Parameters within providers for Warehouse and Account #583

Closed
alanmcruickshank opened this issue Jun 18, 2021 · 6 comments
Closed
Labels
feature-request Used to mark issues with provider's missing functionalities

Comments

@alanmcruickshank
Copy link

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

We currently don't have the statement timeout or date configuration parameters configured anywhere as code, this means that they're had to version control and therefore control sensibly.

Descriptions of the parameters available for configuration are here: https://docs.snowflake.com/en/sql-reference/parameters.html

Parameters can be assigned to the account, the session or to an object. For terraform, assigning parameters to the session is somewhat meaningless. Account parameters would be useful (for our use case, namely TIMESTAMP_INPUT_FORMAT, TIMESTAMP_OUTPUT_FORMAT, TIMEZONE, WEEK_START, LOCK_TIMEOUT, STATEMENT_QUEUED_TIMEOUT_IN_SECONDS, STATEMENT_TIMEOUT_IN_SECONDS) & object parameters on warehouses would be useful (namely STATEMENT_QUEUED_TIMEOUT_IN_SECONDS, STATEMENT_TIMEOUT_IN_SECONDS).

The only meaningful parameter on a user is NETWORK_POLICY and that is already handled with the existing snowflake_network_policy_attachment resource.

Describe the solution you'd like

  • Ideally the snowflake_warehouse resource would accept either a mapping of parameter values or the timeout parameters directly on the resource.
  • Ideally there would be a new resource called snowflake_account_parameter which would allow the setting of parameters on the account.

Describe alternatives you've considered

For warehouse parameters, the choice between a mapping of parameters or "top level" configuration values for timeouts are of equal ease for the user. The latter is tidier albeit less flexible:

resource snowflake_warehouse w {
  name           = "test"
  comment        = "foo"
  warehouse_size = "small"
  statement_timeout_in_seconds = 1200
  statement_queued_timeout_in_seconds = 600
}

For setting account parameters, we could introduce a snowflake_account resource and set the parameters within that, we could make individual resources specifically for each potential parameter or we could have a generic snowflake_account_parameter object to set one or more parameters on the account. The latter feels tidiest, although that's mostly from a user experience point of view and there may be other reasons for choosing one of the other options.

@alanmcruickshank alanmcruickshank added the feature-request Used to mark issues with provider's missing functionalities label Jun 18, 2021
@alanmcruickshank alanmcruickshank changed the title Support Parameters within providers for Warehouse, User (and Account?) Support Parameters within providers for Warehouse and Account Jun 18, 2021
@alanmcruickshank
Copy link
Author

Looking at warehouse.go, I can see that statement_timeout_in_seconds is already implemented, but statement_queued_timeout_in_seconds is not. It also seems that statement_timeout_in_seconds is only available on create and not on update.

I assume this was because those keywords were supported on CREATE WAREHOUSE (https://docs.snowflake.com/en/sql-reference/sql/create-warehouse.html), and not on ALTER WAREHOUSE, but I can see that both are supported on both commands (https://docs.snowflake.com/en/sql-reference/sql/alter-warehouse.html).

Would it be sufficient to just remove this filter which means that not all of the fields are passed to the update statement?

@alldoami
Copy link
Contributor

alldoami commented Jul 8, 2021

Just merged a fix! Let me know if that addresses your issue @alanmcruickshank!

@alanmcruickshank
Copy link
Author

Thanks @alldoami - That covers off everything against the warehouse! 🎉 😄

I think there's still value in the account level parameters too however, which I realize also don't have an obvious place to add at the moment. Do you know how we might add them too?

@alldoami
Copy link
Contributor

We'd probably have to create a new resource I'm guessing...

@tabletcorry
Copy link

Looks like there are other meaningful parameters available for users, such as TIMEZONE, that are impossible to set with the current resource? Seems like it could be added akin to the PR above, but wanted to check first 😄

@sfc-gh-asawicki
Copy link
Collaborator

We are closing this issue as part of a cleanup described in announcement. If you believe that the issue is still valid in v0.89.0, please open a new ticket.

@sfc-gh-asawicki sfc-gh-asawicki closed this as not planned Won't fix, can't repro, duplicate, stale Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Used to mark issues with provider's missing functionalities
Projects
None yet
Development

No branches or pull requests

4 participants