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: Updated code and version requirements to work with Terraform 0.15 #1165

Merged
merged 9 commits into from
Apr 16, 2021

Conversation

TjeuKayim
Copy link
Contributor

@TjeuKayim TjeuKayim commented Dec 29, 2020

PR o'clock

Description

Replaced use of deprecated list() function with [] syntax and map() function with {} syntax.

Fix #1164

Checklist

@TjeuKayim TjeuKayim changed the title Replace deprecated list() fix: Replace deprecated list() Dec 29, 2020
workers_launch_template.tf Outdated Show resolved Hide resolved
@TjeuKayim
Copy link
Contributor Author

Thanks for the review @barryib. I applied your suggestion and rebased on top of master.

@TjeuKayim TjeuKayim requested a review from barryib February 9, 2021 10:35
@jochen-st jochen-st mentioned this pull request Feb 27, 2021
4 tasks
@TjeuKayim
Copy link
Contributor Author

I found that the deprecated function map() is also going to be removed in Terraform 0.15. I'm adding a simple patch for that one too.

@TjeuKayim
Copy link
Contributor Author

The CI "Check Docs" failure is probably a false positive as I didn't alter anything related to the documentation in this pull request.

Co-authored-by: Anton Babenko <[email protected]>
@TjeuKayim TjeuKayim requested a review from antonbabenko March 15, 2021 08:24
@RichiCoder1
Copy link

Terraform 0.15 is out and officially breaking things 😁

@barryib
Copy link
Member

barryib commented Apr 14, 2021

Terraform 0.15 is out and officially breaking things 😁

Will look into this during the week.

@bakayolo
Copy link

Hey guys,
When can we expect this one to be merged, we are currently being impacted by hashicorp/terraform#27172 that has been fixed in 0.15 but can't use 0.15 because of this current PR not merged.
Thanks!

@PavelSusloparov
Copy link

PavelSusloparov commented Apr 14, 2021

bad luck for people who use docker.mirror.hashicorp.services/hashicorp/terraform:light, terraform is updated to 0.15.0 there and terraform-aws-eks deps are failing.
Can we merge this in please?

@andyli
Copy link

andyli commented Apr 15, 2021

It's a rather trivial change if you take a look at the file diff. Hope it wouldn't take too long to be merged.

@jtgorny
Copy link

jtgorny commented Apr 15, 2021

Pls merge 😅
Call to function "list" failed: the "list" function was deprecated in Terraform v0.12 and is no longer available; use tolist([ ... ]) syntax to write a literal list.

@antonbabenko antonbabenko changed the title fix: Replace deprecated list() fix: Updated code and version requirements to work with Terraform 0.15 Apr 16, 2021
@antonbabenko antonbabenko merged commit 2a6f07a into terraform-aws-modules:master Apr 16, 2021
@antonbabenko
Copy link
Member

Terraform 0.15 is supported in version v15.0.0 that has been just released.

For the previous version of Terraform please use this module version ~> 14.0.

Let us know if there are any issues with this release.

@barryib I used the same release process as for all other modules we have and CHANGELOG changes were rather big ( eafc458 )

@vauchok
Copy link

vauchok commented Apr 16, 2021

Hi @antonbabenko,

I think you've missed list(var.worker_groups_launch_template[count.index]) in .terraform/modules/eks/workers_launch_template.tf line 167.

│ Error: Error in function call
│ 
│   on .terraform/modules/eks/workers_launch_template.tf line 167, in resource "aws_autoscaling_group" "workers_launch_template":
│  167:     for_each = (lookup(var.worker_groups_launch_template[count.index], "override_instance_types", null) != null) || (lookup(var.worker_groups_launch_template[count.index], "on_demand_allocation_strategy", local.workers_group_defaults["on_demand_allocation_strategy"]) != null) ? [] : list(var.worker_groups_launch_template[count.index])
│     ├────────────────
│     │ count.index is 1
│     │ var.worker_groups_launch_template is tuple with 4 elements
│ 
│ Call to function "list" failed: the "list" function was deprecated in
│ Terraform v0.12 and is no longer available; use tolist([ ... ]) syntax to
│ write a literal list.

@marcuz
Copy link

marcuz commented Apr 16, 2021

Hi @antonbabenko,

adding to @vauchok, also a map call is missing:

│ Error: Error in function call
│ 
│   on .terraform/modules/sud.eks_main/workers_launch_template.tf line 212, in resource "aws_autoscaling_group" "workers_launch_template":
│  212:         map(
│  213:           "key", tag_key,
│  214:           "value", tag_value,
│  215:           "propagate_at_launch", "true"
│  216:         )
│ 
│ Call to function "map" failed: the "map" function was deprecated in Terraform v0.12 and is no longer available; use tomap({ ... }) syntax to write a literal map.

@antonbabenko
Copy link
Member

Weird that terraform validate command did not catch these errors. Fixed in #1307.

@antonbabenko
Copy link
Member

Big thanks for the report!

v15.1.0 has been just released.

@marcuz
Copy link

marcuz commented Apr 16, 2021

@antonbabenko works now, thank you very much! 🙌

ArchiFleKs pushed a commit to ArchiFleKs/terraform-aws-eks that referenced this pull request Apr 16, 2021
barryib pushed a commit to barryib/terraform-aws-eks that referenced this pull request May 20, 2021
mariadb-JeffBachtel pushed a commit to mariadb-corporation/terraform-aws-eks that referenced this pull request Aug 19, 2021
mariadb-JeffBachtel added a commit to mariadb-corporation/terraform-aws-eks that referenced this pull request Aug 20, 2021
…form 0.15 (terraform-aws-modules#1165)"

This reverts commit 65b0489.

Revert changes to workers.tf, as it is custom
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"list" function was deprecated in Terraform v0.12
10 participants