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

Dynamic Table does not update query on change #2276

Closed
MyJBMe opened this issue Dec 16, 2023 · 1 comment · Fixed by #2287
Closed

Dynamic Table does not update query on change #2276

MyJBMe opened this issue Dec 16, 2023 · 1 comment · Fixed by #2287
Labels
bug Used to mark issues with provider's incorrect behavior category:resource resource:dynamic_table Issue connected to the snowflake_dynamic_table resource

Comments

@MyJBMe
Copy link

MyJBMe commented Dec 16, 2023

Terraform CLI and Provider Versions

Terraform: 1.3.9
Snowflake provider: 0.76.0

Terraform Configuration

snowflake = {
  source  = "Snowflake-Labs/snowflake"
  version = "~> 0.76.0"
}

resource "snowflake_dynamic_table" "dynamic" {
  name     = var.TABLE_NAME
  database = var.DATABASE_NAME
  schema   = var.SCHEMA_NAME

  warehouse = "WAREHOUSE"

  target_lag {
    maximum_duration = "9 minutes"
  }

  query     = templatefile("${path.module}/dynamic_table.sql.tmpl", {
    DATABASE_NAME = var.DATABASE_NAME,
    SCHEMA_NAME   = var.SCHEMA_NAME,
    TABLE_NAME    = var.TABLE_NAME
  })
}

Expected Behavior

When updating the SQL template file I expect the dynamic table to change as well after applying.

Actual Behavior

When planning changes, terraform detects a change in the SQL templatefile and provides those changes visually before approving. Nonetheless it does not update inside snowflake. The only way it is "updated" is to rename the resource so that TF deletes the old version and creates a new one with the right script...

Steps to Reproduce

  1. Create template file with legit SQL
  2. terraform apply
  3. Change template file
  4. 'terraform apply' again

How much impact is this issue causing?

High

Logs

No response

Additional Information

No response

@MyJBMe MyJBMe added the bug Used to mark issues with provider's incorrect behavior label Dec 16, 2023
@sfc-gh-asawicki
Copy link
Collaborator

Hey @MyJBMe. Thanks for reporting the issue.

The update is omitting the case with the query update. I will work on it in the upcoming days.

@sfc-gh-jcieslak sfc-gh-jcieslak added category:resource resource:dynamic_table Issue connected to the snowflake_dynamic_table resource labels May 16, 2024
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:resource resource:dynamic_table Issue connected to the snowflake_dynamic_table resource
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants