Amazon EKS
Agent and workload identity is in preview release for AWS Identity and Access Management (IAM) and is subject to change.
Each workload in an Amazon Elastic Kubernetes Service (Amazon EKS) cluster can receive its own identity. With the default template, the identity is built from the Region, cluster, namespace, and service account, and every pod under one service account shares it. To give each pod its own identity, create a template with a custom path pattern that ends with the pod UID or pod name. For more information, see Create workload identity templates. IAM adds the identity to each pod's EKS Pod Identity role session, and AWS CloudTrail and your policies can tell workloads apart. Pods can also request JSON Web Token SPIFFE Verifiable Identity Documents (JWT-SVIDs) and X.509 SPIFFE Verifiable Identity Documents (X.509-SVIDs) for service-to-service authentication.
How it works on Amazon EKS
Each time a pod gets credentials from the EKS Pod Identity Agent:
The EKS control plane reports the pod's cluster, namespace, and service account. EKS verifies the pod's service account token and reads the pod spec itself, so the pod can't change these facts.
AWS Security Token Service (AWS STS) evaluates the template's attestation policy and builds the identifier. The Pod Identity Agent then returns the pod's role session with its identity.
The application requests JWT-SVIDs or X.509-SVIDs from the Pod Identity Agent when it needs them.
The Pod Identity Agent delivers the role session through the standard EKS Pod Identity credential path. It serves JWT-SVIDs and X.509-SVIDs through a local socket that's compatible with the Secure Production Identity Framework for Everyone (SPIFFE) Workload API. Getting new credentials through this socket needs the EKS control plane to be reachable.
When agent and workload identity is turned on for a Pod Identity association, the standard EKS Pod Identity credentials carry the identity. Your application doesn't need any change. For details, see Use the credentials in your application.
Choose a template definition
|
Default ( |
Service mesh ( |
|---|---|---|
Identifier |
|
|
Provider |
An organization-level provider with |
One account-level provider per cluster or per mesh, with a domain such as |
Path prefix |
Required with |
Must be empty |
Required values |
PathPrefix with |
One or more cluster ARNs, which must be in your account |
Who can use it |
Any account allowed under the provider |
Only the account that owns the provider |
Use for |
Calls to AWS services and to services outside AWS, when you don't run Istio |
Istio in sidecar mode. Istio accepts only ns/ and sa/ directly under the trust domain, and refuses identities from the default definition. Istio ambient mode isn't supported. |
With the default definition, a re-created cluster with the same name receives the same identifiers, and so the same access, as a re-created namespace or service account already does.
To use one identity across all clusters in a mesh, create one provider for the mesh and one mesh template that lists every cluster ARN. To add a cluster, replace the template's attestation policy with one that also lists the new cluster's ARN, using put-workload-identity-template-attestation-policy. The identifiers don't change. If you re-create the template from the definition instead, delete the old template first. Two templates with the same path prefix and path pattern can't exist under one provider, and pods can't receive identities between the delete and the create.
To create a mesh provider and template, open the IAM console and choose Agent and workload identity. On the Amazon EKS card, choose the Set up a service mesh provider for this account link, which opens in a new tab. Choose One EKS cluster or Multiple EKS clusters, enter each Cluster ARN, and then choose Create service mesh provider. The console creates the provider and the template together. For one cluster, the default trust domain is eks-<cluster-name>.<region>.<account-id>.aws.internal. For several clusters, it's <provider-name>.<account-id>.aws.internal. You can enter your own trust domain instead, such as cluster.local, which Istio commonly uses.
Set up agent and workload identity for an EKS workload
Prerequisites
A workload identity provider and a template that admits
pods.eks.amazonaws.com. See Create workload identity templates.The EKS Pod Identity Agent add-on (
eks-pod-identity-agent), version v1.5.0-eksbuild.3 or later. EKS Auto Mode includes the Pod Identity Agent. For agent and workload identity, Auto Mode nodes need an Auto Mode AMI released on or after November 18, 2026.An EKS Pod Identity association for the workload's service account, or create one in the following steps.
An IAM role whose trust policy lets EKS Pod Identity (
pods.eks.amazonaws.com) assume it. Agent and workload identity needs no change to the trust policy. See Role trust policies.
Console
Open the Amazon EKS console at https://console.aws.amazon.com/eks/
and choose your cluster. On the Access tab, choose Pod Identity associations, and then choose Create. To change an existing association, choose it, and then choose Edit.
Enter the IAM role, Kubernetes namespace, and Kubernetes service account.
Under IAM for agents and workloads - preview, turn on Enable IAM for agents and workloads. If the console shows that your EKS Pod Identity Agent add-on is out of date, choose Update version.
For Provider, choose the provider or enter its ARN. To create one, choose Create provider.
For Template, choose a template of that provider or enter its ARN. To create one from an EKS definition, choose Create template.
Choose Create, or Save changes if you're editing an association, and then restart the pods.
AWS CLI
Set the template and its provider when you create the Pod Identity association:
aws eks create-pod-identity-association \ --cluster-name prod-cluster-1 \ --namespace payments \ --service-account checkout-sa \ --role-arn arn:aws:iam::111122223333:role/eks-pod-identity-role \ --workload-identity-config '{ "enabled": true, "templateArn": "arn:aws:iam::111122223333:workload-identity-template/eks-prod-1", "providerArn": "arn:aws:iam::111122223333:workload-identity-provider/payments-prod" }'
Both templateArn and providerArn are required, and providerArn must be the provider that the template uses. Otherwise, EKS rejects the association.
Before EKS saves the association, it checks your permissions. On the template, you need iam:PassWorkloadIdentityTemplate, iam:GetWorkloadIdentityTemplate, and iam:GetWorkloadIdentityTemplateAttestationPolicy. On the provider, you need iam:GetWorkloadIdentityProvider. On the role, you need iam:PassRole and iam:GetRole, which EKS Pod Identity already requires.
Every pod that uses the association's namespace and service account receives the same identity.
A change applies to pods created after it. Restart existing pods to pick it up.
To stop issuing identities to new pods, set enabled to false. The association keeps the ARNs.
An association without --workload-identity-config works as a standard Pod Identity association.
To change an existing association, use update-pod-identity-association with the same parameter. An update that sets agent and workload identity must include both templateArn and providerArn. EKS rejects an update with only one of them.
AWS API
Amazon EKS API Reference: CreatePodIdentityAssociation, UpdatePodIdentityAssociation
Use the credentials in your application
After you turn on agent and workload identity for a Pod Identity association, the credentials that EKS Pod Identity delivers carry the identity. The AWS SDKs and AWS Command Line Interface (AWS CLI) use them through their default credential chain, with no code or configuration change. Use an AWS SDK version that supports EKS Pod Identity. For the versions, see Use pod identity with the AWS SDK in the Amazon EKS User Guide.
To get JWT-SVIDs and X.509-SVIDs, use a SPIFFE Workload API client:
Option |
Code change |
Gives you |
Notes |
|---|---|---|---|
SPIFFE Workload API client |
Use any SPIFFE library |
JWT-SVIDs and X.509-SVIDs |
The socket is |
Keep these points in mind when you use the SPIFFE Workload API:
JWT-SVIDs are signed with RS256. For a JWT-SVID signed with ES384, call GetWebIdentityToken through the AWS SDK and choose the algorithm.
Repeat requests for the same audience can return the same JWT-SVID. If a service accepts each token only once, get the token with GetWebIdentityToken through the AWS SDK instead.
Your AWS Private CA signs each X.509-SVID with the signing algorithm that you created the CA with.
For more information, see Authenticate to services outside AWS.