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

schema/backends: Reflect 1.4 changes in gcs #227

Merged
merged 1 commit into from
May 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions internal/schema/backends/gcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}