# set up trust between IAM and the EKS cluster OIDC provider
eksctl utils associate-iam-oidc-provider --cluster=quick-cluster --approve
# create a role and service account with dynamo db access
eksctl create iamserviceaccount --cluster=quick-cluster \
--name=dynamo-sa --namespace=default \
--attach-policy-arn=arn:aws:iam::aws:policy/AmazonDynamoDBFullAccess --approve
# let's look at the service account
kubectl get sa dynamo-sa -o yaml
# we see the role that was created by eks - jump into the console and look at the trust policy on the role
# launch a container with the new service account
kubectl run -ti --rm super-pod-man \
--image=amazon/aws-cli \
--overrides='{ "spec": { "serviceAccount": "dynamo-sa" } }' \
--command bash
# from inside the container
aws dynamodb list-tables
Where does IRSA get its credentials from
aws sts assume-role-with-web-identity --role-arn $AWS_ROLE_ARN --web-identity-token $(cat $AWS_WEB_IDENTITY_TOKEN_FILE) --role-session-name session1