-
Notifications
You must be signed in to change notification settings - Fork 428
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 objects created via terraform differs from "same" objects created via snowsight #2356
Comments
Hey @Petruspop. Thanks for reporting the issue. Based on the setup provided, the source of the error is probably using the default value from the resource schema. This should be a relatively easy fix; we will deliver it in a few days if my suspicions are confirmed. |
@sfc-gh-asawicki any update? |
Hey @timgreni. No, the issue is still waiting on our end. |
@Petruspop @timgreni working on the issue; should be fixed next week |
Fixes: #2356 Database retention time won't be set in the Read operation every time to avoid situations where Terraform expects the user to set it every time (if it's not set then it will always produce a plan, because of the Snowflake's data retention hierarchy). It will only be set there only if: - it's not set in config and schema data retention value != database retention value - it's set in the config - acceptance tests added
Hey @Petruspop @timgreni. We have released the fix as part of v0.87.0 release. Please follow the migration guide during the update. Please confirm that the issue is resolved in the newest version. Thanks! |
Terraform CLI and Provider Versions
Terraform 1.6.6
Snowflake-Labs/snowflake 0.83.1
Terraform Configuration
Expected Behavior
Data retention days on schema and table should be 28, as it should be inherited from database.
Actual Behavior
Data retention days is defaulted to 1, both for schema and table.
Steps to Reproduce
terraform apply
How much impact is this issue causing?
High
Logs
No response
Additional Information
Marked this as High as you expect you have time travel for 28 days, but in fact only have 1 day. So you risk losing data which is really dangerous.
The following script can be used in Snowsight to verify the difference.
-- Verify TF defect
USE DATABASE "data-retention-db"; -- This was created in step 1 from tf provider
CREATE SCHEMA "uischema";
USE SCHEMA "uischema";
CREATE TABLE "uitable" (id int,textfield text) COMMENT ='Table created via snowsight, with no data retention parameter value';
SHOW PARAMETERS LIKE '%DATA_RETENTION%' IN DATABASE "data-retention-db";
--> 28 - as expected (from tf)
SHOW PARAMETERS LIKE '%DATA_RETENTION%' IN SCHEMA "uischema";
--> 28 - as expected, inherited from DB
SHOW PARAMETERS LIKE '%DATA_RETENTION%' IN SCHEMA "tfschema";
--> 1 - NOT as expected, should be the same as for the schema from Snowsight
SHOW PARAMETERS LIKE '%DATA_RETENTION%' IN TABLE "uitable";
--> 28 - as expected, inherited from DB->schema->table
USE SCHEMA "tfschema";
SHOW PARAMETERS LIKE '%DATA_RETENTION%' IN TABLE "tftable";
--> 1 - NOT as expected
The text was updated successfully, but these errors were encountered: