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]: fail to create snowflake_account_parameter #3025

Closed bob-zarkoob closed 15 hours ago

bob-zarkoob commented 2 months ago

Terraform CLI Version

1.9.5

Terraform Provider Version

0.94.1

Terraform Configuration

resource "snowflake_account_parameter" "p7" {
  key   = "OAUTH_ADD_PRIVILEGED_ROLES_TO_BLOCKED_LIST"
  value = true
}

Category

category:resource

Object type(s)

resource:account_parameter

Expected Behavior

to create the resource

Actual Behavior

Error: Invalid object parameter: OAUTH_ADD_PRIVILEGED_ROLES_TO_BLOCKED_LIST with module.snowflake_params.snowflake_account_parameter.p7 on account-parameters/main.tf line 45, in resource "snowflake_account_parameter" "p7": resource "snowflake_account_parameter" "p7" {

While this parameter is in the list of acceptable parameters.

Steps to Reproduce

  1. copy config
  2. run terraform apply

How much impact is this issue causing?

Medium

Logs

No response

Additional Information

No response

Would you like to implement a fix?

sfc-gh-jcieslak commented 2 months ago

Hey @bob-zarkoob 👋 It seems like we have missing mapping for this one. I'll take care of it. Please use unsafe_execute for now.

sfc-gh-jcieslak commented 2 months ago

Hey all 👋 Yesterday, we released a new provider version (v0.95.0) that adds this parameter. Please upgrade and let us know if now you can set OAUTH_ADD_PRIVILEGED_ROLES_TO_BLOCKED_LIST .

bob-zarkoob commented 2 months ago

@sfc-gh-jcieslak I am trying to upgrade to 0.95.0 and getting this error:

│ Could not retrieve the list of available versions for provider snowflake-labs/snowflake: no available releases match the given constraints 0.94.1, 0.95.0

and when I open my TF files in the editor, I get unknown provider warning and all my code is highlighted

sfc-gh-jcieslak commented 2 months ago

Hmm, that's interesting; what OS/distro are you running the provider on?

bob-zarkoob commented 2 months ago

Hmm, that's interesting; what OS/distro are you running the provider on?

I am on Windows 11, 23H2.

sfc-gh-jcieslak commented 2 months ago

There could be some kind of issue with the Terraform Registry syncing binaries from our repository. We re-synced the registry. It may take several minutes to fully re-sync, but after some time, you can try again and let us know if it works now or if the error still occurs.

bob-zarkoob commented 2 months ago

I still cannot load the metadata for the provider, I get error for all resources because my IDE cannot validate the definition, so I have to run terraform to make sure I am using the properties correctly.

Also, I am getting this error without even making a change to that file:

on security/users.tf line 92, in resource "snowflake_user" "xxxxx":
  default_secondary_roles = "ALL"
An argument named "default_secondary_roles" is not expected here.
sfc-gh-asawicki commented 2 months ago

Hey @bob-zarkoob.

This is expected. Please read the migration guide: https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/MIGRATION_GUIDE.md#breaking-change-handling-default-secondary-roles.

sfc-gh-jcieslak commented 15 hours ago

Closing due to long inactivity. If you have any further problems, please create another issue. Thank You.