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

Automated Backup Failure #21602

Open
lbg-arber-gllogjani opened this issue Feb 25, 2025 · 2 comments · May be fixed by GoogleCloudPlatform/magic-modules#13326
Open

Automated Backup Failure #21602

lbg-arber-gllogjani opened this issue Feb 25, 2025 · 2 comments · May be fixed by GoogleCloudPlatform/magic-modules#13326

Comments

@lbg-arber-gllogjani
Copy link

lbg-arber-gllogjani commented Feb 25, 2025

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 a user, that user is claiming responsibility for the issue.
  • Customers working with a Google Technical Account Manager or Customer Engineer can ask them to reach out internally to expedite investigation and resolution of this issue.

Terraform Version & Provider Version(s)

Terraform v0.12.31
on Jenkins
provider registry.terraform.io/hashicorp/.google v6.22.0
provider registry.terraform.io/hashicorp/external v2.3.4

Affected Resource(s)

google_bigtable_table

Terraform Configuration

resource "google_bigtable_table" "table" {
  for_each            = var.bigtable_name
  name                  = each.value.name
  instance_name = google_bigtable_instance.instance.name
  split_keys          = each.value.split_keys
  project               = var.project

  column_family {
    family = each.value.column_family
  }

  automated_backup_policy {
    retention_period = var.retention_period
    frequency            = var.frequency
  }

  depends_on = [
    google_bigtable_instance.instance,
  ]
}

We have set the vars to:

variable "retention_period" {
  description = "The retention period of the bigtable table backups value in string"
  type        = string
  default     = "0h0m0s"
}


variable "frequency" {
  description = "The frequency in which you want the backups"
  type        = string
  default     = "0h0m0s"
}

and have also tried the following for completion:

variable "retention_period" {
  description = "The retention period of the bigtable table backups value in string"
  type        = string
  default     = "0"
}


variable "frequency" {
  description = "The frequency in which you want the backups"
  type        = string
  default     = "0"
}

Debug Output

No response

Expected Behavior

Terraform should have created a table with no backup as per the following documentation:

https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/bigtable_table#automated_backup_policy-1

automated_backup_policy Defines an automated backup policy for a table, specified by Retention Period and Frequency. To disable, set both Retention Period and Frequency to 0.

Actual Behavior

When creating an automated backup policy via terraform using the module google_bigtable_table we are seeing the following error:

Error: Error creating table. rpc error: code = InvalidArgument desc = Automated backup policy has an input retention period 0, which is out of the desired range of [72h, 2160h].

Google documentation states the following:

Image

Which we assume this is why the error tells us between 72 hours and 2160 hours. This is not clarified in Terraform documentation. We imagine that 0 is not actually allowed due to the restriction described in the screenshot above.

Google documentation: https://cloud.google.com/bigtable/docs/backups#retention

Steps to reproduce

  1. terraform apply

Important Factoids

No response

References

No response

b/401038219

@github-actions github-actions bot added forward/review In review; remove label to forward service/bigtableadmin labels Feb 25, 2025
@ggtisc ggtisc self-assigned this Mar 5, 2025
@ggtisc
Copy link
Collaborator

ggtisc commented Mar 5, 2025

Confirmed issue!

Terraform registry states the following: To disable, set both Retention Period and Frequency to 0 but even doing it as the user code or setting the value = 0 or "0" results in the same error message:

Error: Error creating table. rpc error: code = InvalidArgument desc = Automated backup policy has an input retention period 0, which is out of the desired range of [72h, 2160h].

  on main.tf line 42, in resource "google_bigtable_table" "bigtable_21602":
  42: resource "google_bigtable_table" "bigtable_21602" {

@ggtisc ggtisc removed their assignment Mar 5, 2025
@ggtisc ggtisc removed the forward/review In review; remove label to forward label Mar 5, 2025
@tomzx
Copy link

tomzx commented Mar 7, 2025

Either the documentation needs to be updated to indicate that leaving those out of the google_bigtable_table will not enable them, or the implementation needs to be updated to respect the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants