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

Forced modify table when column using sequence nextval as default #2644

Open
acakovacevic opened this issue Mar 22, 2024 · 3 comments
Open
Labels
bug Used to mark issues with provider's incorrect behavior category:identifiers resource:table Issue connected to the snowflake_table resource

Comments

@acakovacevic
Copy link

Terraform CLI and Provider Versions

Terraform v1.6.6

required_providers {
snowflake = {
source = "Snowflake-Labs/snowflake"
version = "0.87.2"
}

Terraform Configuration

resource "snowflake_table" "report" {
  name     = "REPORT"
  database = snowflake_database.databases["SFAPPS"].name
  schema   = snowflake_schema.schemas["DYNRPT"].name
  column {
    name     = "ID"
    type     = "NUMBER(38,0)"
    nullable = false

    default {
      sequence = "${snowflake_database.databases["SFAPPS"].name}.${snowflake_schema.schemas["DYNRPT"].name}.REPORT_SEQ"
    }
  }
....

  # snowflake_table.report will be updated in-place
  ~ resource "snowflake_table" "report" {
        id                          = "DEV_SFAPPS|DYNRPT|REPORT"
        name                        = "REPORT"
        # (7 unchanged attributes hidden)

      ~ column {
            name     = "ID"
            # (2 unchanged attributes hidden)

          ~ default {
              ~ sequence = "\"DEV_SFAPPS\".\"DYNRPT\".\"REPORT_SEQ\"" -> "DEV_SFAPPS.DYNRPT.REPORT_SEQ"
            }
        }

        # (15 unchanged blocks hidden)
    }
...
snowflake_table.report: Modifying... [id=DEV_SFAPPS|DYNRPT|REPORT]

Expected Behavior

To not report there is updated in-place when nothing changed

Actual Behavior

terraform apply -> always report there is an updated in-place

Steps to Reproduce

  1. terraform apply

How much impact is this issue causing?

Medium

Logs

No response

Additional Information

It is bug introduced after version 0.84.1

@acakovacevic acakovacevic added the bug Used to mark issues with provider's incorrect behavior label Mar 22, 2024
@sfc-gh-asawicki
Copy link
Collaborator

Hey @acakovacevic. Thanks for reaching out to us.

The identifiers are a tricky thing. We will address this topic soon as part of: https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/ROADMAP.md#identifiers-rework.

@sfc-gh-jcieslak sfc-gh-jcieslak added resource:table Issue connected to the snowflake_table resource category:identifiers labels May 20, 2024
@sfc-gh-jcieslak
Copy link
Collaborator

sfc-gh-jcieslak commented Aug 15, 2024

Hey @acakovacevic 👋
Thanks for reporting the issue. This will be fixed in the next release (somewhere around next week).

sfc-gh-jcieslak added a commit that referenced this issue Aug 16, 2024
@sfc-gh-jcieslak
Copy link
Collaborator

Hey 👋
Yesterday, we released a new version of the provider (v0.95.0) that shouldn't produce any plans related to quoting. We also prepared a document concluding identifiers rework (here) that should clear things up regarding identifiers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Used to mark issues with provider's incorrect behavior category:identifiers resource:table Issue connected to the snowflake_table resource
Projects
None yet
Development

No branches or pull requests

3 participants