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

how to disable windows support #582

Closed
1 of 4 tasks
liwei0802 opened this issue Nov 5, 2019 · 10 comments · Fixed by #1371
Closed
1 of 4 tasks

how to disable windows support #582

liwei0802 opened this issue Nov 5, 2019 · 10 comments · Fixed by #1371

Comments

@liwei0802
Copy link

liwei0802 commented Nov 5, 2019

I have issues

when i run 'terraform plan' its poping up error message below. I am just thinking how can we simple disable windows support?
Error: Your query returned no results. Please change your search criteria and try again.

on .terraform/modules/my-cluster/terraform-aws-modules-terraform-aws-eks-55ff38c/data.tf line 32, in data "aws_ami" "eks_worker_windows":
32: data "aws_ami" "eks_worker_windows" {

I'm submitting a...

  • bug report
  • feature request
  • support request - read the FAQ first!
  • kudos, thank you, warm fuzzy

What is the current behavior?

If this is a bug, how to reproduce? Please include a code sample if relevant.

What's the expected behavior?

Are you able to fix this problem and submit a PR? Link here if you have already.

Environment details

  • Affected module version:
  • OS:
  • Terraform version:

Any other relevant info

@kiefersmith
Copy link

I'm getting the same error. This causes any plan action to fail...

@barryib barryib added the bug label Nov 5, 2019
@kiefersmith
Copy link

@liwei0802 You can just tie your module to the previous version and it should work.

@max-rocket-internet
Copy link
Contributor

Maybe @hodduc can take a look since they made the windows PR 🙂

@hodduc
Copy link
Contributor

hodduc commented Nov 5, 2019

🤔.. If you are using cluster_version <= 1.13, there is no AMI for that cluster version, but terraform will try to find it and fail. ( hashicorp/terraform#16380 ). I missed that case.

A possible workaround: Set var.worker_ami_name_filter_windows to *. Some random AMI will came out from data block, but it will not be used anyway unless using Windows workers.

@hodduc
Copy link
Contributor

hodduc commented Nov 5, 2019

I think there can be two fix:

  • Add count = (var.cluster_version is greater or equal than "1.14") ? 1 : 0 on data.aws_ami.eks_worker_windows
  • Add some flag to enable/disable Windows, then add count = var.enable_windows ? 1 : 0 on data.aws_ami.eks_worker_windows

@max-rocket-internet Does this looks fine?

@max-rocket-internet
Copy link
Contributor

Add some flag to enable/disable Windows

That doesn't sound super elegant.

Can you add some conditions into local.worker_ami_name_filter_windows so that if k8s version is less than 1.14 then it doesn't fail?

Maybe something like this?

  worker_ami_name_filter_windows = var.worker_ami_name_filter_windows != "" ? var.worker_ami_name_filter_windows : tonumber(var.cluster_version) < 1.14 ? local. worker_ami_name_filter : "Windows_Server-2019-English-Core-EKS_Optimized-${var.cluster_version}-*"

@oschrenk
Copy link

oschrenk commented Sep 9, 2020

Can this be re-opened?

This still happens with the basic example with these versions

terraform-aws-modules/eks/aws 12.2.0 for eks...

Terraform v0.12.9
+ provider.aws v2.70.0

event with cluster_version set to 1.17

module "eks" {
  source          = "terraform-aws-modules/eks/aws"
  cluster_name    = local.cluster_name
  cluster_version = "1.17"
 ...

I used worker_ami_name_filter_windows = "*" as instructed by @hodduc (thanks) as a workaround.

@icco
Copy link

icco commented May 19, 2021

This happened to me today on cluster_version of 1.20

@barryib barryib reopened this May 19, 2021
@barryib
Copy link
Member

barryib commented May 19, 2021

I just opened #1371 to address this. Will you please review it and test it ?

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 21, 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 a pull request may close this issue.

7 participants