diff --git a/.changelog/4282.txt b/.changelog/4282.txt new file mode 100644 index 00000000000..f6ce53062d8 --- /dev/null +++ b/.changelog/4282.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +bigtable: added support for specifying `duration` for `bigtable_gc_policy` to allow durations shorter than a day +``` diff --git a/google/resource_bigtable_gc_policy.go b/google/resource_bigtable_gc_policy.go index 1a440268ce3..3c05485780a 100644 --- a/google/resource_bigtable_gc_policy.go +++ b/google/resource_bigtable_gc_policy.go @@ -58,6 +58,7 @@ func resourceBigtableGCPolicy() *schema.Resource { Optional: true, ForceNew: true, Description: `GC policy that applies to all cells older than the given age.`, + MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "days": { @@ -86,10 +87,9 @@ func resourceBigtableGCPolicy() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "number": { - Type: schema.TypeInt, - Required: true, - Description: `Number of version before applying the GC policy.`, - ValidateFunc: validation.IntAtLeast(1), + Type: schema.TypeInt, + Required: true, + Description: `Number of version before applying the GC policy.`, }, }, }, diff --git a/website/docs/r/bigtable_gc_policy.html.markdown b/website/docs/r/bigtable_gc_policy.html.markdown index 8454cb71415..7c6ff3c237c 100644 --- a/website/docs/r/bigtable_gc_policy.html.markdown +++ b/website/docs/r/bigtable_gc_policy.html.markdown @@ -42,7 +42,7 @@ resource "google_bigtable_gc_policy" "policy" { column_family = "name" max_age { - duration = "168h" # 7 days + duration = "168h" } } ``` @@ -89,9 +89,9 @@ The following arguments are supported: `max_age` supports the following arguments: -* `days` - (Deprecated) Number of days before applying GC policy. +* `days` - (Optional, Deprecated in favor of duration) Number of days before applying GC policy. -* `duration` - (Required) Duration before applying GC policy (ex. "8h"). This is required when `days` isn't set +* `duration` - (Optional) Duration before applying GC policy (ex. "8h"). This is required when `days` isn't set -----