Skip to content

Commit

Permalink
refactor: update resource manager tag references (GoogleCloudPlatform…
Browse files Browse the repository at this point in the history
  • Loading branch information
wyardley authored and BBBmau committed Nov 5, 2024
1 parent d193e37 commit b97bf4c
Show file tree
Hide file tree
Showing 13 changed files with 101 additions and 101 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -782,22 +782,22 @@ 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 = "tf_test_tag_key1%{random_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 = "tf_test_tag_value1%{random_suffix}"
}
resource "google_tags_tag_key" "tag_key2" {
parent = "projects/${data.google_project.project.number}"
parent = data.google_project.project.id
short_name = "tf_test_tag_key2%{random_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 = "tf_test_tag_value2%{random_suffix}"
}
Expand All @@ -808,8 +808,8 @@ resource "google_bigquery_dataset" "dataset" {
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
}
}
`, context)
Expand All @@ -821,22 +821,22 @@ 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 = "tf_test_tag_key1%{random_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 = "tf_test_tag_value1%{random_suffix}"
}
resource "google_tags_tag_key" "tag_key2" {
parent = "projects/${data.google_project.project.number}"
parent = data.google_project.project.id
short_name = "tf_test_tag_key2%{random_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 = "tf_test_tag_value2%{random_suffix}"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4274,7 +4274,7 @@ resource "google_tags_tag_key" "key1" {
}
resource "google_tags_tag_value" "value1" {
parent = "tagKeys/${google_tags_tag_key.key1.name}"
parent = google_tags_tag_key.key1.id
short_name = "%{tag_value_name1}"
}
Expand All @@ -4287,7 +4287,7 @@ resource "google_bigquery_table" "test" {
dataset_id = "${google_bigquery_dataset.test.dataset_id}"
table_id = "%{table_id}"
resource_tags = {
"%{project_id}/${google_tags_tag_key.key1.short_name}" = "${google_tags_tag_value.value1.short_name}"
(google_tags_tag_key.key1.namespaced_name) = google_tags_tag_value.value1.short_name
}
}
`, context)
Expand All @@ -4301,7 +4301,7 @@ resource "google_tags_tag_key" "key1" {
}
resource "google_tags_tag_value" "value1" {
parent = "tagKeys/${google_tags_tag_key.key1.name}"
parent = google_tags_tag_key.key1.id
short_name = "%{tag_value_name1}"
}
Expand All @@ -4311,7 +4311,7 @@ resource "google_tags_tag_key" "key2" {
}
resource "google_tags_tag_value" "value2" {
parent = "tagKeys/${google_tags_tag_key.key2.name}"
parent = google_tags_tag_key.key2.id
short_name = "%{tag_value_name2}"
}
Expand All @@ -4324,8 +4324,8 @@ resource "google_bigquery_table" "test" {
dataset_id = "${google_bigquery_dataset.test.dataset_id}"
table_id = "%{table_id}"
resource_tags = {
"%{project_id}/${google_tags_tag_key.key1.short_name}" = "${google_tags_tag_value.value1.short_name}"
"%{project_id}/${google_tags_tag_key.key2.short_name}" = "${google_tags_tag_value.value2.short_name}"
(google_tags_tag_key.key1.namespaced_name) = google_tags_tag_value.value1.short_name
(google_tags_tag_key.key2.namespaced_name) = google_tags_tag_value.value2.short_name
}
}
`, context)
Expand All @@ -4339,7 +4339,7 @@ resource "google_tags_tag_key" "key1" {
}
resource "google_tags_tag_value" "value1" {
parent = "tagKeys/${google_tags_tag_key.key1.name}"
parent = google_tags_tag_key.key1.id
short_name = "%{tag_value_name1}"
}
Expand All @@ -4349,7 +4349,7 @@ resource "google_tags_tag_key" "key2" {
}
resource "google_tags_tag_value" "value2" {
parent = "tagKeys/${google_tags_tag_key.key2.name}"
parent = google_tags_tag_key.key2.id
short_name = "%{tag_value_name2}"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2007,8 +2007,8 @@ resource "google_tags_tag_key" "igm-key" {

resource "google_tags_tag_value" "igm-value" {
description = "Terraform test tag value."
parent = "tagKeys/${google_tags_tag_key.igm-key.name}"
short_name = "%s"
parent = google_tags_tag_key.igm-key.id
short_name = "%s"
}

resource "google_compute_instance_group_manager" "igm-tags" {
Expand All @@ -2025,7 +2025,7 @@ resource "google_compute_instance_group_manager" "igm-tags" {

params {
resource_manager_tags = {
"tagKeys/${google_tags_tag_key.igm-key.name}" = "tagValues/${google_tags_tag_value.igm-value.name}"
(google_tags_tag_key.igm-key.id) = google_tags_tag_value.igm-value.id
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4437,8 +4437,8 @@ resource "google_tags_tag_key" "key" {
}

resource "google_tags_tag_value" "value" {
parent = "tagKeys/${google_tags_tag_key.key.name}"
short_name = "foo%{random_suffix}"
parent = google_tags_tag_key.key.id
short_name = "foo%{random_suffix}"
description = "For foo resources."
}

Expand All @@ -4458,12 +4458,12 @@ resource "google_compute_instance_template" "foobar" {
boot = true

resource_manager_tags = {
"tagKeys/${google_tags_tag_key.key.name}" = "tagValues/${google_tags_tag_value.value.name}"
(google_tags_tag_key.key.id) = google_tags_tag_value.value.id
}
}

resource_manager_tags = {
"tagKeys/${google_tags_tag_key.key.name}" = "tagValues/${google_tags_tag_value.value.name}"
(google_tags_tag_key.key.id) = google_tags_tag_value.value.id
}

network_interface {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5137,8 +5137,8 @@ resource "google_tags_tag_key" "key" {
}

resource "google_tags_tag_value" "value" {
parent = "tagKeys/${google_tags_tag_key.key.name}"
short_name = "foo%{random_suffix}"
parent = google_tags_tag_key.key.id
short_name = "foo%{random_suffix}"
description = "For foo resources."
}

Expand All @@ -5156,14 +5156,14 @@ resource "google_compute_instance" "foobar" {
initialize_params {
image = data.google_compute_image.my_image.self_link
resource_manager_tags = {
"tagKeys/${google_tags_tag_key.key.name}" = "tagValues/${google_tags_tag_value.value.name}"
(google_tags_tag_key.key.id) = google_tags_tag_value.value.id
}
}
}

params {
resource_manager_tags = {
"tagKeys/${google_tags_tag_key.key.name}" = "tagValues/${google_tags_tag_value.value.name}"
(google_tags_tag_key.key.id) = google_tags_tag_value.value.id
}
}

Expand All @@ -5183,8 +5183,8 @@ resource "google_tags_tag_key" "key" {
}

resource "google_tags_tag_value" "value" {
parent = "tagKeys/${google_tags_tag_key.key.name}"
short_name = "foo%{random_suffix}"
parent = google_tags_tag_key.key.id
short_name = "foo%{random_suffix}"
description = "For foo resources."
}

Expand All @@ -5195,8 +5195,8 @@ resource "google_tags_tag_key" "key_new" {
}

resource "google_tags_tag_value" "value_new" {
parent = "tagKeys/${google_tags_tag_key.key_new.name}"
short_name = "foonew%{random_suffix}"
parent = google_tags_tag_key.key_new.id
short_name = "foonew%{random_suffix}"
description = "New value for foo resources."
}

Expand All @@ -5214,15 +5214,15 @@ resource "google_compute_instance" "foobar" {
initialize_params {
image = data.google_compute_image.my_image.self_link
resource_manager_tags = {
"tagKeys/${google_tags_tag_key.key.name}" = "tagValues/${google_tags_tag_value.value.name}"
(google_tags_tag_key.key.id) = google_tags_tag_value.value.id
}
}
}

params {
resource_manager_tags = {
"tagKeys/${google_tags_tag_key.key.name}" = "tagValues/${google_tags_tag_value.value.name}"
"tagKeys/${google_tags_tag_key.key_new.name}" = "tagValues/${google_tags_tag_value.value_new.name}"
(google_tags_tag_key.key.id) = google_tags_tag_value.value.id
(google_tags_tag_key.key_new.id) = google_tags_tag_value.value_new.id
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ resource "google_compute_network_firewall_policy_rule" "primary" {
src_threat_intelligences = ["iplist-known-malicious-ips"]

src_secure_tags {
name = "tagValues/${google_tags_tag_value.basic_value.name}"
name = google_tags_tag_value.basic_value.id
}

layer4_configs {
Expand Down Expand Up @@ -290,7 +290,7 @@ resource "google_tags_tag_key" "basic_key" {

resource "google_tags_tag_value" "basic_value" {
description = "For valuename resources."
parent = "tagKeys/${google_tags_tag_key.basic_key.name}"
parent = google_tags_tag_key.basic_key.id
short_name = "tf-test-tagvalue-%{random_suffix}"
}
`, context)
Expand Down Expand Up @@ -340,7 +340,7 @@ resource "google_compute_network_firewall_policy_rule" "primary" {
}

