Skip to content

Commit 67a0b04

Browse files
anakovtAnastasiia Kovtun
and
Anastasiia Kovtun
authored
feat: Add labels support to projects bucket (#534)
Co-authored-by: Anastasiia Kovtun <nastia@Anastasiias-MacBook-Pro-2.local>
1 parent 4350c5d commit 67a0b04

File tree

5 files changed

+15
-0
lines changed

5 files changed

+15
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ determining that location is as follows:
113113
| activate\_apis | The list of apis to activate within the project | `list(string)` | <pre>[<br> "compute.googleapis.com"<br>]</pre> | no |
114114
| auto\_create\_network | Create the default network | `bool` | `false` | no |
115115
| billing\_account | The ID of the billing account to associate this project with | `string` | n/a | yes |
116+
| bucket\_labels | A map of key/value label pairs to assign to the bucket (optional) | `map` | `{}` | no |
116117
| bucket\_location | The location for a GCS bucket to create (optional) | `string` | `"US"` | no |
117118
| bucket\_name | A name for a GCS bucket to create (in the bucket\_project project), useful for Terraform state (optional) | `string` | `""` | no |
118119
| bucket\_project | A project to create a GCS bucket (bucket\_name) in, useful for Terraform state (optional) | `string` | `""` | no |

main.tf

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ module "project-factory" {
5555
bucket_name = var.bucket_name
5656
bucket_location = var.bucket_location
5757
bucket_versioning = var.bucket_versioning
58+
bucket_labels = var.bucket_labels
5859
auto_create_network = var.auto_create_network
5960
disable_services_on_destroy = var.disable_services_on_destroy
6061
default_service_account = var.default_service_account

modules/core_project_factory/main.tf

+1
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ resource "google_storage_bucket" "project_bucket" {
281281
name = local.project_bucket_name
282282
project = var.bucket_project == local.base_project_id ? google_project.main.project_id : var.bucket_project
283283
location = var.bucket_location
284+
labels = var.bucket_labels
284285

285286
versioning {
286287
enabled = var.bucket_versioning

modules/core_project_factory/variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,12 @@ variable "bucket_versioning" {
169169
default = false
170170
}
171171

172+
variable "bucket_labels" {
173+
description = " A map of key/value label pairs to assign to the bucket (optional)"
174+
type = map
175+
default = {}
176+
}
177+
172178
variable "auto_create_network" {
173179
description = "Create the default network"
174180
type = bool

variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,12 @@ variable "bucket_versioning" {
169169
default = false
170170
}
171171

172+
variable "bucket_labels" {
173+
description = " A map of key/value label pairs to assign to the bucket (optional)"
174+
type = map
175+
default = {}
176+
}
177+
172178
variable "auto_create_network" {
173179
description = "Create the default network"
174180
type = bool

0 commit comments

Comments
 (0)