From a98e7fe4c9cac7aa54ae4ddcb8f8dc8fa31a36cb Mon Sep 17 00:00:00 2001 From: Kevin Labesse Date: Mon, 21 Dec 2020 09:12:25 +0100 Subject: [PATCH] fix ExactlyOneOf --- .../resources/resource_bigtable_gc_policy.go | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/third_party/terraform/resources/resource_bigtable_gc_policy.go b/third_party/terraform/resources/resource_bigtable_gc_policy.go index bc7ea03ba375..1a440268ce31 100644 --- a/third_party/terraform/resources/resource_bigtable_gc_policy.go +++ b/third_party/terraform/resources/resource_bigtable_gc_policy.go @@ -54,24 +54,25 @@ func resourceBigtableGCPolicy() *schema.Resource { }, "max_age": { - Type: schema.TypeList, - Optional: true, - ForceNew: true, - Description: `GC policy that applies to all cells older than the given age.`, - ExactlyOneOf: []string{"max_age.0.days", "max_age.0.duration"}, + Type: schema.TypeList, + Optional: true, + ForceNew: true, + Description: `GC policy that applies to all cells older than the given age.`, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "days": { - Type: schema.TypeInt, - Optional: true, - Deprecated: "Deprecated in favor of duration", - Description: `Number of days before applying GC policy.`, + Type: schema.TypeInt, + Optional: true, + Deprecated: "Deprecated in favor of duration", + Description: `Number of days before applying GC policy.`, + ExactlyOneOf: []string{"max_age.0.days", "max_age.0.duration"}, }, "duration": { Type: schema.TypeString, Optional: true, Description: `Duration before applying GC policy`, ValidateFunc: validateDuration(), + ExactlyOneOf: []string{"max_age.0.days", "max_age.0.duration"}, }, }, },