-
Notifications
You must be signed in to change notification settings - Fork 430
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
snowflake_object_parameter resource for the key "DATA_RETENTION_TIME_IN_DAYS" is not working as expected #1938
Comments
@Bharath-Kumar-RNDC I think it was a mistake on our part to mark Using both the table resource and the |
Yes, I can |
@sfc-gh-swinkler Thanks for your response. If this bug is fixed, it solves a big problem for us. Is there any eta on fixing this bug. @sfc-gh-pbosak once this change is done, could you please post a comment here? |
Will do |
the bug ( conflict between |
@sfc-gh-swinkler @sfc-gh-pbosak any updates on this issue? |
Hi @sfc-gh-swinkler , I just received a messsage from a customer in Norway stating that this still does not work |
@sfc-gh-tiversen please create a new issue with a proper description, provider version used, example config, and reproduction steps. |
@sfc-gh-asawicki @sfc-gh-tiversen So perhaps Snowflake support, development and product management can talk here? Without the need of us providing more details? The issue we reported in early December is that Snowsight and the Terraform provider has different behaviour. Thanks! |
Provider Version
0.68.1
The provider version you are using.
0.68.1
Terraform Version
1.5.2
The version of Terraform you were using when the bug was encountered.
1.5.2
Describe the bug
The documentation says that the data_retention_days argument is deprecated for Snowflake tables. When I use the data_retention_days argument under a table resource, Terraform tells me to use the snowflake_object_parameter resource instead. When I used the snowflake_object_parameter resource, using "DATA_RETENTION_TIME_IN_DAYS" as the key and set the value to 30 and run terraform apply, the data retention time for the table will be set to 30. But if I make changes to the table schema or any other snowflake resources, the data retention time for the table reverts back to 1 (which is the default value for Snowflake time travel)
Expected behavior
When I used the snowflake_object_parameter resource, using "DATA_RETENTION_TIME_IN_DAYS" as the key and set the value to 30 and run terraform apply, the data retention time for the table will be set to 30. If I make changes to the table schema or any other snowflake resources, the data retention time for the table should be 30.
A clear and concise description of what you expected to happen.
When I used the snowflake_object_parameter resource, using "DATA_RETENTION_TIME_IN_DAYS" as the key and set the value to 30 and run terraform apply, the data retention time for the table will be set to 30. If I make changes to the table schema or any other snowflake resources, the data retention time for the table should be 30.
Code samples and commands
Step-1:
create a table called "SALES"
resource "snowflake_table" "sales_t" {
database = "TF_DEMO"
schema = "SALES"
name = "SALES"
column {
name = "ID"
type = "NUMBER(38,0)"
}
column {
name = "SALE_NAME"
type = "VARCHAR(10)"
}
}
run below commands to create the above table
terraform init
terraform validate
terraform plan
terraform apply
at this point, data_retention_time of the table is 1 which is the default value.
Step - 2:
change data_retention_time of the table
resource "snowflake_object_parameter" "data_retention_time" {
key = "DATA_RETENTION_TIME_IN_DAYS"
value = "30"
object_type = "TABLE"
object_identifier {
database = "TF_DEMO"
schema = "SALES"
name = "SALES"
}
}
run below commands to change the data_retention_time
terraform init
terraform validate
terraform plan
terraform apply
Now, data_retention_time of the table will be changes to 30 which is correct.
Step-3:
create a new table called "BOOKS"
resource "snowflake_table" "book" {
database = "TF_DEMO"
schema = "SALES"
name = "BOOKS"
column {
name = "ID"
type = "NUMBER(38,0)"
}
column {
name = "BOOK_NAME"
type = "VARCHAR(10)"
}
}
run below commands to create an another table.
terraform init
terraform validate
terraform plan
terraform apply
this is where things get weird. If I check the data_retention_time of the table (SALES) which was created earlier, the value will be changed to 1. This is not the intended behaviour.
The text was updated successfully, but these errors were encountered: