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

feat: allow setting state bucket name #235

Merged
merged 1 commit into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion modules/bootstrap/gcp/tf-state-bucket.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
resource "google_storage_bucket" "tf_state" {
name = "${local.name_prefix}-tf-state"
name = local.tf_state_bucket_name
project = local.project
location = local.tf_state_bucket_location
versioning {
Expand Down
4 changes: 4 additions & 0 deletions modules/bootstrap/gcp/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ variable "tf_state_bucket_location" {
variable "tf_state_bucket_force_destroy" {
default = false
}
variable "tf_state_bucket_name" {
default = ""
}
variable "enable_services" {
default = true
}
Expand All @@ -18,5 +21,6 @@ locals {
name_prefix = var.name_prefix
tf_state_bucket_location = var.tf_state_bucket_location
tf_state_bucket_force_destroy = var.tf_state_bucket_force_destroy
tf_state_bucket_name = var.tf_state_bucket_name != "" ? var.tf_state_bucket_name : "${var.name_prefix}-tf-state"
project = var.gcp_project
}
Loading