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

fix(storage-bucket-object): do not delete object on update content, j… #7564

Conversation

modular-magician
Copy link
Collaborator

The aim of this is to avoid object deletion on content update, linked to hashicorp/terraform-provider-google#10488

before this PR :

# google_storage_bucket_object.gsn-psc-informations must be replaced
-/+ resource "google_storage_bucket_object" "test" {
      ~ content          = (sensitive value) # forces replacement
      ~ content_type     = "text/plain; charset=utf-8" -> (known after apply)
      ~ crc32c           = "+Yfdfw==" -> (known after apply)
      ~ detect_md5hash   = "4zoxBKTWpq0ORYqR4FRpCg==" -> "different hash" # forces replacement
      - event_based_hold = false -> null
      ~ id               = "test-test" -> (known after apply)
      ~ kms_key_name     = "projects/myproject/locations/myregion/keyRings/mykeyring/cryptoKeys/mykeyname/cryptoKeyVersions/1" -> (known after apply)
      ~ md5hash          = "4zoxBKTWpq0ORYqR4FRpCg==" -> (known after apply)
      ~ media_link       = "https://storage.googleapis.com/download/storage/v1/b/test/o/test?generation=1708531718170806&alt=media" -> (known after apply)
      - metadata         = {} -> null
        name             = "test"
      ~ output_name      = "test" -> (known after apply)
      ~ self_link        = "https://www.googleapis.com/storage/v1/b/test/o/test" -> (known after apply)
      ~ storage_class    = "STANDARD" -> (known after apply)
      - temporary_hold   = false -> null
        # (1 unchanged attribute hidden)
    }

After this PR :

# google_storage_bucket_object.gsn-psc-informations must be replaced
~ resource "google_storage_bucket_object" "test" {
      ~ content          = (sensitive value) 
      ~ detect_md5hash   = "4zoxBKTWpq0ORYqR4FRpCg==" -> "different hash" 
          id               = "test-test"
          name             = "test"
    }

you can test it with : https://github.com/public-cloud-wl/terraform-provider-google/releases/tag/v5.17.3
registry link : https://registry.terraform.io/providers/public-cloud-wl/google/latest

Release Note Template for Downstream PRs (will be copied)

storage: The update on `google_storage_bucket_object` content is now no more delete to create object, but just push a new object if the content change

Derived from GoogleCloudPlatform/magic-modules#10038

…… (#10038)

[upstream:672734df9f9288e14d854871815242b7af410e9f]

Signed-off-by: Modular Magician <[email protected]>
@modular-magician modular-magician merged commit 9d2620d into hashicorp:main Jun 18, 2024
4 checks passed
@modular-magician modular-magician deleted the downstream-pr-672734df9f9288e14d854871815242b7af410e9f branch November 16, 2024 03:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant