jenkins-x/terraform-aws-eks-jx

Setting create_tekton_role to false breaks the module

ankitm123 opened this issue · 1 comments

Summary

If I set create_tekton_role to false, it does not work.

Steps to reproduce the behavior

in main.tf:

module "eks-jx" {
  source               = "../../"
  vault_user           = var.vault_user
  is_jx2               = false
  install_kuberhealthy = true
  create_nginx         = true
  cluster_version      = "1.20"
  nginx_chart_version  = "3.12.0"
  create_tekton_role   = false
}

Expected behavior

terraform plan/apply succeeds!

Actual behavior

Error: Invalid index

│ on ../../modules/cluster/irsa.tf line 46, in module "iam_assumable_role_tekton_bot":
│ 46: role_policy_arns = concat([aws_iam_policy.tekton-bot[0].arn], var.additional_tekton_role_policy_arns)
│ ├────────────────
│ │ aws_iam_policy.tekton-bot is empty tuple

│ The given key does not identify an element in this collection value.

Terraform version

The output of terraform version is: 0.15.3

COPY OUTPUT HERE

Module version

Operating system

fixed in #266