From ce45bd093dd64bb91d21b3860c869f8113102adf Mon Sep 17 00:00:00 2001 From: Riley Karson Date: Wed, 13 Nov 2019 09:19:34 -0800 Subject: [PATCH] Add improved for_each non-module variant --- .../docs/guides/version_3_upgrade.html.markdown | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/third_party/terraform/website/docs/guides/version_3_upgrade.html.markdown b/third_party/terraform/website/docs/guides/version_3_upgrade.html.markdown index 94dc3787febb..0f5fb4c05cc6 100644 --- a/third_party/terraform/website/docs/guides/version_3_upgrade.html.markdown +++ b/third_party/terraform/website/docs/guides/version_3_upgrade.html.markdown @@ -824,15 +824,15 @@ module "project_services" { #### New Config (google_project_service) ```hcl -resource "google_project_service" "project_iam" { - project = "your-project-id" - service = "iam.googleapis.com" - disable_on_destroy = false -} +resource "google_project_service" "service" { + for_each = toset([ + "iam.googleapis.com", + "cloudresourcemanager.googleapis.com", + ]) + + service = each.key -resource "google_project_service" "project_cloudresourcemanager" { project = "your-project-id" - service = "cloudresourcemanager.googleapis.com" disable_on_destroy = false } ```