terraform-provider-snowflake icon indicating copy to clipboard operation
terraform-provider-snowflake copied to clipboard

Add `ENABLE_SCHEMA_EVOLUTION` flag for `snowflake_table` resource.

Open RenanBasilio opened this issue 1 year ago • 3 comments
trafficstars

Terraform CLI and Provider Versions

Terraform: 1.7.4 Provider: 0.87.2

Use Cases or Problem Statement

Our company maintains snowpipes and their target tables via the snowflake terraform provider. Some of these pipelines including evolving schemas, and we'd like to use Snowflake's built in schema evolution features to handle this.

This means we often have to create the tables via terraform and then subsequently run an ALTER TABLE statement in Snowflake in order to enable schema evolution, or skip using terraform for those tables entirely.

Proposal

The provider should support setting the property enable_schema_evolution during table creation.

The table should be initialized by terraform with the initial column configuration provided and with the enable_schema_evolution flag set.

This flag being set should also set the lifecycle rule to ignore changes to nested column attributes, as these may be added or modified externally by Snowflake schema evolution. This last step could be done either implicitly or explicitly.

How much impact is this issue causing?

Medium

Additional Information

No response

RenanBasilio avatar Apr 04 '24 23:04 RenanBasilio

Hey @RenanBasilio. Thanks for reaching out to us.

Have you considered using https://developer.hashicorp.com/terraform/language/meta-arguments/lifecycle#ignore_changes?

sfc-gh-asawicki avatar Apr 05 '24 06:04 sfc-gh-asawicki

The issue isn't with the inability to ignore changes, so much so as the option to enable schema evolution not being available when creating the table via the provider.

RenanBasilio avatar Apr 05 '24 07:04 RenanBasilio

We will support the missing param as part of https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/ROADMAP.md#supporting-all-snowflake-ga-features. I will share a more concrete ordering of resources we will tackle in the next two weeks.

sfc-gh-asawicki avatar Apr 05 '24 10:04 sfc-gh-asawicki