Skip to content

Commit

Permalink
Add improved for_each non-module variant
Browse files Browse the repository at this point in the history
  • Loading branch information
rileykarson committed Nov 13, 2019
1 parent db565f0 commit ce45bd0
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
```
Expand Down

0 comments on commit ce45bd0

Please sign in to comment.