Closed troyhart closed 4 years ago
Looking at this PR: #110, you need to add the region. See this: https://github.com/jenkins-x/terraform-aws-eks-jx/pull/110#discussion_r452746116
That didn't address the issue. I added the provider block for aws specifying us-east-1 as the note indicated to do in PR #110. My new main.tf
is as follows:
module "eks-jx" {
source = "jenkins-x/eks-jx/aws"
}
provider "aws" {
region = "us-east-1"
}
output "jx_requirements" {
value = module.eks-jx.jx_requirements
}
output "vault_user_id" {
value = module.eks-jx.vault_user_id
description = "The Vault IAM user id"
}
output "vault_user_secret" {
value = module.eks-jx.vault_user_secret
description = "The Vault IAM user secret"
}
output "tekton_bot_iam_role" {
value = module.eks-jx.tekton_bot_iam_role
description = "The Tekton Bot IAM user role"
}
I didn't know exactly what to do next so I just tried execute terraform apply
again. That also didn't work for the same reason (cluster not found). Next, I executed terraform destroy
then I deleted all the terraform state in the directory with my main.tf, including the hidden .terraform/
directory. Then I executed terraform init
followed by terraform apply
and once again it fails for the same reason: module.eks-jx.module.cluster.null_resource.kubeconfig (local-exec): An error occurred (ResourceNotFoundException) when calling the DescribeCluster operation: No cluster found for name: tf-jx-meet-sheepdog.
What do you see when you run:
aws eks list-clusters
May be issues with cli using wrong profile/account?
‣‣ aws eks list-clusters
{
"clusters": []
}
And yet at the same time, this is the view from the aws web ui
That explains it. Pretty sure it's a wrong profile/account. Which profile are you using? Should be in your .aws/credentials file. After you find that, try:
aws eks list-clusters --profile <right-profile> --region us-east-1
‣‣ aws eks list-clusters --profile default --region us-east-1
{
"clusters": [
"tf-jx-meet-sheepdog"
]
}
So, if you try:
AWS_PROFILE=default AWS_REGION=us-east-1 terraform apply
I think it will work. Let me know.
YEAH!!!!!!!!
That worked! Thanks!
Probably need to look at why terraform cannot source it from the credentials file, but this is not a blocker. So going to close this.
/close
@ankitm123: Closing this issue.
Summary
I followed the instruction here to create a cluster: https://jenkins-x.io/docs/install-setup/create-cluster/eks/
terraform apply
takes an ample amount time to process before ending with the error indicated in the title.A cluster was created in the
us-east-1
region and I can get the vault user id and secret plus the jx-requirements.yml from terraform, so it partially worked.Steps to reproduce the behavior
main.tf
with the content specified belowterraform init
terraform apply
main.tf
Expected behavior
Create the AWS EKS cluster without producing an error message.
Actual behavior
Cluster created in AWS, in unknown condition.
Terraform version
The output of
terraform version
is:Module version
1.3.0
Operating system
Ubuntu 18.04.4