Snowflake-Labs / terraform-provider-snowflake

Terraform provider for managing Snowflake accounts
https://registry.terraform.io/providers/Snowflake-Labs/snowflake/latest
MIT License
551 stars 420 forks source link

[Bug]: snowflake_stream show_initial_rows = true is reset at every apply #2975

Open tmnd1991 opened 3 months ago

tmnd1991 commented 3 months ago

Terraform CLI Version

opentofu 1.7.1

Terraform Provider Version

0.94

Terraform Configuration

resource "snowflake_stream" "hosts_stream" {
  schema            = "schema"
  database          = "database"
  name              = "HOSTS_STREAMS"
  append_only       = true
  on_table          = "database.schema.HOSTS"
  show_initial_rows = true
}

Category

category:resource

Object type(s)

resource:stream

Expected Behavior

the stream is reset and shows initial rows only when created (first apply) and not when the resource did not change.

Actual Behavior

snowflake_stream.hosts_stream must be replaced

-/+ resource "snowflake_stream" "hosts_stream" { ~ id = "" -> (known after apply) name = "HOSTS_STREAMS" ~ owner = "" -> (known after apply) ~ show_initial_rows = false -> true # forces replacement

(5 unchanged attributes hidden)

}

Steps to Reproduce

apply a plan with a stream twice.

How much impact is this issue causing?

High

Logs

No response

Additional Information

No response

Would you like to implement a fix?

sfc-gh-asawicki commented 3 months ago

Hey @tmnd1991. Thanks for reaching out to us.

We will address this issue during upcoming stream redesign (https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/ROADMAP.md#preparing-essential-ga-objects-for-the-provider-v1). I will add this issue to the list of know issues.

sfc-gh-jmichalak commented 1 month ago

Hey, @tmnd1991 πŸ‘‹ We have just released the v0.97.0 version of the provider (release notes, migration guide) containing a new stream_on_table resource with the correct behavior. Please upgrade to this new resource and let us know if it works!