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:
@@ -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" {
|
||||
|
||||
Reference in New Issue
Block a user