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

data aws_ami "eks_worker" is failing in ap-east-1 #480

Closed
2 of 4 tasks
vranystepan opened this issue Aug 25, 2019 · 11 comments · Fixed by #1038
Closed
2 of 4 tasks

data aws_ami "eks_worker" is failing in ap-east-1 #480

vranystepan opened this issue Aug 25, 2019 · 11 comments · Fixed by #1038

Comments

@vranystepan
Copy link

I have issues

We are not able to create EKS cluster in ap-east-1 due to issues with AMI names.

I'm submitting a...

  • bug report
  • feature request
  • support request
  • kudos, thank you, warm fuzzy

What is the current behavior?

With any ami we are getting

Error: Your query returned no results. Please change your search criteria and try again.

  on .terraform/modules/<redacted>/terraform-aws-modules-terraform-aws-eks-6ea3582/data.tf line 19, in data "aws_ami" "eks_worker":
  19: data "aws_ami" "eks_worker" {

We suppose that EKS module is always trying to find images (before workers_group_defaults_defaults is being merged with var.workers_group_defaults) with following pattern but apparently there are no such images in the HK region.

amazon-eks-node-${var.cluster_version}-${var.worker_ami_name_filter}

I'm not able to receive any results even with CLI:

aws ec2 describe-images \                                                                       
    --filters \
        Name=owner-id,Values=602401143452 \
        Name=virtualization-type,Values=hvm \
        Name=root-device-type,Values=ebs \
        Name=is-public,Values=true \
        Name=name,Values=amazon-eks-node-\* \
    --output text \
    --query 'max_by(Images[], &CreationDate).ImageId' \
--profile=<redacted> \
--region=ap-east-1
None

Environment details

  • Affected module version: v5.1.0
  • OS: any
  • Terraform version: 0.12.7

Any other relevant info

Perhaps there is different owner in HK region? https://github.com/awslabs/amazon-eks-ami/pull/305/files/fd9cf4458dffa1e9c01a3a42fca1cc7690abc504

@max-rocket-internet
Copy link
Contributor

Perhaps there is different owner in HK region?

Looks like it. Strange.

@vranystepan
Copy link
Author

Internally we've applied temp. workaround in data.tf:

...
owners = ["602401143452", "800184023465"]
...

but this is not the solution as 800184023465 does not contain images with relevant names :)

@bsakweson
Copy link

bsakweson commented Sep 18, 2019

I seem to be having the same issue in us-east-1. Here is what I am seeing?

Error: Your query returned no results. Please change your search criteria and try again.

  on .terraform/modules/eks.eks/data.tf line 19, in data "aws_ami" "eks_worker":
  19: data "aws_ami" "eks_worker" {

A pick at the code shows this:

data "aws_ami" "eks_worker" {
  filter {
    name   = "name"
    values = ["amazon-eks-node-${var.cluster_version}-${var.worker_ami_name_filter}"]
  }

  most_recent = true

  # Owner ID of AWS EKS team
  owners = ["602401143452"]
}

I did not add any additional filter.

affected version: v6.0.0
Overriding ami_id with ami-08739803f18dcc019 from this url using workers_group_defaults property does not seem to work either.

@bsakweson
Copy link

It turns out my cluster version was incorrect. Cluster version should not contain minor release, it should be for example 1.14. See this https://github.com/awslabs/amazon-eks-ami and this for https://docs.aws.amazon.com/eks/latest/userguide/eks-optimized-ami.html for details.

@JayThomason
Copy link

@bsakweson I had the same issue today when I tried upgrading to 1.14.6.

Maybe the docs/README could be updated to reflect that only the major version should be specified.

@barryib
Copy link
Member

barryib commented Sep 20, 2019

@vranystepan - Does the @bsakweson's comment help you ?

@barryib
Copy link
Member

barryib commented Sep 23, 2019

@bsakweson I had the same issue today when I tried upgrading to 1.14.6.
Maybe the docs/README could be updated to reflect that only the major version should be specified.

This should specified in the AWS EKS documentation. You must only provider major version for EKS cluster. AWS handle minor upgrades for you. You can send a PR for that https://github.com/awsdocs/amazon-eks-user-guide

@vranystepan I'm closing this issue. Feel free to re-open it if the provided "solution" doesn't work for you.

@barryib barryib closed this as completed Sep 23, 2019
@hato221
Copy link

hato221 commented Oct 5, 2019

@barryib the issue is not related to EKS version. If you check @vranystepan's aws ec2 describe ... command, you will see that he tried to search for any image which has the owner with ID 602401143452. For Hong Kong (ap-east-1) region, you need to change owner ID to 800184023465 otherwise, your search will return empty results.

@barryib
Copy link
Member

barryib commented Oct 6, 2020

@hato221 I opened this PR #1038 to address the default owner issue. Can you please, tell me if it solves your issue.

@barryib barryib reopened this Oct 6, 2020
@sysnasri
Copy link

I have the same issue but it was about cluster_version variable which I have set it to 1.22 but it worked with 1.20

@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 16, 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