Snowflake-Labs / terraform-provider-snowflake

Terraform provider for managing Snowflake accounts
https://registry.terraform.io/providers/Snowflake-Labs/snowflake/latest
MIT License
549 stars 420 forks source link

[Bug]: failure during applying terraform for snowflake_view resoure #3067

Closed freylafert closed 2 months ago

freylafert commented 2 months ago

Terraform CLI Version

v1.5.5

Terraform Provider Version

0.95.0

Terraform Configuration

failure during applying terraform for snowflake_view resoure

Category

category:resource

Object type(s)

resource:view

Expected Behavior

the resource already exist in DB and state, expected behavior getting clean output with no change for this resurce

Actual Behavior

terraform apply fails with error: │ Error: getting policy references for view: 000606 (57P03): No active warehouse selected in the current session. Select an active warehouse with the 'use warehouse' command. │ │ │ with module.snowflake.snowflake_view.view["users__azure_ad__plain_map_base"], │ on ../reporting/snowflake/snowflake.tf line 179, in resource "snowflake_view" "view": │ 179: resource "snowflake_view" "view" {

Steps to Reproduce

resource "snowflake_view" "view" { depends_on = [snowflake_table.table, snowflake_function.function] provider = snowflake.account_admin for_each = local.views database = var.snowflake_database_name schema = snowflake_schema.collection.name name = each.value.name comment = each.value.name or_replace = true statement = templatefile("${path.module}/${each.value.sql}", { IP_INFO_PRIVATE_SHARING = var.ip_info_private_sharing }) }

How much impact is this issue causing?

Medium

Logs

No response

Additional Information

No response

Would you like to implement a fix?

sfc-gh-asawicki commented 2 months ago

Hey @freylafert. Thanks for reaching out to us.

This is expected behavior. Please check the migration guide: https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/MIGRATION_GUIDE.md#breaking-change-required-warehouse.