terraform-provider-b2 icon indicating copy to clipboard operation
terraform-provider-b2 copied to clipboard

cors_rules.allowed_operations are not stable

Open cinemast opened this issue 6 months ago • 2 comments

Hi!

I define a bucket with cors rules using the following:

resource "b2_bucket" "media_bucket" {
  bucket_name = "example-${terraform.workspace}"
  bucket_type = "allPrivate"
  cors_rules {
    allowed_operations = [ "s3_put", "s3_head", "s3_get" ]
    allowed_origins = [ "https://app.${local.env[terraform.workspace].domain}", "http://localhost:5173"]
    cors_rule_name = "example-cors-${terraform.workspace}"
    max_age_seconds = 60
  }
}

It updates as expected, however, if I run again using terraform apply I again get the same change suggested

resource "b2_bucket" "media_bucket" {
        id          = "<id>"
        # (7 unchanged attributes hidden)

      ~ cors_rules {
          ~ allowed_operations = [
              - "s3_head",
                "s3_put",
              + "s3_head",
                "s3_get",
            ]
            # (5 unchanged attributes hidden)
        }

        # (2 unchanged blocks hidden)
    }

Which should be a no-op.

cinemast avatar Aug 01 '24 11:08 cinemast