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.tls_certificate.tls.certificates is empty list of object, after tls updated to 4.0.0 from 3.4.0 #31496

Closed
kailashsridharan opened this issue Jul 22, 2022 · 9 comments
Labels
bug new new issue not yet triaged

Comments

@kailashsridharan
Copy link

Terraform Version

...

Terraform Configuration Files

...

Debug Output

Expected Behavior

Actual Behavior

Steps to Reproduce

Additional Context

References

@kailashsridharan kailashsridharan added bug new new issue not yet triaged labels Jul 22, 2022
@kailashsridharan
Copy link
Author

Bad ticket closing it

@andrei-dascalu
Copy link

@kailashsridharan Why is this a bad ticket? I'm having an issue like that - basically in the form of

data "tls_certificate" "eks" {
  url = aws_eks_cluster.eks-cluster.identity[0].oidc[0].issuer

  depends_on = [
    aws_eks_cluster.eks-cluster
  ]
}
resource "aws_iam_openid_connect_provider" "eks" {
  client_id_list  = ["sts.amazonaws.com"]
  thumbprint_list = [data.tls_certificate.eks.certificates[0].sha1_fingerprint]
  url             = aws_eks_cluster.eks-cluster.identity[0].oidc[0].issuer

  depends_on = [
    aws_eks_cluster.eks-cluster
  ]
}

Message:

│ Error: Invalid index
│ 
│   on modules/development/09-oidc.tf line 11, in resource "aws_iam_openid_connect_provider" "eks":
│   11:   thumbprint_list = [data.tls_certificate.eks.certificates[0].sha1_fingerprint]
│     ├────────────────
│     │ data.tls_certificate.eks.certificates is empty list of object
│ 
│ The given key does not identify an element in this collection value: the collection has no elements.
``

@ShikharG26
Copy link

@andrei-dascalu Even I am facing this issue from last Friday.
I am using eks module and earlier it was working fine but from last Friday it is failing here.

@rekcah78
Copy link

@ShikharG26 did you try with the last version of the eks module ? https://github.com/terraform-aws-modules/terraform-aws-eks/releases/tag/v18.26.6

@ShikharG26
Copy link

ShikharG26 commented Jul 25, 2022

@rekcah78 No I am using 18.20.5.
Although I checked more and it seems the problem is with TLS provider as it is updated to 4.0.0

Pinning the TLS version to 3.4.0 works as the url you provided also doing the same.

terraform { required_providers { tls = { source = "hashicorp/tls" version = "3.4.0" } } }

@jlees-Gss
Copy link

We fixed by rolling back the tls in the provider from 4.0.0 to 3.0.0.
MicrosoftTeams-image (3)

@przemub
Copy link

przemub commented Jul 25, 2022

@teamterraform Could you please re-open this? I would open a new ticket, but this one shows up in search engines when looking for the solution.

For me, the error occurs within the EKS module:

│ Error: Invalid index
│ 
│   on .terraform/modules/eks/main.tf line 171, in resource "aws_iam_openid_connect_provider" "oidc_provider":
│  171:   thumbprint_list = concat([data.tls_certificate.this[0].certificates[0].sha1_fingerprint], var.custom_oidc_thumbprints)

Rolling back hashicorp/tls to 3.4.0 fixes the issue.

@bflad
Copy link
Contributor

bflad commented Jul 25, 2022

Hi folks 👋 The GitHub issue tracking this error message caused by the TLS provider was here: hashicorp/terraform-provider-tls#244

There was a version 4.0.1 release today which should resolve this particular issue. If you have further feedback on the TLS provider, please use its issue tracker. Thank you.

@github-actions
Copy link
Contributor

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 Aug 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug new new issue not yet triaged
Projects
None yet
Development

No branches or pull requests

7 participants