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

Add certificates and sha1_fingerprint as exported attributes to aws_eks_cluster module #2227

Closed
devopsmash opened this issue Sep 9, 2022 · 5 comments · Fixed by #2249
Closed

Comments

@devopsmash
Copy link

Today, in order to create aws_iam_openid_connect_provider to my EKS cluster I need to provide thumbprint_list.
In order to retrieve the thumbprint_list I'll have to use the data source tls_certificate for that.

Example:

resource "aws_eks_cluster" "example" {
  # ... other configuration ...
}

data "tls_certificate" "example" {
  url = aws_eks_cluster.example.identity[0].oidc[0].issuer
}

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

From: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/eks_cluster#enabling-iam-roles-for-service-accounts

There is any way to avoid from using the data source tls_certificate by adding the tls_certificate data (like certificates and sha1_fingerprint) as part of the aws_eks_cluster module attributes?

@bryantbiggs
Copy link
Member

what are you doing differently than what we provide here https://github.com/terraform-aws-modules/terraform-aws-eks/blob/master/main.tf#L201-L218

@devopsmash
Copy link
Author

Hi @bryantbiggs , I just want to avoid from using the data, and get the sha1_fingerprint attribute directly from aws_eks_cluster

data "tls_certificate" "example" {
  url = aws_eks_cluster.example.identity[0].oidc[0].issuer
}

If this is not the scope of aws_eks_cluster I can close this issue

@bryantbiggs
Copy link
Member

we can absolutely support this since the data source is already used in the codebase - adding in #2249

@antonbabenko
Copy link
Member

This issue has been resolved in version 18.30.0 🎉

@github-actions
Copy link

github-actions bot commented Nov 8, 2022

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 Nov 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants