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

Module Error: NoSuchEntity: The user with name jenkins-x-vault #32

Closed
zakswindow opened this issue Apr 24, 2020 · 8 comments
Closed

Module Error: NoSuchEntity: The user with name jenkins-x-vault #32

zakswindow opened this issue Apr 24, 2020 · 8 comments

Comments

@zakswindow
Copy link

zakswindow commented Apr 24, 2020

Hi guys,

I think I found a bug with the new version. I haven't supplied an IAM user, I want the module to create one to keep the installation clean but I get the following error.

Error: error getting user: NoSuchEntity: The user with name jenkins-x-vault cannot be found.
status code: 404, request id: 0b3eebff-f6e3-4443-93bb-a5b605627029

on ../aws-eks-jx/modules/vault/main.tf line 19, in data "aws_iam_user" "vault_user":
19: data "aws_iam_user" "vault_user" {

@hferentschik Thank you for making the new version available. Much appreciated. I am testing out the new module version. It's trying to find if the user does exist if then create one but throwing 404. Not sure if it is something to do with terraform version.

I am using following versions:

Terraform v0.12.24

  • provider.aws v2.52.0
  • provider.kubernetes v1.11.1
  • provider.local v1.4.0
  • provider.null v2.1.2
  • provider.random v2.2.1
  • provider.template v2.1.2
@hferentschik
Copy link
Contributor

@zakswindow, thanks for raising the issue. Can you provide some more context? How does your Terraform file using this module look like? Which variables do you specify? Do you have an existing cluster and hence some existing state?

@hferentschik
Copy link
Contributor

I want the module to create one to keep the installation clean but I get the following error.

When do you get this error? During a terraform plan or terraform apply?

@zakswindow
Copy link
Author

zakswindow commented Apr 27, 2020

@zakswindow, thanks for raising the issue. Can you provide some more context? How does your Terraform file using this module look like? Which variables do you specify? Do you have an existing cluster and hence some existing state?

@hferentschik Thanks for your reply. I have a completely new state file. New Account, everything new. IAM is clean. When I do terraform plan it happens, the same thing happens when I do terraform apply. Basically, the module wants this IAM user available, it breaks before even it tries to create it.

I think it comes from here:

data "aws_iam_user" "vault_user" {
user_name = var.vault_user == "" ? aws_iam_user.jenkins-x-vault[0].name : var.vault_user
}

(https://github.com/jenkins-x/terraform-aws-eks-jx/blob/master/modules/vault/main.tf)

I have managed to fix it. I no longer see this error.

But i have another issue. Vault still doesn't work for me. Today, i will just clone your module, will create the cluster without changing anything to see if it works. I will keep you posted. Thanks

@zakswindow
Copy link
Author

zakswindow commented Apr 27, 2020

@zakswindow, thanks for raising the issue. Can you provide some more context? How does your Terraform file using this module look like? Which variables do you specify? Do you have an existing cluster and hence some existing state?

@hferentschik Please see my terraform file below:

module "eks-jx" {
source = "../aws-eks-jx/"

vault_user = var.vault_iam_user
enable_external_dns = true
create_and_configure_subdomain = true
cluster_name = var.cluster_name
desired_node_count = "0"
max_node_count = "0"
min_node_count = "0"
enable_tls = true
region = var.region
node_machine_type = var.ec2_type
enable_logs_storage = true
enable_reports_storage = true
enable_repository_storage = true
apex_domain = var.apex_domain
tls_email = var.tls_email
subdomain = "test"

}

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 "jxui_iam_role" {
value = module.eks-jx.jxui_iam_role
description = "The Vault IAM user secret"
}

output "tekton_bot_iam_role" {
value = module.eks-jx.tekton_bot_iam_role
description = "The Vault IAM user secret"
}

output "cert_manager_iam_role" {
value = module.eks-jx.cert_manager_iam_role
description = "The Vault IAM user secret"
}

output "cm_cainjector_iam_role" {
value = module.eks-jx.cm_cainjector_iam_role
description = "The Vault IAM user secret"
}

output "controllerbuild_iam_role" {
value = module.eks-jx.controllerbuild_iam_role
description = "The Vault IAM user secret"
}

output "external_dns_iam_role" {
value = module.eks-jx.external_dns_iam_role
description = "The Vault IAM user secret"
}

@ankitm123
Copy link
Member

@zakswindow are you still having this issue? Should be fixed by now ...

@ankitm123
Copy link
Member

May be this can be closed @zakswindow @hferentschik?

@zakswindow
Copy link
Author

May be this can be closed @zakswindow @hferentschik?

@zakswindow
Copy link
Author

i have closed it as i have found some workaround and fixed the issue.

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

No branches or pull requests

3 participants