From d58b619a3d2edb644a848c0c539b18bfd83adc94 Mon Sep 17 00:00:00 2001 From: Radek Simko Date: Wed, 31 May 2023 09:14:58 +0100 Subject: [PATCH] schema/backends: Reflect 1.4 changes in gcs (#227) --- internal/schema/backends/gcs.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/internal/schema/backends/gcs.go b/internal/schema/backends/gcs.go index 5ec74737..41be2445 100644 --- a/internal/schema/backends/gcs.go +++ b/internal/schema/backends/gcs.go @@ -84,5 +84,20 @@ func gcsBackend(v *version.Version) *schema.BodySchema { delete(bodySchema.Attributes, "path") } + if v.GreaterThanOrEqual(v1_4_0) { + // https://github.com/hashicorp/terraform/commit/89ef27d3 + bodySchema.Attributes["storage_custom_endpoint"] = &schema.AttributeSchema{ + Constraint: schema.LiteralType{Type: cty.String}, + IsOptional: true, + Description: lang.Markdown("A URL containing three parts: the protocol, the DNS name pointing to a Private Service Connect endpoint, and the path for the Cloud Storage API (`/storage/v1/b`, [see here](https://cloud.google.com/storage/docs/json_api/v1/buckets/get#http-request))."), + } + // https://github.com/hashicorp/terraform/commit/d43ec0f30 + bodySchema.Attributes["kms_encryption_key"] = &schema.AttributeSchema{ + Constraint: schema.LiteralType{Type: cty.String}, + IsOptional: true, + Description: lang.Markdown("A Cloud KMS key ('customer managed encryption key') used when reading and writing state files in the bucket. Format should be 'projects/{{project}}/locations/{{location}}/keyRings/{{keyRing}}/cryptoKeys/{{name}}'."), + } + } + return bodySchema }