Add bucket_create to modules/gcs (#2827)

* Add `bucket_create` to `modules/gcs`

* Create local with bucket name

* Update variable description

* Fix bucket output

* Fix tests

* Fix tests

* Bump OpenTofu to 1.9.0 (needed for multi-var validations)
This commit is contained in:
Julio Castillo
2025-01-21 23:48:36 +01:00
committed by GitHub
parent bb1325403e
commit 8a2320311d
124 changed files with 358 additions and 200 deletions

View File

@@ -1,5 +1,5 @@
/**
* Copyright 2024 Google LLC
* Copyright 2025 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,6 +20,12 @@ variable "autoclass" {
default = null
}
variable "bucket_create" {
description = "Create bucket."
type = bool
default = true
}
variable "cors" {
description = "CORS configuration for the bucket. Defaults to null."
type = object({
@@ -168,7 +174,11 @@ variable "lifecycle_rules" {
variable "location" {
description = "Bucket location."
type = string
# default = "EU"
default = null
validation {
condition = ((var.bucket_create == true) == (var.location != null))
error_message = "Bucket location is required if and only if bucket_create is true."
}
}
variable "logging_config" {