Add tag_bindings to Artifact Registry and Secret Manager modules. (#3220)

* Add `tag_bindings` to Artifact Registry and Secret Manager modules.

* Fix linting

* Fix README
This commit is contained in:
Julio Castillo
2025-07-07 18:21:54 +02:00
committed by GitHub
parent bd21b92504
commit 02a9bdfe2b
6 changed files with 43 additions and 5 deletions

View File

@@ -313,6 +313,7 @@ module "additive_iam" {
| [iam_bindings_additive](variables-iam.tf#L58) | Individual additive IAM bindings. Keys are arbitrary. | <code title="map&#40;object&#40;&#123;&#10; member &#61; string&#10; role &#61; string&#10; condition &#61; optional&#40;object&#40;&#123;&#10; expression &#61; string&#10; title &#61; string&#10; description &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;&#10;&#125;&#41;&#41;">map&#40;object&#40;&#123;&#8230;&#125;&#41;&#41;</code> | | <code>&#123;&#125;</code> |
| [iam_by_principals](variables-iam.tf#L73) | Authoritative IAM binding in {PRINCIPAL => [ROLES]} format. Principals need to be statically defined to avoid cycle errors. Merged internally with the `iam` variable. | <code>map&#40;list&#40;string&#41;&#41;</code> | | <code>&#123;&#125;</code> |
| [labels](variables.tf#L206) | Labels to be attached to the registry. | <code>map&#40;string&#41;</code> | | <code>&#123;&#125;</code> |
| [tag_bindings](variables.tf#L227) | Tag bindings for this repository, in key => tag value id format. | <code>map&#40;string&#41;</code> | | <code>&#123;&#125;</code> |
## Outputs

View File

@@ -1,5 +1,5 @@
/**
* Copyright 2024 Google LLC
* Copyright 2025 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -217,3 +217,10 @@ resource "google_artifact_registry_repository" "registry" {
}
}
resource "google_tags_location_tag_binding" "binding" {
for_each = var.tag_bindings
parent = "//artifactregistry.googleapis.com/${google_artifact_registry_repository.registry.id}"
location = var.location
tag_value = each.value
}

View File

@@ -223,3 +223,10 @@ variable "project_id" {
description = "Registry project id."
type = string
}
variable "tag_bindings" {
description = "Tag bindings for this repository, in key => tag value id format."
type = map(string)
nullable = false
default = {}
}