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

Resource 'snowflake_grant_privileges_to_role' marks 'priveleges' attribute as changed regardless of any changes being made #503

Closed
1 task done
ToxicCypher opened this issue Dec 19, 2023 · 2 comments
Labels

Comments

@ToxicCypher
Copy link

Terraform CLI and Provider Versions

terraform {
  required_version = ">= 1.3.0"
  required_providers {
    snowflake = {
      source  = "Snowflake-Labs/snowflake"
      version = "0.80.0"
    }
  }
}

Terraform Configuration

//main.tf

# Resource Monitor w/ Parametrized Values
resource "snowflake_resource_monitor" "my_resource_monitor" {
  name                      = "MY_RESOURCE_MONITOR"
  credit_quota              = var.my_resource_monitor_credit_quota
  frequency                 = var.my_resource_monitor_frequency
  start_timestamp           = var.my_resource_monitor_start_timestamp
  end_timestamp             = var.my_resource_monitor_end_timestamp
  notify_triggers           = var.my_resource_monitor_notify_triggers
  suspend_trigger           = var.my_resource_monitor_suspend_trigger
  suspend_immediate_trigger = var.my_resource_monitor_suspend_immediate_trigger
  set_for_account           = var.my_resource_monitor_set_for_account
  notify_users              = var.my_resource_monitor_notify_users
  warehouses                = var.my_resource_monitor_warehouses
}

resource "snowflake_grant_privileges_to_role" "my_resource_monitor-grant" {
  depends_on = [snowflake_resource_monitor.my_resource_monitor]

  # Map(Object) of grant information where the key is the role name.
  for_each = var.my_resource_monitor_grants

  privileges = each.value.my_resource_monitor_privileges
  role_name  = each.key
  on_account_object {
    object_type = var.object_type # "RESOURCE MONITOR"
    object_name = snowflake_resource_monitor.my_resource_monitor.name
  }
  with_grant_option = each.value.my_resource_monitor_with_grant_option
}

Expected Behavior

The privileges parameter of the snowflake_grant_privileges_to_role should only be marked as changed when the list of priveleges has been altered.

Actual Behavior

The privileges parameter of the snowflake_grant_privileges_to_role is marked as changed, regardless of any changes being made to the privileges parameter.

This image depicts 82 warehouse grant changes that were not actually changed - terraform plan output. terraform apply runs fine.
image

Steps to Reproduce

  1. terraform plan
  2. terraform apply

How much impact is this issue causing?

Medium

Logs

No response

Additional Information

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@bflad
Copy link
Contributor

bflad commented Dec 19, 2023

Hi @ToxicCypher 👋 Thank you for raising this and sorry you are running into trouble.

This issue tracker is for the hashicorp/random provider, which does not appear in your bug report. The Snowflake-Labs/snowflake provider mentioned in your bug report has an issue tracker available at (found via the "Source Code" link in the Registry): https://github.com/Snowflake-Labs/terraform-provider-snowflake and it looks like you already filed Snowflake-Labs/terraform-provider-snowflake#2281 there.

Since this does not appear to be an issue with this provider codebase, I'm going to close this issue.

@bflad bflad closed this as not planned Won't fix, can't repro, duplicate, stale Dec 19, 2023
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants