Skip to content

Instantly share code, notes, and snippets.

@holypriest
Last active July 20, 2020 04:10
Show Gist options
  • Save holypriest/dfbe7a55a777a59d39548336484a2356 to your computer and use it in GitHub Desktop.
Save holypriest/dfbe7a55a777a59d39548336484a2356 to your computer and use it in GitHub Desktop.
AssumeRole policy to allow Kubernetes ServiceAccounts to access AWS resources
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "",
"Effect": "Allow",
"Principal": {
"Federated": "arn:aws:iam::<your-aws-account>:oidc-provider/oidc.eks.us-east-1.amazonaws.com/id/<oidc-of-your-eks-cluster>"
},
"Action": "sts:AssumeRoleWithWebIdentity",
"Condition": {
"StringEquals": {
"oidc.eks.us-east-1.amazonaws.com/id/<oidc-of-your-eks-cluster>:sub": [
"system:serviceaccount:airflow-on-k8s:workers-sva",
"system:serviceaccount:airflow-on-k8s:tasks-sva"
]
}
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment