Skip to content

Commit

Permalink
feat: allow setting state bucket name (#235)
Browse files Browse the repository at this point in the history
  • Loading branch information
krtk6160 authored Nov 22, 2024
1 parent 3b8f9e7 commit 228d7d0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
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
}

0 comments on commit 228d7d0

Please sign in to comment.