Terraform-aws-eks: AMI eks-worker-* query returned no results

Created on 15 Jul 2018  路  5Comments  路  Source: terraform-aws-modules/terraform-aws-eks

I have issues

I'm submitting a...

  • [x] bug report

What is the current behavior?

If region is set to us-west-1:

Error: Error refreshing state: 1 error(s) occurred:

  • module.eks.data.aws_ami.eks_worker: 1 error(s) occurred:

  • module.eks.data.aws_ami.eks_worker: data.aws_ami.eks_worker: Your query returned no results. Please change your search criteria and try again.

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

module "eks" {
source = "terraform-aws-modules/eks/aws"
cluster_name = "test-eks-cluster"
vpc_id = "${module.vpc.default_vpc_id}"
subnets = "${module.vpc.public_subnets}"

tags = {
Environment = "test"
Terraform = "true"
}
}

What's the expected behavior?

An available AWS AMI ID.

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

Not sure how.

Environment details

  • Affected module version: 1.3.0
  • OS: Linux
  • Terraform version: 0.11.7

Any other relevant info

Most helpful comment

Hi @mooperd
The new EKS AMIs start with amazon-eks-node-* and that link you have there is for a different repo.

All 5 comments

@internaught EKS is only available in a few regions right now, and not yet in us-west-1. From experience I wouldn't hold your breath on us-west-1 availability, but I could of course be wrong on that.

From their blog post - https://aws.amazon.com/blogs/aws/amazon-eks-now-generally-available/

"Amazon EKS is available today in the US East (N. Virginia) and US West (Oregon) Regions and will be expanding to others very soon. We have a detailed roadmap and plan to crank out plenty of additional features this year."

Hi @internaught -

@bshelton229 's got the right idea. Only 2 regions are supported for EKS currently (AFAIK) and us-west-1 is not one of those.

We could set up a dummy resource (null_resource) to throw a custom exception if someone tries to use an unsupported an region (gathered by data source) but at least for now I'm opposed to this approach. Handling the likely race condition there would be tricky or impossible (AMI search done at same time) but to me even worse is trying to keep pace with predictable AWS change (adding regions for this service). Especially since the only benefit is gaining a custom error message rather than a more generic AMI related one, I don't see enough value to justify more code.

It seems that AWS are not following the ami naming convention set in the UK for the new EKS in ireland.

https://github.com/terraform-providers/terraform-provider-aws/blob/master/examples/eks-getting-started/eks-worker-nodes.tf#L89
FAILS

data "aws_ami" "eks-worker" {
  filter {
    name   = "name"
    values = ["eks-worker-*"]
  }

WORKS

data "aws_ami" "eks-worker" {
  filter {
    name   = "name"
    values = ["amazon-eks-*"]
  }

Hi @mooperd
The new EKS AMIs start with amazon-eks-node-* and that link you have there is for a different repo.

Thanks @mooperd and @max-rocket-internet!

The same goes for Frankfurt:

Was this page helpful?
0 / 5 - 0 ratings