Skip to content

Commit

Permalink
feat: Add labels support to projects bucket (#534)
Browse files Browse the repository at this point in the history
Co-authored-by: Anastasiia Kovtun <nastia@Anastasiias-MacBook-Pro-2.local>
  • Loading branch information
anakovt and Anastasiia Kovtun authored Jan 14, 2021
1 parent 4350c5d commit 67a0b04
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ determining that location is as follows:
| activate\_apis | The list of apis to activate within the project | `list(string)` | <pre>[<br> "compute.googleapis.com"<br>]</pre> | no |
| auto\_create\_network | Create the default network | `bool` | `false` | no |
| billing\_account | The ID of the billing account to associate this project with | `string` | n/a | yes |
| bucket\_labels | A map of key/value label pairs to assign to the bucket (optional) | `map` | `{}` | no |
| bucket\_location | The location for a GCS bucket to create (optional) | `string` | `"US"` | no |
| bucket\_name | A name for a GCS bucket to create (in the bucket\_project project), useful for Terraform state (optional) | `string` | `""` | no |
| bucket\_project | A project to create a GCS bucket (bucket\_name) in, useful for Terraform state (optional) | `string` | `""` | no |
Expand Down
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ module "project-factory" {
bucket_name = var.bucket_name
bucket_location = var.bucket_location
bucket_versioning = var.bucket_versioning
bucket_labels = var.bucket_labels
auto_create_network = var.auto_create_network
disable_services_on_destroy = var.disable_services_on_destroy
default_service_account = var.default_service_account
Expand Down
1 change: 1 addition & 0 deletions modules/core_project_factory/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ resource "google_storage_bucket" "project_bucket" {
name = local.project_bucket_name
project = var.bucket_project == local.base_project_id ? google_project.main.project_id : var.bucket_project
location = var.bucket_location
labels = var.bucket_labels

versioning {
enabled = var.bucket_versioning
Expand Down
6 changes: 6 additions & 0 deletions modules/core_project_factory/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,12 @@ variable "bucket_versioning" {
default = false
}

variable "bucket_labels" {
description = " A map of key/value label pairs to assign to the bucket (optional)"
type = map
default = {}
}

variable "auto_create_network" {
description = "Create the default network"
type = bool
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,12 @@ variable "bucket_versioning" {
default = false
}

variable "bucket_labels" {
description = " A map of key/value label pairs to assign to the bucket (optional)"
type = map
default = {}
}

variable "auto_create_network" {
description = "Create the default network"
type = bool
Expand Down

0 comments on commit 67a0b04

Please sign in to comment.