Skip to content

Commit 13b42ae

Browse files
Fabrizio CafollaFabrizio Cafolla
authored andcommitted
fix: update docs
1 parent a541bbc commit 13b42ae

File tree

4 files changed

+19
-4
lines changed

4 files changed

+19
-4
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,9 @@ In the module output you can retrieve all tags keys and values informations.
5555

5656
| Name | Description | Type | Default | Required |
5757
|------|-------------|------|---------|:--------:|
58-
| <a name="input_buckets_to_be_tagged"></a> [buckets\_to\_be\_tagged](#input\_buckets\_to\_be\_tagged) | A structured list of objects, containing the list of buckets we want to tag and the tag values, in the form `<TAG_KEY_SHORTNAME>/<TAG_VALUE_SHORTNAME>`. If no bucket\_location is specified, the value of default\_location will be used. | <pre>list(object({<br> bucket_name = string<br> tags = optional(list(string), [])<br> bucket_location = optional(string, null)<br> }))</pre> | `[]` | no |
59-
| <a name="input_cloudsql_instances_to_be_tagged"></a> [cloudsql\_instances\_to\_be\_tagged](#input\_cloudsql\_instances\_to\_be\_tagged) | A structured list of objects, containing the list of cloudSQL instances we want to tag, with instance name, instance location (region) and tag values. | <pre>list(object({<br> instance_id = string<br> tags = optional(list(string), [])<br> instance_location = optional(string, null)<br> }))</pre> | `[]` | no |
58+
| <a name="input_artifact_registry_repositories_to_be_tagged"></a> [artifact\_registry\_repositories\_to\_be\_tagged](#input\_artifact\_registry\_repositories\_to\_be\_tagged) | A structured list of objects, containing the list of repositories we want to tag, with repository id, repository location (region) and tag values. | <pre>list(object({<br> repository_id = string<br> repository_location = optional(string, null)<br> tags = optional(list(string), [])<br> }))</pre> | `[]` | no |
59+
| <a name="input_buckets_to_be_tagged"></a> [buckets\_to\_be\_tagged](#input\_buckets\_to\_be\_tagged) | A structured list of objects, containing the list of buckets we want to tag and the tag values, in the form `<TAG_KEY_SHORTNAME>/<TAG_VALUE_SHORTNAME>`. If no bucket\_location is specified, the value of default\_location will be used. | <pre>list(object({<br> bucket_name = string<br> bucket_location = optional(string, null)<br> tags = optional(list(string), [])<br> }))</pre> | `[]` | no |
60+
| <a name="input_cloudsql_instances_to_be_tagged"></a> [cloudsql\_instances\_to\_be\_tagged](#input\_cloudsql\_instances\_to\_be\_tagged) | A structured list of objects, containing the list of cloudSQL instances we want to tag, with instance name, instance location (region) and tag values. | <pre>list(object({<br> instance_id = string<br> instance_location = optional(string, null)<br> tags = optional(list(string), [])<br> }))</pre> | `[]` | no |
6061
| <a name="input_default_location"></a> [default\_location](#input\_default\_location) | The default location (region) used for the resources to be tagged. | `string` | n/a | yes |
6162
| <a name="input_global_tags"></a> [global\_tags](#input\_global\_tags) | A list of tags to be applied to all the resources, in the form tag\_key\_short\_name/tag\_value\_short\_name. If a resource specify a list of tags, the global tags will overridden and replaced by those specified in the resource. | `list(string)` | `[]` | no |
6263
| <a name="input_project_id"></a> [project\_id](#input\_project\_id) | The Google Cloud project ID. | `string` | n/a | yes |
@@ -74,9 +75,9 @@ In the module output you can retrieve all tags keys and values informations.
7475

7576
| Name | Type |
7677
|------|------|
78+
| [google_tags_location_tag_binding.artifact_registry](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/tags_location_tag_binding) | resource |
7779
| [google_tags_location_tag_binding.buckets](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/tags_location_tag_binding) | resource |
7880
| [google_tags_location_tag_binding.cloudsql](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/tags_location_tag_binding) | resource |
79-
| [google_project.project](https://registry.terraform.io/providers/hashicorp/google/latest/docs/data-sources/project) | data source |
8081
| [google_tags_tag_key.project_tag_keys_to_discover](https://registry.terraform.io/providers/hashicorp/google/latest/docs/data-sources/tags_tag_key) | data source |
8182
| [google_tags_tag_key.tag_keys](https://registry.terraform.io/providers/hashicorp/google/latest/docs/data-sources/tags_tag_key) | data source |
8283
| [google_tags_tag_value.project_tag_values_to_be_discovered](https://registry.terraform.io/providers/hashicorp/google/latest/docs/data-sources/tags_tag_value) | data source |

examples/main.tf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,18 @@ locals {
2727
]
2828
},
2929
]
30+
31+
artifact_registry_repositories_to_be_tagged = [
32+
{
33+
repository_id = "repository-1"
34+
tags = [
35+
"dev-team/editor", "external-team/editor"
36+
]
37+
},
38+
{
39+
repository_id = "repository-2"
40+
}
41+
]
3042
}
3143

3244
# ------------------------------
@@ -36,6 +48,7 @@ module "project_resources_tags" {
3648
project_id = "my-project-id"
3749
tags_to_be_discovered = local.tags_to_discover
3850
buckets_to_be_tagged = local.buckets_to_tag
51+
artifact_registry_repositories_to_be_tagged = local.artifact_registry_repositories_to_be_tagged
3952
global_tags = [
4053
"dev-team/editor", "external-team/viewer"
4154
]

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ resource "google_tags_location_tag_binding" "cloudsql" {
155155
tag_value = data.google_tags_tag_value.tag_values[each.value.tag_friendly_name].id
156156
}
157157

158+
# Tag bindings for Artifact Registry repositories.
158159
resource "google_tags_location_tag_binding" "artifact_registry" {
159160
for_each = local.map_of_artifact_registry_repositories_to_be_tagged
160161
# Parent full resource name reference: https://cloud.google.com/artifact-registry/docs/repositories/tag-repos#attach

variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ variable "cloudsql_instances_to_be_tagged" {
4141
}
4242

4343
variable "artifact_registry_repositories_to_be_tagged" {
44-
description = "A structured list of objects, containing the list of Artifact registry we want to tag, with instance name, instance location (region) and tag values."
44+
description = "A structured list of objects, containing the list of repositories we want to tag, with repository id, repository location (region) and tag values."
4545
type = list(object({
4646
repository_id = string
4747
repository_location = optional(string, null)

0 commit comments

Comments
 (0)