hashicorp / terraform-provider-google

Terraform Provider for Google Cloud Platform
https://registry.terraform.io/providers/hashicorp/google/latest/docs
Mozilla Public License 2.0
2.28k stars 1.72k forks source link

Reordering of google_bigquery_dataset.access and every change #7142

Open red8888 opened 4 years ago

red8888 commented 4 years ago

Affected Resource(s)

If i have this:

resource "google_bigquery_dataset" "sdfsdfdsf" {
  dataset_id = "sdfsdfsdf"
  location   = "US"

  access {
    role          = "OWNER"
    special_group = "projectOwners"
  }

And then I add another permission to it

resource "google_bigquery_dataset" "sdfsdfdsf" {
  dataset_id = "sdfsdfsdf"
  location   = "US"

  access {
    role          = "OWNER"
    special_group = "projectOwners"
  }

  access {
    role   = "READER"
    domain = "hashicorp.com"
  }

In the plan terraform says its going to remove the first access{} entry and re-add it

This means every time I add an access{} entry the plans shows all exists access entries being removed and readded

b/303987063

venkykuberan commented 4 years ago

It could be due to data type issue, access is defined as a typeSet and may need to change to typeList

DanCech commented 2 years ago

I'm seeing this same issue, resulting in a lot of work to try and decipher diffs against large access rule sets. I did a little digging to try and figure out what might be going on, and it seems like TypeSet should work so long as the hashing algorithm works correctly, but it's using the generic hashing algorithm so it's possible that the optional fields are tripping it up?