Forced Replacement of one resource renders another resource invalid #2397
Labels
category:resource
feature-request
Used to mark issues with provider's missing functionalities
resource:materialized_view
Issue connected to the snowflake_materialized_view resource
Terraform CLI and Provider Versions
Terraform v1.7.0 on darwin_arm64
provider registry.terraform.io/snowflake-labs/snowflake v0.84.0
Terraform Configuration
Expected Behavior
Make changes to an external table(i.e. change comment field) -> it will be destroyed and replaced on apply(# forces replacement) -> if there is a materialized view which depends on it -> the materialized view is destroyed and recreated after the external table is recreated.
Actual Behavior
If any change is made to an external table, that table is destroyed and recreated on apply(# forces replacement).
When this happens, any materialized_view which is based on that table is marked as invalid because the resource it was based on has been dropped. We tried to make the materialized_view depend on the id of the external table(shown in the config code above). But this only led to an 'edit in place' for the materialized_view.
If any other changes are attempted on the invalid materialized_view on subsequent applies, you will get an error. The Materialized view needs to be destroyed and recreated in order to get it back.
Steps to Reproduce
terraform apply
How much impact is this issue causing?
High
Logs
No response
Additional Information
This same problem has affected external tables when a change was made to the stage which it depends on. It seems like this issue will affect any resource which depends on a particular underlying resource and is marked as invalid when that resource is dropped from the warehouse.
The text was updated successfully, but these errors were encountered: