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

Terraform no longer supports the map function #7576

Closed
tkob opened this issue Apr 30, 2021 · 1 comment · Fixed by #7578
Closed

Terraform no longer supports the map function #7576

tkob opened this issue Apr 30, 2021 · 1 comment · Fixed by #7578
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@tkob
Copy link
Contributor

tkob commented Apr 30, 2021

What would you like to be added:

The Terraform scripts in contrib/terraform/aws directory use the map function, but they should be replaced with the tomap function like the following for them to work with new versions of Terraform.

-  tags = merge(var.default_tags, map(
-    "Name", "kubernetes-${var.aws_cluster_name}-master${count.index}",
-    "kubernetes.io/cluster/${var.aws_cluster_name}", "member",
-    "Role", "master"
-  ))
+  tags = merge(var.default_tags, tomap({
+    Name = "kubernetes-${var.aws_cluster_name}-master${count.index}"
+    "kubernetes.io/cluster/${var.aws_cluster_name}" = "member"
+    Role = "master"
+  }))

Why is this needed:

The map function is no longer available in newer versions.

https://www.terraform.io/docs/language/functions/map.html

I am ready to provide patches if you like.

@tkob tkob added the kind/feature Categorizes issue or PR as related to a new feature. label Apr 30, 2021
@floryut
Copy link
Member

floryut commented Apr 30, 2021

@tkob Happy to see a PR with that if you're up to it, thank you

tkob added a commit to tkob/kubespray that referenced this issue Apr 30, 2021
tkob added a commit to tkob/kubespray that referenced this issue May 6, 2021
k8s-ci-robot pushed a commit that referenced this issue May 12, 2021
* Replace map in Terraform scripts with tomap (#7576)

* Fix Terraform linter warnings (#7576)
LuckySB pushed a commit to southbridgeio/kubespray that referenced this issue Jun 17, 2021
sakuraiyuta pushed a commit to sakuraiyuta/kubespray that referenced this issue Apr 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants