Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.87.0 This is a bug in the provider, which should be reported in the provider's own issue tracker #2576

Closed
alvarosaavedrau opened this issue Feb 29, 2024 · 2 comments
Labels
general-usage General help/usage questions

Comments

@alvarosaavedrau
Copy link
Contributor

Terraform CLI and Provider Versions

Terraform 1.0.0
Snowflake provider 0.87.0

Terraform Configuration

terraform {
  required_providers {
    snowflake = {
      source = "Snowflake-Labs/snowflake"
      version = "0.87.0"
    }
    aws = {
      source  = "hashicorp/aws"
    }
  }
  required_version = ">= 1.0"
}

resource "snowflake_user" "myUsers" {

  for_each = var.snowflake_users_list

  name                  = each.key
  login_name            = each.key
  comment               = each.value.comment
  password              = random_password.myPassword[each.key].result
  disabled              = each.value.disabled
  display_name          = each.value.display_name
  email                 = each.value.email
  first_name            = each.value.first_name
  last_name             = each.value.last_name

  default_warehouse    = each.value.default_warehouse
  default_role          = each.value.default_role

  must_change_password  = each.value.must_change_password

  depends_on = [ random_password.myPassword, snowflake_role.myRole ]

}

snowflake_users_list = {
    usr-sys-d-bo-dmfinanzas ={
        comment                 = "Some description about the user..."
        disabled                = false
        display_name            = "Some description about the user..."
        email                   = ""
        first_name              = ""
        last_name               = ""

        default_warehouse       = "WAREHOUSE_01"
        default_role            = "ROLE_01"

        must_change_password    = false
    },
    usr-sys-p-bo-dmfinanzas ={
        comment                 = "Some description about the user..."
        disabled                = false
        display_name            = "Some description about the user..."
        email                   = ""
        first_name              = ""
        last_name               = ""

        default_warehouse       = "WAREHOUSE_01"
        default_role            = "ROLE_01"

        must_change_password    = false
    },
}

Expected Behavior

The terraform plan should want to change some description of the users.

Actual Behavior

With the new version 0.87.0 of the snowflake provider I get the following error when running a plan:

Provider "registry.terraform.io/snowflake-labs/snowflake" planned an invalid
value for
module.snowflake-auth.snowflake_user.myUsers["*********"].default_namespace:
planned value cty.StringVal("") for a non-computed attribute.

This is a bug in the provider, which should be reported in the provider's own
issue tracker.

Error: Provider produced invalid plan

With the version that works for me is 0.55.1, I want to use version 0.87.0 in relation to this other issue "#2563", which added the privilege CREATE MODEL

From the error it seems that some value I have as empty in the tfvars ("") wants some value. But in the documentation only the "name" is required.

Steps to Reproduce

  1. terraform plan

How much impact is this issue causing?

High

Logs

https://gist.github.com/alvarosaavedrau/001ca7175cde9c5609cae9af07cd83c8

Additional Information

No response

@alvarosaavedrau alvarosaavedrau added the bug Used to mark issues with provider's incorrect behavior label Feb 29, 2024
@sfc-gh-asawicki sfc-gh-asawicki added general-usage General help/usage questions and removed bug Used to mark issues with provider's incorrect behavior labels Feb 29, 2024
@sfc-gh-asawicki
Copy link
Collaborator

Hey @alvarosaavedrau. Thanks for reaching out to us.

You have to bump your terraform to at least 1.1.5. Let me know if that helped.

@alvarosaavedrau
Copy link
Contributor Author

Hello @sfc-gh-asawicki, indeed with terraform version 1.4.1 the plan is generated without this error. Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
general-usage General help/usage questions
Projects
None yet
Development

No branches or pull requests

2 participants