terraform-provider-snowflake
terraform-provider-snowflake copied to clipboard
Cannot delete snowflake_network_policy_attachment resource
Terraform CLI and Provider Versions
resource "snowflake_network_policy" "policy" { name = "policy" comment = "A policy."
allowed_ip_list = ["192.168.0.100/24"] blocked_ip_list = ["192.168.0.101"] }
resource "snowflake_network_policy_attachment" "attach" { network_policy_name = "policy" set_for_account = true }
Terraform Configuration
Terraform v1.5.5
on darwin_amd64
+ provider registry.terraform.io/hashicorp/aws v5.37.0
+ provider registry.terraform.io/hashicorp/random v3.6.0
+ provider registry.terraform.io/hashicorp/tls v4.0.5
+ provider registry.terraform.io/snowflake-labs/snowflake v0.86.0
Your version of Terraform is out of date! The latest version
is 1.7.4. You can update by downloading from https://www.terraform.io/downloads.html
Expected Behavior
tf destroy should remove the policy attachment
Actual Behavior
│ Error: error deleting attachment for network policy policy err = error unsetting network policy policy on account err = 001003 (42000): SQL compilation error: │ syntax error line 1 at position 20 unexpected ''NETWORK_POLICY''. │
Steps to Reproduce
terraform applyterraform destroy
How much impact is this issue causing?
Medium
Logs
No response
Additional Information
Seems like a simple sql error. Not sure what the provider is trying to do, but ALTER ACCOUNT UNSET NETWORK_POLICY seems to work for me. as accountadmin
and yes I am running the tf as accountadmin
We are about to undergo a migration of network policies and I realised we have the same problem. The issue is that in file sdk/parameters.go, ObjectParameterUnset is tagged with ddl:"keyword,single_quotes" but the single_quotes should not be there I believe; I can take over and create a PR for it.
Hey @brandocomando. Can you bump to the newest provider version and check if the problem persists after change #2584?
I had this issue as well. Bumping to the latest provider version resolved it. Thanks!
Closing this issue then. @brandocomando please file a new issue if the problem persists in the newest provider version.