Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix update-variants for_each splat, closes #414 #415

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ Sub modules are provided from creating private clusters, beta private clusters,

## Compatibility

This module is meant for use with Terraform 0.12.
If you haven't
This module is meant for use with Terraform 0.12. If you haven't
[upgraded][terraform-0.12-upgrade] and need a Terraform
0.11.x-compatible version of this module, the last released version
intended for Terraform 0.11.x is [3.0.0].
Expand Down
2 changes: 1 addition & 1 deletion autogen/main/cluster.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ resource "google_container_node_pool" "pools" {
{% endif %}
for_each = local.node_pools
{% if update_variant %}
name = random_id.name.*.hex[each.key]
name = {for k, v in random_id.name : k => v.hex}[each.key]
{% else %}
name = each.key
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-private-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ resource "random_id" "name" {
resource "google_container_node_pool" "pools" {
provider = google-beta
for_each = local.node_pools
name = random_id.name.*.hex[each.key]
name = { for k, v in random_id.name : k => v.hex }[each.key]
project = var.project_id
location = local.location
// use node_locations if provided, defaults to cluster level node_locations if not specified
Expand Down
2 changes: 1 addition & 1 deletion modules/private-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ resource "random_id" "name" {
resource "google_container_node_pool" "pools" {
provider = google
for_each = local.node_pools
name = random_id.name.*.hex[each.key]
name = { for k, v in random_id.name : k => v.hex }[each.key]
project = var.project_id
location = local.location

Expand Down