Skip to content

Commit

Permalink
refactor: update resource manager tag references (#12132) (#838)
Browse files Browse the repository at this point in the history
[upstream:e206f391912060d32350f824af775a895062c9e2]

Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
modular-magician authored Oct 31, 2024
1 parent b1f39e4 commit 2f135f8
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions bigquery_dataset_resource_tags/main.tf
Original file line number Diff line number Diff line change
@@ -1,34 +1,33 @@
data "google_project" "project" {
}
data "google_project" "project" {}

resource "google_tags_tag_key" "tag_key1" {
parent = "projects/${data.google_project.project.number}"
parent = data.google_project.project.id
short_name = "tag_key1-${local.name_suffix}"
}

resource "google_tags_tag_value" "tag_value1" {
parent = "tagKeys/${google_tags_tag_key.tag_key1.name}"
parent = google_tags_tag_key.tag_key1.id
short_name = "tag_value1-${local.name_suffix}"
}

resource "google_tags_tag_key" "tag_key2" {
parent = "projects/${data.google_project.project.number}"
parent = data.google_project.project.id
short_name = "tag_key2-${local.name_suffix}"
}

resource "google_tags_tag_value" "tag_value2" {
parent = "tagKeys/${google_tags_tag_key.tag_key2.name}"
parent = google_tags_tag_key.tag_key2.id
short_name = "tag_value2-${local.name_suffix}"
}

resource "google_bigquery_dataset" "dataset" {
dataset_id = "dataset-${local.name_suffix}"
friendly_name = "test"
description = "This is a test description"
location = "EU"
dataset_id = "dataset-${local.name_suffix}"
friendly_name = "test"
description = "This is a test description"
location = "EU"

resource_tags = {
"${data.google_project.project.project_id}/${google_tags_tag_key.tag_key1.short_name}" = "${google_tags_tag_value.tag_value1.short_name}"
"${data.google_project.project.project_id}/${google_tags_tag_key.tag_key2.short_name}" = "${google_tags_tag_value.tag_value2.short_name}"
(google_tags_tag_key.tag_key1.namespaced_name) = google_tags_tag_value.tag_value1.short_name
(google_tags_tag_key.tag_key2.namespaced_name) = google_tags_tag_value.tag_value2.short_name
}
}

0 comments on commit 2f135f8

Please sign in to comment.