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

GCS Lifecycle rule with Age="0" returns invalid argument error #12585

Closed
janosif opened this issue Sep 19, 2022 · 1 comment · Fixed by GoogleCloudPlatform/magic-modules#6573, hashicorp/terraform-provider-google-beta#4698 or #12593
Assignees
Labels

Comments

@janosif
Copy link

janosif commented Sep 19, 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.2.8
+ provider registry.terraform.io/hashicorp/google v4.36.0

Affected Resource(s)

  • google_storage_bucket

Terraform Configuration Files

resource "google_storage_bucket" "test_bucket_1" {
  name     = "test-bucket-1"
  location = "us-east1"

  uniform_bucket_level_access = true

  lifecycle_rule {
    condition {
     # THE BUG IS WITH AGE = "0". AGE = "1" WORKS.
      age = "0"
    }
    action {
      type = "Delete"
    }
  }
}

Debug Output

https://gist.github.com/janosif/4cffa7d00f167fc962861f52c84db3b9

Panic Output

Expected Behavior

The GCS bucket successfully created. (It should be successfully created with lifecycle rule of Age="0")

Actual Behavior

Invalid argument error is returned (Error: googleapi: Error 400: Invalid argument., invalid)

Steps to Reproduce

  1. terraform apply

Important Factoids

  • If we change age = "0" to age = "1" in the terraform configuration file the GCS bucket can be successfully created.
  • Age = "0" works from Google Cloud Console and command line.

References

  • #0000
@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 Oct 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
2 participants