target_secure_tags {
name = "tagValues/${google_tags_tag_value.basic_value.name}"
name = google_tags_tag_value.basic_value.id
}
}

Expand All @@ -361,7 +361,7 @@ resource "google_tags_tag_key" "basic_key" {

resource "google_tags_tag_value" "basic_value" {
description = "For valuename resources."
parent = "tagKeys/${google_tags_tag_key.basic_key.name}"
parent = google_tags_tag_key.basic_key.id
short_name = "tf-test-tagvalue-%{random_suffix}"
}
`, context)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ resource "google_compute_network_firewall_policy_with_rules" "network-firewall-p
dest_address_groups = [google_network_security_address_group.address_group_1.id]
}
target_secure_tag {
name = "tagValues/${google_tags_tag_value.secure_tag_value_1.name}"
name = google_tags_tag_value.secure_tag_value_1.id
}
}
rule {
Expand All @@ -90,7 +90,7 @@ resource "google_compute_network_firewall_policy_with_rules" "network-firewall-p
src_threat_intelligences = ["iplist-known-malicious-ips", "iplist-public-clouds"]
src_address_groups = [google_network_security_address_group.address_group_1.id]
src_secure_tag {
name = "tagValues/${google_tags_tag_value.secure_tag_value_1.name}"
name = google_tags_tag_value.secure_tag_value_1.id
}
}
disabled = true
Expand Down Expand Up @@ -139,7 +139,7 @@ resource "google_tags_tag_key" "secure_tag_key_1" {
resource "google_tags_tag_value" "secure_tag_value_1" {
provider = google-beta
description = "Tag value"
parent = "tagKeys/${google_tags_tag_key.secure_tag_key_1.name}"
parent = google_tags_tag_key.secure_tag_key_1.id
short_name = "tf-test-tf-tag-value%{random_suffix}"
}

Expand Down Expand Up @@ -205,7 +205,7 @@ resource "google_compute_network_firewall_policy_with_rules" "network-firewall-p
src_threat_intelligences = ["iplist-public-clouds"]
src_address_groups = [google_network_security_address_group.address_group_1.id]
src_secure_tag {
name = "tagValues/${google_tags_tag_value.secure_tag_value_1.name}"
name = google_tags_tag_value.secure_tag_value_1.id
}
}
disabled = false
Expand Down Expand Up @@ -237,7 +237,7 @@ resource "google_tags_tag_key" "secure_tag_key_1" {
resource "google_tags_tag_value" "secure_tag_value_1" {
provider = google-beta
description = "Tag value"
parent = "tagKeys/${google_tags_tag_key.secure_tag_key_1.name}"
parent = google_tags_tag_key.secure_tag_key_1.id
short_name = "tf-test-tf-tag-value%{random_suffix}"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1955,8 +1955,8 @@ resource "google_tags_tag_key" "rigm-key" {

resource "google_tags_tag_value" "rigm-value" {
description = "Terraform test tag value."
parent = "tagKeys/${google_tags_tag_key.rigm-key.name}"
short_name = "%s"
parent = google_tags_tag_key.rigm-key.id
short_name = "%s"
}

resource "google_compute_region_instance_group_manager" "rigm-tags" {
Expand All @@ -1973,7 +1973,7 @@ resource "google_compute_region_instance_group_manager" "rigm-tags" {

params {
resource_manager_tags = {
"tagKeys/${google_tags_tag_key.rigm-key.name}" = "tagValues/${google_tags_tag_value.rigm-value.name}"
(google_tags_tag_key.rigm-key.id) = google_tags_tag_value.rigm-value.id
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3837,7 +3837,7 @@ resource "google_tags_tag_key" "key" {
}

resource "google_tags_tag_value" "value" {
parent = "tagKeys/${google_tags_tag_key.key.name}"
parent = google_tags_tag_key.key.id
short_name = "foo%{random_suffix}"
description = "For foo resources."
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ resource "google_compute_region_network_firewall_policy_rule" "primary" {
}

src_secure_tags {
name = "tagValues/${google_tags_tag_value.basic_value.name}"
name = google_tags_tag_value.basic_value.id
}

src_address_groups = [google_network_security_address_group.basic_regional_networksecurity_address_group.id]
Expand All @@ -256,7 +256,7 @@ resource "google_tags_tag_key" "basic_key" {

resource "google_tags_tag_value" "basic_value" {
description = "For valuename resources."
parent = "tagKeys/${google_tags_tag_key.basic_key.name}"
parent = google_tags_tag_key.basic_key.id
short_name = "tf-test-tagvalue-%{random_suffix}"
}

Expand Down Expand Up @@ -309,7 +309,7 @@ resource "google_compute_region_network_firewall_policy_rule" "primary" {
}

target_secure_tags {
name = "tagValues/${google_tags_tag_value.basic_value.name}"
name = google_tags_tag_value.basic_value.id
}
}

Expand All @@ -331,7 +331,7 @@ resource "google_tags_tag_key" "basic_key" {

resource "google_tags_tag_value" "basic_value" {
description = "For valuename resources."
parent = "tagKeys/${google_tags_tag_key.basic_key.name}"
parent = google_tags_tag_key.basic_key.id
short_name = "tf-test-tagvalue-%{random_suffix}"
}

Expand Down
Loading

0 comments on commit b97bf4c

Please sign in to comment.