AssumeRoleWithWebIdentity) to receive short-lived AWS credentials. This aligns pod identity with Kubernetes best practices and avoids annotating individual pods with AWS permissions.
Helpful references:
- AWS EKS IRSA docs: https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html
- STS AssumeRoleWithWebIdentity: https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRoleWithWebIdentity.html
- Kubernetes ServiceAccount / TokenRequest API: https://kubernetes.io/docs/reference/access-authn-authz/service-accounts-admin/#service-account-token-volume-projection
- IAM OIDC providers: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_oidc.html
How IRSA works (summary)
At runtime:- The pod requests a bound service account token (a projected JWT) from the Kubernetes TokenRequest API.
- The pod sends that JWT to AWS STS using
AssumeRoleWithWebIdentity, specifying the IAM role ARN. - STS validates the JWT against the role’s trust policy (which references the cluster OIDC provider and constrains
subclaims). - If valid, STS returns temporary AWS credentials that the pod uses to call AWS services (S3, DynamoDB, etc.).
- When credentials expire the pod repeats the token + STS flow to refresh them.
Key components required for IRSA
Quick example: ServiceAccount YAML
Create a ServiceAccount and annotate it with the IAM role ARN. The pod that uses this ServiceAccount gets a projected token it can exchange for AWS credentials.Example IAM trust policy (simplified)
This trust policy shows an IAM role that allowssts:AssumeRoleWithWebIdentity for a specific cluster OIDC provider and service account (system:serviceaccount:prod:my-app):

High-level sequence (step-by-step)
- Create or register the cluster OIDC provider in the AWS account (EKS exposes the issuer URL after cluster creation).
- Create an IAM role whose trust policy lists the OIDC provider as the
Federatedprincipal and permitssts:AssumeRoleWithWebIdentity. Constrainsubto the service account(s) that should assume the role. - Create a Kubernetes ServiceAccount annotated with the role ARN (annotation
eks.amazonaws.com/role-arn). - Deploy pods that use that ServiceAccount. Pods request a bound token from the TokenRequest API and exchange it with STS.
- STS validates the token and returns temporary credentials. The pod uses these credentials to call AWS APIs.
- Token/credential rotation is handled by repeating the TokenRequest + STS exchange when credentials expire.
Operational and scale considerations
- OIDC provider limits: AWS accounts have limits on the number of IAM OIDC providers you can register. If you run many clusters in a single account, you must plan for OIDC provider limits and account boundaries.
EKS automatically exposes the cluster OIDC issuer URL after cluster creation. Register that issuer as an IAM OIDC provider for the AWS account that will manage the IAM roles.
- Bootstrapping and automation: The cluster OIDC issuer URL is available only after cluster creation. Automated CI/CD flows that attempt to fully provision IAM roles before cluster creation should instead create the cluster first (or delay role trust policy creation until the OIDC provider is known).
If your provisioning pipelines create IAM roles up-front, update them to create the cluster (and register the cluster OIDC provider) before creating role trust policies that reference the OIDC provider.
- Cross-cluster reuse and multi-account designs: Since IAM is per-account, reusing a single IAM role across multiple clusters requires trusting multiple OIDC providers or making broader trust policies. Both options increase complexity and may widen blast radius. Consider one role per cluster/namespace pattern for clearer boundaries.
- Runtime and refresh behavior: IRSA provides short-lived credentials via STS. Ensure workloads handle credential rotation or use AWS SDKs with automatic refresh support.
Management implications
- Alignment with Kubernetes: IRSA maps AWS permissions into Kubernetes ServiceAccounts, improving auditability and reducing pod annotation sprawl.
- Added AWS-side configuration: You must manage OIDC providers and trust policies in IAM, which introduces operational overhead when managing many clusters or regions.
- Alternatives: Node-scoped IAM (kube2iam/kiam) gives coarser-grained control (node-level) and may be simpler for small deployments. Newer EKS pod-identity integrations and community projects continue to evolve, offering different trade-offs.

Alternatives and future directions
IRSA was an important step to unify Kubernetes service accounts with AWS IAM. Since then, AWS and the community have introduced additional pod identity integrations for EKS and other orchestration approaches. Evaluate trade-offs based on scale, operational model, and security posture:- Use IRSA when you want fine-grained pod-level IAM permissions mapped directly to ServiceAccounts.
- Consider node-scoped approaches (kube2iam, kiam) for simpler, smaller clusters where node-level scoping is acceptable.
- Explore EKS-native pod-identity integrations or newer community projects if they reduce operational overhead for your environment.
