Tracking order changing after upgrade to 0.85 #2492
-
Hi, I encountered a strange behaviour after upgrading from resource "snowflake_database" "db" {
name = "SCHEMA_TEST_DEMO"
}
locals {
schemas = {
"SCHEMA1" : {
}
"SCHEMA2" : {
}
"SCHEMA3" : {
}
}
}
resource "snowflake_schema" "schema" {
for_each = local.schemas
name = each.key
database = snowflake_database.db.name
}
resource "snowflake_table" "table" {
for_each = local.schemas
database = snowflake_database.db.name
schema = each.key
name = "TEST_TABLE"
column {
name = "name"
type = "VARIANT"
nullable = true
}
}
resource "snowflake_view" "view" {
for_each = local.schemas
name = "TEST_VIEW"
schema = each.key
database = snowflake_database.db.name
statement = <<-SQL
select "name" from ${snowflake_database.db.name}.${snowflake_schema.schema[each.key].name}.${snowflake_table.table[each.key].name};
SQL
} Everything is fine, but after upgrade to # snowflake_view.view["SCHEMA2"] must be replaced
-/+ resource "snowflake_view" "view" {
~ created_on = "2024-02-12T09:30:21.499-08:00" -> (known after apply)
~ id = "SCHEMA_TEST_DEMO|SCHEMA2|TEST_VIEW" -> (known after apply)
name = "TEST_VIEW"
~ schema = "SCHEMA1" -> "SCHEMA2" # forces replacement
~ statement = <<-EOT
- select "name" from SCHEMA_TEST_DEMO.SCHEMA1.TEST_TABLE;
+ select "name" from SCHEMA_TEST_DEMO.SCHEMA2.TEST_TABLE;
EOT
# (4 unchanged attributes hidden)
}
# snowflake_view.view["SCHEMA3"] must be replaced
-/+ resource "snowflake_view" "view" {
~ created_on = "2024-02-12T09:30:21.499-08:00" -> (known after apply)
~ id = "SCHEMA_TEST_DEMO|SCHEMA3|TEST_VIEW" -> (known after apply)
name = "TEST_VIEW"
~ schema = "SCHEMA1" -> "SCHEMA3" # forces replacement
~ statement = <<-EOT
- select "name" from SCHEMA_TEST_DEMO.SCHEMA1.TEST_TABLE;
+ select "name" from SCHEMA_TEST_DEMO.SCHEMA3.TEST_TABLE;
EOT
# (4 unchanged attributes hidden)
}
Plan: 2 to add, 0 to change, 2 to destroy. terrafrom: Is this some kind of bug or bad usage of terraform that's surfacing now for some reason? I've read somewhere that maps are lexically sorted by keys ( |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey @jglapa. It was certainly connected with the incorrect behavior described in #2506. We released the fix as part of yesterday's 0.86.0 release. Could you please check if this solves the issue you are having? |
Beta Was this translation helpful? Give feedback.
Hey @jglapa. It was certainly connected with the incorrect behavior described in #2506. We released the fix as part of yesterday's 0.86.0 release. Could you please check if this solves the issue you are having?