|
| 1 | +**Example 1: To create an EKS Pod Identity association in EKS cluster** |
| 2 | + |
| 3 | +The following ``create-pod-identity-association`` example creates an EKS Pod Identity association between a service account in the EKS cluster and an IAM role. :: |
| 4 | + |
| 5 | + aws eks create-pod-identity-association \ |
| 6 | + --cluster-name eks-customer \ |
| 7 | + --namespace default \ |
| 8 | + --service-account default \ |
| 9 | + --role-arn arn:aws:iam::111122223333:role/my-role |
| 10 | + |
| 11 | +Output:: |
| 12 | + |
| 13 | + { |
| 14 | + "association": { |
| 15 | + "clusterName": "eks-customer", |
| 16 | + "namespace": "default", |
| 17 | + "serviceAccount": "default", |
| 18 | + "roleArn": "arn:aws:iam::111122223333:role/my-role", |
| 19 | + "associationArn": "arn:aws:eks:us-west-2:111122223333:podidentityassociation/eks-customer/a-8mvwvh57cu74mgcst", |
| 20 | + "associationId": "a-8mvwvh57cu74mgcst", |
| 21 | + "tags": {}, |
| 22 | + "createdAt": "2025-05-24T19:40:13.961000-05:00", |
| 23 | + "modifiedAt": "2025-05-24T19:40:13.961000-05:00" |
| 24 | + } |
| 25 | + } |
| 26 | + |
| 27 | +For more information, see `Learn how EKS Pod Identity grants pods access to AWS services <https://docs.aws.amazon.com/eks/latest/userguide/pod-identities.html>`__ in the *Amazon EKS User Guide*. |
| 28 | + |
| 29 | +**Example 2: To create an EKS Pod Identity association in EKS cluster with tags** |
| 30 | + |
| 31 | +The following ``create-pod-identity-association`` creates an EKS Pod Identity association between a service account and an IAM role in the EKS cluster with tags. :: |
| 32 | + |
| 33 | + aws eks create-pod-identity-association \ |
| 34 | + --cluster-name eks-customer \ |
| 35 | + --namespace default \ |
| 36 | + --service-account default \ |
| 37 | + --role-arn arn:aws:iam::111122223333:role/my-role \ |
| 38 | + --tags Key1=value1,Key2=value2 |
| 39 | + |
| 40 | +Output:: |
| 41 | + |
| 42 | + { |
| 43 | + "association": { |
| 44 | + "clusterName": "eks-customer", |
| 45 | + "namespace": "default", |
| 46 | + "serviceAccount": "default", |
| 47 | + "roleArn": "arn:aws:iam::111122223333:role/my-role", |
| 48 | + "associationArn": "arn:aws:eks:us-west-2:111122223333:podidentityassociation/eks-customer/a-9njjin9gfghecgoda", |
| 49 | + "associationId": "a-9njjin9gfghecgoda", |
| 50 | + "tags": { |
| 51 | + "Key2": "value2", |
| 52 | + "Key1": "value1" |
| 53 | + }, |
| 54 | + "createdAt": "2025-05-24T19:52:14.135000-05:00", |
| 55 | + "modifiedAt": "2025-05-24T19:52:14.135000-05:00" |
| 56 | + } |
| 57 | + } |
| 58 | + |
| 59 | +For more information, see `Learn how EKS Pod Identity grants pods access to AWS services <https://docs.aws.amazon.com/eks/latest/userguide/pod-identities.html>`__ in the *Amazon EKS User Guide*. |
0 commit comments