Skip to content

Commit

Permalink
feat: add force_destroy option for state bucket (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronNBrock committed Mar 22, 2021
1 parent 8d453a4 commit 50ce28f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ For the cloudbuild submodule, see the README [cloudbuild](./modules/cloudbuild).
| billing\_account | The ID of the billing account to associate projects with. | `string` | n/a | yes |
| default\_region | Default region to create resources where applicable. | `string` | `"us-central1"` | no |
| folder\_id | The ID of a folder to host this project | `string` | `""` | no |
| force\_destroy | If supplied, the state bucket will be deleted even while containing objects. | `bool` | `false` | no |
| grant\_billing\_user | Grant roles/billing.user role to CFT service account | `bool` | `true` | no |
| group\_billing\_admins | Google Group for GCP Billing Administrators | `string` | n/a | yes |
| group\_org\_admins | Google Group for GCP Organization Administrators | `string` | n/a | yes |
Expand Down
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ resource "google_storage_bucket" "org_terraform_state" {
name = local.state_bucket_name
location = var.default_region
labels = var.storage_bucket_labels
force_destroy = var.force_destroy
uniform_bucket_level_access = true
versioning {
enabled = true
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,12 @@ variable "storage_bucket_labels" {
default = {}
}

variable "force_destroy" {
description = "If supplied, the state bucket will be deleted even while containing objects."
type = bool
default = false
}

variable "org_admins_org_iam_permissions" {
description = "List of permissions granted to the group supplied in group_org_admins variable across the GCP organization."
type = list(string)
Expand Down

0 comments on commit 50ce28f

Please sign in to comment.