Created
July 14, 2022 16:12
-
-
Save KyMidd/d2d85e4ae6a4cefe4cbb5f1bc70f6f62 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| data "aws_iam_policy_document" "app1_eks_assume_role_policy" { | |
| statement { | |
| actions = ["sts:AssumeRoleWithWebIdentity"] | |
| effect = "Allow" | |
| condition { | |
| test = "StringEquals" | |
| variable = "${replace(aws_iam_openid_connect_provider.oid_provider.url, "https://", "")}:aud" | |
| values = ["sts.amazonaws.com"] | |
| } | |
| # Condition to limit this role to be utilized by only the service account specified | |
| condition { | |
| test = "StringEquals" | |
| variable = "${replace(aws_iam_openid_connect_provider.oid_provider.url, "https://", "")}:sub" | |
| values = ["system:serviceaccount:default:our-eks-sa-name"] | |
| } | |
| principals { | |
| identifiers = [aws_iam_openid_connect_provider.oid_provider.arn] | |
| type = "Federated" | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment