Snowflake-Labs / terraform-provider-snowflake

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

[Bug]: Alter stage for directory = "ENABLE = true" #3175

Open Serhuela opened 2 weeks ago

Serhuela commented 2 weeks ago

Terraform CLI Version

1.0.0

Terraform Provider Version

0.55.1

Terraform Configuration

-

Category

category:resource

Object type(s)

resource:stage

Expected Behavior

When attempting to create or modify a stage in Snowflake using Terraform, the property directory = "ENABLE = true" should enable the use of a directory table without errors. Specifically, adding directory = "ENABLE = true" in the Terraform configuration should allow the creation or modification of the stage to proceed successfully.

Actual Behavior

When trying to create or modify a stage with directory = "ENABLE = true", the following error occurs:

Error: error creating stage <stage_name>

However, after manually enabling the directory option in the Snowflake console and running terraform plan, it’s confirmed that the correct parameter is indeed directory = "ENABLE = true". If the stage already has the directory option enabled in Snowflake, Terraform processes the parameter without issues, as it does not attempt to modify or recreate the stage. This suggests the issue occurs only during the initial creation or modification of the directory property.

Steps to Reproduce

1.- Configure a new stage in Terraform with the property directory = "ENABLE = true". 2.- Run terraform apply to create the stage or modify an existing one (supossed it already had not the directory enabled). 3.- Note the error occurring during the stage creation/modification. Note that the error occurs while applying the plan, i.e. after approving the plan. 4.- Create the stage without the directory property. 5.- Manually enable the directory option in the Snowflake console. 6.- Run terraform apply again and observe that directory = "ENABLE = true" is now recognized without issues, and no attempt is made to recreate the stage.

How much impact is this issue causing?

Low

Logs

No response

Additional Information

No response

Would you like to implement a fix?

sfc-gh-asawicki commented 2 weeks ago

Hey @Serhuela. Thanks for reaching out to us.

You are using an ancient version of the provider. The logic of the provider has changed multiple times since that version (we are at v0.97.1 now). Please check if this problem is still present in v0.97.

sfc-gh-asawicki commented 21 hours ago

Hey @Serhuela. Did you have a chance to verify the newer versions?