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

google_storage_bucket.website deletion results in permadiff #12870

Comments

@Akaame
Copy link

Akaame commented Oct 25, 2022

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.
  • If an issue is assigned to the modular-magician user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned to hashibot, a community member has claimed the issue already.

Terraform Version

Terraform v1.3.2
on darwin_arm64
+ provider registry.terraform.io/hashicorp/google v4.41.0

Affected Resource(s)

google_storage_bucket.website

Terraform Configuration Files

resource "google_storage_bucket" "default" {
  // stuff...

  // removal of the block below does not result in Website configuration for bucket to be changed
  website {
      main_page_suffix = try(var.website_config["main_page_suffix"], "index.html")
      not_found_page   = try(var.website_config["not_found_page"], "404.html")
  }
}

Expected Behavior

Deletion of website block should have caused bucket's website configuration subfields to be empty values.

Actual Behavior

Website block deletion is respected in .tfstate but not applied to the actual resource (old values still visible on UI) resulting in a permadiff.

Steps to Reproduce

  1. Create a bucket via terraform with its website block set.
  2. terraform apply
  3. Validate on GCP that bucket is indeed created with the given website configuration.
  4. Remove the block and terraform apply again.
  5. Observe that the values still remain and are not empty.
@Akaame Akaame added the bug label Oct 25, 2022
@edwardmedia edwardmedia self-assigned this Oct 25, 2022
@edwardmedia
Copy link
Contributor

edwardmedia commented Oct 26, 2022

@Akaame I don't think the api supports this. Once you have enabled the website, the api accepts updates with new values, but not empty. Let me know if you can achieve below behavior using other methods.

Deletion of website block should have caused bucket's website configuration subfields to be empty values.

Yes, showing permdiff is a bug. Before I have a fix for that, I want to make sure above Actual Behavior is incorrect.

c2thorn pushed a commit to GoogleCloudPlatform/magic-modules that referenced this issue Nov 17, 2022
modular-magician added a commit to modular-magician/terraform-provider-google-beta that referenced this issue Nov 17, 2022
modular-magician added a commit to modular-magician/terraform-provider-google that referenced this issue Nov 17, 2022
Co-authored-by: Edward Sun <[email protected]>
Fixes hashicorp#12870

Signed-off-by: Modular Magician <[email protected]>
modular-magician added a commit to hashicorp/terraform-provider-google-beta that referenced this issue Nov 17, 2022
Co-authored-by: Edward Sun <[email protected]>
Fixes hashicorp/terraform-provider-google#12870

Signed-off-by: Modular Magician <[email protected]>

Signed-off-by: Modular Magician <[email protected]>
modular-magician added a commit that referenced this issue Nov 17, 2022
Co-authored-by: Edward Sun <[email protected]>
Fixes #12870

Signed-off-by: Modular Magician <[email protected]>

Signed-off-by: Modular Magician <[email protected]>
modular-magician added a commit to modular-magician/terraform-validator that referenced this issue Nov 17, 2022
Co-authored-by: Edward Sun <[email protected]>
Fixes hashicorp/terraform-provider-google#12870

Signed-off-by: Modular Magician <[email protected]>
modular-magician added a commit to GoogleCloudPlatform/terraform-validator that referenced this issue Nov 17, 2022
Co-authored-by: Edward Sun <[email protected]>
Fixes hashicorp/terraform-provider-google#12870

Signed-off-by: Modular Magician <[email protected]>

Signed-off-by: Modular Magician <[email protected]>
googlerjk pushed a commit to googlerjk/magic-modules that referenced this issue Nov 22, 2022
googlerjk pushed a commit to googlerjk/magic-modules that referenced this issue Nov 25, 2022
kimihrr pushed a commit to kimihrr/kimiah-magic-modules that referenced this issue Dec 6, 2022
hao-nan-li pushed a commit to hao-nan-li/magic-modules that referenced this issue Dec 6, 2022
@github-actions
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 Dec 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.