hashicorp / terraform-provider-google

Terraform Provider for Google Cloud Platform
https://registry.terraform.io/providers/hashicorp/google/latest/docs
Mozilla Public License 2.0
2.29k stars 1.72k forks source link

Support for schedule Backup functionality for Bigtable using terraform #18722

Open chchaffin opened 2 months ago

chchaffin commented 2 months ago

Community Note

Description

A related issue was marked as closed, but we still don't have a way to set scheduled backups using terraform. As @SarahFrench pointed out a month ago, BigTable API now supports scheduled backups. However, I'm not sure why this issue, https://github.com/hashicorp/terraform-provider-google/issues/12191#issuecomment-2154796124, was closed.

New or Affected Resource(s)

Potential Terraform Configuration

table_id = "foo"
expiration_time = "7d"

References

https://github.com/hashicorp/terraform-provider-google/issues/12191

b/352830525

SarahFrench commented 2 months ago

In v5.34.0 this was released to the GA and Beta versions of the provider:

bigtable: added automated_backup_configuration field to google_bigtable_table resource

It looks like the field wasn't documented. I'll mark this issue as a documentation issue.

You should be able to use the released fields with v5.34.0 and above despite them not being documented. For now you can refer to this code for descriptions of those fields:

resource "google_bigtable_table" "table" {
  name          = "my-table"
  instance_name = google_bigtable_instance.instance.name
  automated_backup_policy {
    retention_period =  "72h0m0s"
    frequency = "24h0m0s"
  }
}