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

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

Open
HYERIN0718 opened this issue Aug 21, 2022 · 2 comments

Comments

@HYERIN0718
Copy link
Collaborator

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

on eks-workers.tf line 1, in data "aws_ami" "eks-worker-hr":
1: data "aws_ami" "eks-worker-hr" {


eks-workers.tf

data "aws_ami" "eks-worker-hr" {
  filter {
    name   = "name"
    values = ["amazon-eks-node-${aws_eks_cluster.tean.version}-v*"]
  }

  most_recent = true
  owners = ["666795122466"]

}

locals {
  demo-node-userdata = <<USERDATA
#!/bin/bash
set -o xtrace
/etc/eks/bootstrap.sh --apiserver-endpoint '${aws_eks_cluster.tean.endpoint}' --b64-cluster-ca '${aws_eks_cluster.tean.certificate_authority[0].data}' '${var.cluster-name}'
USERDATA

}

resource "aws_launch_configuration" "tean" {
  associate_public_ip_address = true
  iam_instance_profile = aws_iam_instance_profile.tean-node.name
  image_id      = data.aws_ami.eks-worker-hr.id
  instance_type = "t2.micro"
  name_prefix = "terraform-eks-tean"
  security_groups = [aws_security_group.tean-node.id]

  lifecycle {
    create_before_destroy = true
  }

}

resource "aws_autoscaling_group" "tean" {
  desired_capacity = 2
  launch_configuration = aws_launch_configuration.tean.id
  max_size = 2
  min_size = 1
  name = "terraform-eks-tean"

  vpc_zone_identifier = module.vpc.public_subnets
}
@HYERIN0718
Copy link
Collaborator Author

iam-workers.tf

eks-workers.tf

수정했지만 여전히 오류 발생


aws_eks_node_group.tean-node: Still creating... [10s elapsed]
aws_eks_node_group.tean-node: Still creating... [20s elapsed]

Error: error waiting for EKS Node Group (terraform-eks-tean:tean-node) to create: unexpected state 'CREATE_FAILED', wanted target 'ACTIVE'. last error: 1 error occurred:
        * subnet-0e7f9e7f6491e1e49, subnet-083f79584ee52592a: Ec2SubnetInvalidConfiguration: One or more Amazon EC2 Subnets of [subnet-0e7f9e7f6491e1e49, subnet-083f79584ee52592a] for node group tean-node does not automatically assign public IP addresses to instances launched into it. If you want your instances to be assigned a public IP address, then you need to enable auto-assign public IP address for the subnet. See IP addressing in VPC guide: https://docs.aws.amazon.com/vpc/latest/userguide/vpc-ip-addressing.html#subnet-public-ip`



@HYERIN0718
Copy link
Collaborator Author

vpc.tf
subnet 리소스에 내용 추가해서 오류 해결함
map_public_ip_on_launch = true => 서브넷에 생성된 인스턴스에 퍼블릭 IP 주소를 할당시켜줌

resource "aws_subnet" "tean-public-1" {
  cidr_block        = "10.0.101.0/24"
  vpc_id            = aws_vpc.tean.id
  availability_zone = "us-east-1b"
  map_public_ip_on_launch = true 
}

iam-workers.tf

eks-workers.tf

수정했지만 여전히 오류 발생

aws_eks_node_group.tean-node: Still creating... [10s elapsed]
aws_eks_node_group.tean-node: Still creating... [20s elapsed]

Error: error waiting for EKS Node Group (terraform-eks-tean:tean-node) to create: unexpected state 'CREATE_FAILED', wanted target 'ACTIVE'. last error: 1 error occurred:
        * subnet-0e7f9e7f6491e1e49, subnet-083f79584ee52592a: Ec2SubnetInvalidConfiguration: One or more Amazon EC2 Subnets of [subnet-0e7f9e7f6491e1e49, subnet-083f79584ee52592a] for node group tean-node does not automatically assign public IP addresses to instances launched into it. If you want your instances to be assigned a public IP address, then you need to enable auto-assign public IP address for the subnet. See IP addressing in VPC guide: https://docs.aws.amazon.com/vpc/latest/userguide/vpc-ip-addressing.html#subnet-public-ip`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant