Open
Description
Terraform CLI Version
1.10.5
Terraform Provider Version
1.0.2
Company Name
No response
Terraform Configuration
# Add foreign key constraints
resource "snowflake_table_constraint" "constraint" {
name = "FKEY"
type = "FOREIGN KEY"
enforced = false
table_id = snowflake_table.b.fully_qualified_name
columns = ["ID"]
foreign_key_properties {
references {
table_id = snowflake_table.a.fully_qualified_name
columns = ["ID"]
}
}
}
Category
category:resource
Object type(s)
No response
Expected Behavior
According to https://docs.snowflake.com/en/sql-reference/sql/create-table-constraint#constraint-properties, the default value are NOT DEFERRABLE and DISABLE, so deferrable = false
and enable= false
Actual Behavior
current terraform plan
+ resource "snowflake_table_constraint" "constraint" {
+ columns = [
+ "ID",
]
+ deferrable = true <-----wrong
+ enable = true <-----wrong
+ enforced = false
+ id = (known after apply)
+ initially = "DEFERRED"
+ name = "FKEY"
+ rely = true
+ table_id = (known after apply)
+ type = "FOREIGN KEY"
+ validate = false
+ foreign_key_properties {
+ match = "FULL"
+ on_delete = "NO ACTION"
+ on_update = "NO ACTION"
+ references {
+ columns = [
+ "ID",
]
+ table_id = "..."
}
}
}
Steps to Reproduce
- Copy Terraform Configuration
- Run terraform plan
- Check enable and deferrable value
How much impact is this issue causing?
Low
Logs
No response
Additional Information
No response
Would you like to implement a fix?
- Yeah, I'll take it 😎