From 3d2285a5ab78623fe5ea49511d4757d3cb01e220 Mon Sep 17 00:00:00 2001 From: Miren Esnaola Date: Fri, 29 Sep 2023 16:33:21 +0200 Subject: [PATCH 1/3] Fixed problem with try in apigee module --- modules/apigee/main.tf | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/apigee/main.tf b/modules/apigee/main.tf index 0b61f300..2a27e367 100644 --- a/modules/apigee/main.tf +++ b/modules/apigee/main.tf @@ -67,8 +67,9 @@ resource "google_apigee_envgroup_attachment" "envgroup_attachments" { envgroup = v2 } }])...) - envgroup_id = try(google_apigee_envgroup.envgroups[each.value.envgroup].id, each.value.envgroup) + envgroup_id = each.value.envgroup environment = google_apigee_environment.environments[each.value.environment].name + depends_on = [google_apigee_envgroup.envgroups] } resource "google_apigee_environment_iam_binding" "binding" { @@ -120,8 +121,8 @@ resource "google_apigee_instance_attachment" "instance_attachments" { } }])...) instance_id = google_apigee_instance.instances[each.value.instance].id - environment = try(google_apigee_environment.environments[each.value.environment].name, - "${local.org_id}/environments/${each.value.environment}") + environment = each.value.environment + depends_on = [google_apigee_environment.environments] } resource "google_apigee_endpoint_attachment" "endpoint_attachments" { From 60906b66d8d268f3169d6cb175426fe89578702e Mon Sep 17 00:00:00 2001 From: Miren Esnaola Date: Fri, 29 Sep 2023 16:43:08 +0200 Subject: [PATCH 2/3] Fixed problem with try in apigee module --- modules/apigee/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/apigee/main.tf b/modules/apigee/main.tf index 2a27e367..67fd74be 100644 --- a/modules/apigee/main.tf +++ b/modules/apigee/main.tf @@ -67,7 +67,7 @@ resource "google_apigee_envgroup_attachment" "envgroup_attachments" { envgroup = v2 } }])...) - envgroup_id = each.value.envgroup + envgroup_id = "${local.org_id}/envgroups/${each.value.envgroup}" environment = google_apigee_environment.environments[each.value.environment].name depends_on = [google_apigee_envgroup.envgroups] } From 06d4bf57885cd0b4fdc937d9a556d811e542ae3d Mon Sep 17 00:00:00 2001 From: Anmol Sachdeva Date: Fri, 29 Sep 2023 16:40:48 +0000 Subject: [PATCH 3/3] fix: apigee unit tests --- tests/modules/apigee/env_only.yaml | 2 +- tests/modules/apigee/env_only_with_api_proxy_type.yaml | 6 +++--- tests/modules/apigee/env_only_with_deployment_type.yaml | 7 +++---- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/tests/modules/apigee/env_only.yaml b/tests/modules/apigee/env_only.yaml index 3a5e1ec2..ebea5efb 100644 --- a/tests/modules/apigee/env_only.yaml +++ b/tests/modules/apigee/env_only.yaml @@ -14,7 +14,7 @@ values: google_apigee_envgroup_attachment.envgroup_attachments["apis-test-test"]: - envgroup_id: test + envgroup_id: organizations/my-project/envgroups/test environment: apis-test timeouts: null google_apigee_environment.environments["apis-test"]: diff --git a/tests/modules/apigee/env_only_with_api_proxy_type.yaml b/tests/modules/apigee/env_only_with_api_proxy_type.yaml index ba9371ab..842962a1 100644 --- a/tests/modules/apigee/env_only_with_api_proxy_type.yaml +++ b/tests/modules/apigee/env_only_with_api_proxy_type.yaml @@ -14,7 +14,7 @@ values: google_apigee_envgroup_attachment.envgroup_attachments["apis-test-test"]: - envgroup_id: test + envgroup_id: organizations/my-project/envgroups/test environment: apis-test google_apigee_environment.environments["apis-test"]: api_proxy_type: PROGRAMMABLE @@ -22,8 +22,8 @@ values: display_name: APIs test name: apis-test node_config: - - max_node_count: '5' - min_node_count: '2' + - max_node_count: "5" + min_node_count: "2" org_id: organizations/my-project counts: diff --git a/tests/modules/apigee/env_only_with_deployment_type.yaml b/tests/modules/apigee/env_only_with_deployment_type.yaml index f315f463..7dda0fa7 100644 --- a/tests/modules/apigee/env_only_with_deployment_type.yaml +++ b/tests/modules/apigee/env_only_with_deployment_type.yaml @@ -14,7 +14,7 @@ values: google_apigee_envgroup_attachment.envgroup_attachments["apis-test-test"]: - envgroup_id: test + envgroup_id: organizations/my-project/envgroups/test environment: apis-test timeouts: null google_apigee_environment.environments["apis-test"]: @@ -23,12 +23,11 @@ values: display_name: APIs test name: apis-test node_config: - - max_node_count: '5' - min_node_count: '2' + - max_node_count: "5" + min_node_count: "2" org_id: organizations/my-project timeouts: null counts: google_apigee_envgroup_attachment: 1 google_apigee_environment: 1 -