-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
add Terraform 0.12 support #376
Comments
The v0.12 has been released |
Is anyone already working on this? would be keep to assist on any efforts if required. |
@stefansedich: I have and currently running in multiple environments: dev, stage, prod.
I would be more than happy to create a PR but I believe we need to discuss how to support backwards compatibility (pre v0.12). If we decide to upgrade, perhaps we can bump the Terraform Module version to >= 12.x.x, let me know your thoughts.
|
Ah great @a7i I will check it out, how did you handle the dependencies like the VPC module? it looked to me yesterday as they still have some changes to make too on their end. |
@stefansedich Have also done that one. Though, I need to update the examples in the eks module.
|
@a7i there is PR for that too terraform-aws-modules/terraform-aws-vpc#265 |
The official 0.12 upgrade guide states that "If you are using semantic versioning, such as in a Terraform registry, the updates made by the upgrade tool should be considered a breaking change and published as a new major version" and "for any module using a undocumented workarounds for v0.11 limitations it is unlikely to be possible to both update it for Terraform v0.12 and retain v0.11 compatibility at the same time." It seems like breaking changes are to be expected so long as we bump the module's major version. |
Another attempt: https://github.com/alex-goncharov/terraform-aws-eks/tree/terraform-0.12 Uses strict typing, examples upgraded and tested with VPC module PR. Also couple of live EKS use it already. |
@alex-goncharov, fyi, you may have caught it already, but the change in Terraform 0.12 with coalesce("","") resulting in a "no non-null, non-empty-string arguments" error (as opposed to be valid in prior versions), especially workers_launch_template_mixed.tf and workers.tf have now issues with targetgroup_arns and enabled_metrics attributes for aws_autoscaling_group as the default values are empty. |
Thanks @tjorri, removed bunch of unnecessary coalesce calls in last commit. |
@alex-goncharov I'm just testing your 0.12 branch and experienced this error
I have autoscaling enabled on this worker group
looks like the problem is here https://github.com/alex-goncharov/terraform-aws-eks/blob/0438e4334199d0c6dcc17e5b6a6e58312435db4b/workers.tf#L102-L106 btw thx for your work! |
Just curious are we going to use this time to fix some of the things that might not be nescessary anymore? like the |
Our approach is to do minimal upgrade work possible so that we can use 0.12 everywhere and then proceed with other fixes with regular cadence. |
@Vrtak-CZ that does not look like a full error output, could you please check if there is more. Also can you show me your plan, the module call part. |
@Vrtak-CZ Adding {
"key" = "k8s.io/cluster-autoscaler/${aws_eks_cluster.this.name}"
"value" = "true"
"propagate_at_launch" = false
}, |
confirm the issue of @Vrtak-CZ and fixed as @dirgapeter proposes refers to the https://github.com/terraform-providers/terraform-provider-aws/blob/master/aws/autoscaling_tags.go
I'm not sure that terraform >= 0.12 may check |
Are we able to remove some Terraform language hacks with 0.12 also? For example, all the |
I really want 0.12 support in this module to get rid of all the ugly hacks but this project may want to hold off (I have a selfish reason) or maintain support for 0.11. I'm a user of Terragrunt and 0.12 is currently not supported with that tool: gruntwork-io/terragrunt#466. The impression I got from Hashicorp was that they were expecting most users to stick with 0.11 till the end of the year https://www.reddit.com/r/Terraform/comments/aos3o0/where_is_terraform_012/eg6eol8?utm_source=share&utm_medium=web2x |
Why don't we follow the example of the terraform-aws-vpc module, which has upgraded the master branch to Terraform 0.12 and created a separate branch,
|
@max-rocket-internet agreed I think this effort should push towards a 2.x release and a full port/cleanup performed instead of just chasing an easy 0.12 migration, easier to bite the breaking changes with the first 2.x release. Edit: well maybe 5.x in the case of this module, forget latest was at 4.x |
@alex-goncharov |
@alex-goncharov running a destroy is also giving lots of issues related to coalesce:
|
@alex-goncharov I have opened alex-goncharov/pull/2 to fix these things |
The only thing I ask is that anyone who attempts this makes sure it's backwards compatible, and the refactoring does not cause breaking changes causing destructive terraform diffs. If removing the 'hacks' re-orders lists and causes destructive diffs we should avoid this and leave the hacks in on the first pass. I am happy to help test this, or even help with the refactoring. :-) |
Should be possible 👍
Sounds good 👍
Can do that, for sure. But it may not even necessary to support |
@mattmessinger I think you can update the terraform version to Cheers! |
I could not understand out ouf your discussion.
|
I forgave to use terraform 0.12 cause that problem. |
@alex-goncharov I have using your branch to manage two EKS cluster for a week and it works with no problem. I think it's time to open a PR to merge back to this repo. |
@alex-goncharov FYI I have done a test migration for our stack over to using your fork and everything appears to be working correctly with what I can see no destructive changes when looking at the plan, just a bunch of "1" => "true" in tags and ASG values. |
Agreed!! Any progress @alex-goncharov? |
I'm seeing some weird behavior when I try to tear down a cluster with
This is when using Terraform Enterprise as the backend and remote executor (TF 0.12.2). Has anyone had success creating a fresh cluster from the forked module and then deleting it? |
I used terraform version 0.12.2 but this issue has not been solved. Error: Unsupported block type on .terraform/modules/my-cluster/terraform-aws-modules-terraform-aws-eks-d6fa9f4/aws_auth.tf line 40, in data "template_file" "launch_template_mixed_worker_role_arns": Blocks of type "vars" are not expected here. Did you mean to define argument |
@eytanhanig I have been creating multiple fresh clusters the last couple of days (and destroyed them as well with TF) -- I didn't get those issues anymore but in my tests I'm passing in a security group for the workers - didn't test without passing in a security group (and I assume your error is in that scenario?) |
@maposemo I only got your kind of error when I used a older TF version (so not 0.12.x) by accident. |
and quickly looking at the code & error -- it also seemed like you didn't let the module create a security group either? (as then I would expect aws_security_group.cluster & aws_security_group.workers to be non-empty ?) |
@timboven
Terraform has been successfully initialized!
Blocks of type "vars" are not expected here. Did you mean to define argument |
@timboven module "my-cluster" { worker_groups = [ tags = { |
Everyone, please test this PR so we can merge it 😃 |
I did not override the security group creation, and the two aforementioned SGs were created. |
Thanks @max-rocket-internet! I've been travelling last 2 weeks and could not spare a minute. |
Thanks to all for the help in getting us to TF version 0.12 🎉🎉🎉 Especially @nauxliu and @alex-goncharov 💙 |
I'm going to lock this issue 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 similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
I have issues
I'm submitting a...
What is the current behavior?
Currently you cannot use this module with Terraform >= 0.12.0
There are several errors relating to:
"Error: Unsupported block type"
"Error: Missing resource instance key"
Environment details
The text was updated successfully, but these errors were encountered: