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:
@@ -313,6 +313,7 @@ module "additive_iam" {
|
||||
| [iam_bindings_additive](variables-iam.tf#L58) | Individual additive IAM bindings. Keys are arbitrary. | <code title="map(object({ member = string role = string condition = optional(object({ expression = string title = string description = optional(string) })) }))">map(object({…}))</code> | | <code>{}</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(list(string))</code> | | <code>{}</code> |
|
||||
| [labels](variables.tf#L206) | Labels to be attached to the registry. | <code>map(string)</code> | | <code>{}</code> |
|
||||
| [tag_bindings](variables.tf#L227) | Tag bindings for this repository, in key => tag value id format. | <code>map(string)</code> | | <code>{}</code> |
|
||||
|
||||
## Outputs
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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 = {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user