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

Add START WITH optional value to Sequence Resource #2589

Open
chriscorbin opened this issue Mar 5, 2024 · 2 comments
Open

Add START WITH optional value to Sequence Resource #2589

chriscorbin opened this issue Mar 5, 2024 · 2 comments
Labels
category:resource feature-request Used to mark issues with provider's missing functionalities resource:sequence Issue connected to the snowflake_sequence resource

Comments

@chriscorbin
Copy link

Terraform CLI and Provider Versions

Terraform v1.5.7
on darwin_arm64

  • provider registry.terraform.io/snowflake-labs/snowflake v0.85.0

Your version of Terraform is out of date! The latest version
is 1.7.4. You can update by downloading from https://www.terraform.io/downloads.html

Use Cases or Problem Statement

The sequence resource does not currently support a custom starting value that could be like one would normally use with the START [WITH] parameter when executing the CREATE or ALTER SEQUENCE DDL referenced in Snowflake's Documentation

This would greatly assist in the migration of existing snowflake resources into Terraform.

Proposal

A start with value be added to the sequence resource, syntax is dealers choice but, a suggestion would be:

resource "snowflake_sequence" "test_sequence" {
  database = snowflake_database.test_database.name
  schema   = snowflake_schema.test_schema.name
  name     = "thing_counter"
  starts_with = 10000
}

How much impact is this issue causing?

Medium

Additional Information

Current workaround is to implement the sequence resource as-is and then assume a break-fix role to manually increment the sequence, this isn't ideal but will do the trick in the short-term.

@chriscorbin chriscorbin added the feature-request Used to mark issues with provider's missing functionalities label Mar 5, 2024
@sfc-gh-asawicki
Copy link
Collaborator

Hey @chriscorbin. Thanks for reporting the issue.

We are currently in the process of redesigning all existing resources (and adding missing functionalities too) as part of https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/ROADMAP.md#supporting-all-snowflake-ga-features. We will keep this issue in mind while working on the sequence resource.

@finn-O
Copy link

finn-O commented Apr 4, 2024

+1 for this issue. This is a real shortcoming trying to create/maintain Snowflake infra via Terraform given the pivotal role of the sequence. Any update on when this fix will be available? @chriscorbin with respect to your workaround note the SF documentation says that "the first/initial value cannot be altered after the sequence is created". Can you provide details on your workaround method? TIA

@sfc-gh-jcieslak sfc-gh-jcieslak added resource:sequence Issue connected to the snowflake_sequence resource category: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:sequence Issue connected to the snowflake_sequence resource
Projects
None yet
Development

No branches or pull requests

4 participants