Skip to content

Commit

Permalink
Merge pull request #7 from goflink/fix/use-count-instead-foreach
Browse files Browse the repository at this point in the history
fix: use count instead for_each
  • Loading branch information
czerasz-mineiros authored Mar 30, 2022
2 parents a3bb695 + 71595ba commit ce6e97d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.0.2]

### Fixed

- use `count` instead `for_each`

## [0.0.1]

### Added
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Most common usage of the module:

```hcl
module "terraform-google-subnetwork" {
source = "github.com/mineiros-io/terraform-google-subnetwork.git?ref=v0.0.1"
source = "github.com/mineiros-io/terraform-google-subnetwork.git?ref=v0.0.2"
network = google_compute_network.custom-test.id
name = "test-subnetwork"
Expand Down
2 changes: 1 addition & 1 deletion README.tfdoc.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ section {
```hcl
module "terraform-google-subnetwork" {
source = "github.com/mineiros-io/terraform-google-subnetwork.git?ref=v0.0.1"
source = "github.com/mineiros-io/terraform-google-subnetwork.git?ref=v0.0.2"
network = google_compute_network.custom-test.id
name = "test-subnetwork"
Expand Down
2 changes: 1 addition & 1 deletion examples/example/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

module "terraform-google-subnetwork" {
source = "[email protected]:mineiros-io/terraform-google-subnetwork.git?ref=v0.0.1"
source = "[email protected]:mineiros-io/terraform-google-subnetwork.git?ref=v0.0.2"

# All required module arguments

Expand Down
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# ---------------------------------------------------------------------------------------------------------------------

resource "google_compute_subnetwork" "subnetwork" {
for_each = var.module_enabled ? 1 : 0
count = var.module_enabled ? 1 : 0

project = var.project
network = var.network
Expand Down

0 comments on commit ce6e97d

Please sign in to comment.