Last active
October 11, 2020 22:37
-
-
Save NassK/d7358124125f5d97f990a63ef8a3d17d to your computer and use it in GitHub Desktop.
step_5.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Step 5: Integrating Service Accounts with IAM role | |
data "tls_certificate" "cluster" { | |
url = aws_eks_cluster.cluster.identity.0.oidc.0.issuer | |
} | |
resource "aws_iam_openid_connect_provider" "cluster" { # We need an open id connector to allow our service account to assume an IAM role | |
client_id_list = ["sts.amazonaws.com"] | |
thumbprint_list = concat([data.tls_certificate.cluster.certificates.0.sha1_fingerprint], []) | |
url = aws_eks_cluster.cluster.identity.0.oidc.0.issuer | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variable "region" { | |
description = "The AWS region" | |
default = "eu-west-1" | |
} | |
variable "cluster_name" { | |
description = "The name of the Amazon EKS cluster." | |
default = "my-eks-cluster" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment