A company is using an Amazon Elastic Kubernetes Service (Amazon EKS) cluster. The company must ensure that Kubernetes service accounts in the EKS cluster have secure and granular access to specific AWS resources by using IAM roles for service accounts (IRSA). Which combination of solutions will meet these requirements? (Choose two.)
- ACreate an IAM policy that defines the required permissions Attach the policy directly to the IAM role of the EKS nodes.
- BImplement network policies within the EKS cluster to prevent Kubernetes service accounts from accessing specific AWS services.
- CModify the EKS cluster's IAM role to include permissions for each Kubernetes service account. Ensure a one-to-one mapping between IAM roles and Kubernetes roles.
- DDefine an IAM role that includes the necessary permissions. Annotate the Kubernetes service accounts with the Amazon ResourceName (ARN) of the IAM role. (correct answer)
- ESet up a trust relationship between the IAM roles for the service accounts and an OpenID Connect (OIDC) identity provider. (correct answer)
Reveal answer & explanationHide answer
The correct answer is D, E. Option D: Define an IAM role that includes the necessary permissions. Annotate the Kubernetes service accounts with the Amazon ResourceName (ARN) of the IAM role. Option E: Set up a trust relationship between the IAM roles for the service accounts and an OpenID Connect (OIDC) identity provider.
Explanation
An IAM role grants temporary, least-privilege permissions to AWS resources without long-term credentials. AWS IAM controls authenticated and authorized access to AWS resources with fine-grained policies.