Extend support for tag bindings to more modules (#2307)

* fix kms tag bindings

* bigquery dataset

* fix bigquery

* cloud run

* normalize variable type

* rename gcs heading

* kms example test

* fix bigquery

* fix cloud run

* cloud run v2
This commit is contained in:
Ludovico Magnocavallo
2024-05-25 10:42:45 +02:00
committed by GitHub
parent 735fd79cce
commit c80af8de66
15 changed files with 335 additions and 84 deletions

View File

@@ -8,7 +8,7 @@
- [GCS notifications](#gcs-notifications)
- [Object upload](#object-upload)
- [IAM](#iam)
- [Tags](#tags)
- [Tag Bindings](#tag-bindings)
- [Variables](#variables)
- [Outputs](#outputs)
<!-- END TOC -->
@@ -247,7 +247,7 @@ module "bucket" {
# tftest modules=1 resources=2 inventory=iam-bindings-additive.yaml e2e
```
## Tags
## Tag Bindings
Refer to the [Creating and managing tags](https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing) documentation for details on usage.
@@ -307,10 +307,10 @@ module "bucket" {
| [retention_policy](variables.tf#L236) | Bucket retention policy. | <code title="object&#40;&#123;&#10; retention_period &#61; number&#10; is_locked &#61; optional&#40;bool&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>null</code> |
| [soft_delete_retention](variables.tf#L245) | The duration in seconds that soft-deleted objects in the bucket will be retained and cannot be permanently deleted. Set to 0 to override the default and disable. | <code>number</code> | | <code>null</code> |
| [storage_class](variables.tf#L251) | Bucket storage class. | <code>string</code> | | <code>&#34;MULTI_REGIONAL&#34;</code> |
| [tag_bindings](variables.tf#L261) | Tag bindings for this folder, in key => tag value id format. | <code>map&#40;string&#41;</code> | | <code>null</code> |
| [uniform_bucket_level_access](variables.tf#L267) | Allow using object ACLs (false) or not (true, this is the recommended behavior) , defaults to true (which is the recommended practice, but not the behavior of storage API). | <code>bool</code> | | <code>true</code> |
| [versioning](variables.tf#L273) | Enable versioning, defaults to false. | <code>bool</code> | | <code>false</code> |
| [website](variables.tf#L279) | Bucket website. | <code title="object&#40;&#123;&#10; main_page_suffix &#61; optional&#40;string&#41;&#10; not_found_page &#61; optional&#40;string&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>null</code> |
| [tag_bindings](variables.tf#L261) | Tag bindings for this folder, in key => tag value id format. | <code>map&#40;string&#41;</code> | | <code>&#123;&#125;</code> |
| [uniform_bucket_level_access](variables.tf#L268) | Allow using object ACLs (false) or not (true, this is the recommended behavior) , defaults to true (which is the recommended practice, but not the behavior of storage API). | <code>bool</code> | | <code>true</code> |
| [versioning](variables.tf#L274) | Enable versioning, defaults to false. | <code>bool</code> | | <code>false</code> |
| [website](variables.tf#L280) | Bucket website. | <code title="object&#40;&#123;&#10; main_page_suffix &#61; optional&#40;string&#41;&#10; not_found_page &#61; optional&#40;string&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>null</code> |
## Outputs

View File

@@ -15,7 +15,7 @@
*/
resource "google_tags_location_tag_binding" "binding" {
for_each = coalesce(var.tag_bindings, {})
for_each = var.tag_bindings
parent = "//storage.googleapis.com/projects/_/buckets/${local.prefix}${lower(var.name)}"
tag_value = each.value
location = var.location

View File

@@ -261,7 +261,8 @@ variable "storage_class" {
variable "tag_bindings" {
description = "Tag bindings for this folder, in key => tag value id format."
type = map(string)
default = null
nullable = false
default = {}
}
variable "uniform_bucket_level_access" {