Skip to main content
Connecting applications to AWS services from inside an Amazon Elastic Kubernetes Service (EKS) cluster is streamlined through native integration. Leveraging Kubernetes-native constructs like ServiceAccounts and IAM roles for pods, applications can securely access various AWS services using AWS SDKs. This enhances scalability and flexibility while maintaining robust security protocols. Below document is an example of connecting to S3 from inside of EKS cluster.

Pre-requisites

Step 1 - Get the OIDC provider

Get the OIDC issuer URL and check if the OIDC provider exists

Step 2 - Create IAM role with assume role policy and required permissions

  1. Create an following assume role policy
  2. Create an IAM role using this assume role policy
  3. Create the IAM policy with the required permissions.
  4. Attach the policy to the IAM role

Step 4 - Annotate the serviceaccount with IAM role ARN

Create a service account in the namespace and annotate it with the IAM role ARN using TrueFoundry platform here with the following serviceaccount spec:

Step 5 - Test

  1. Run a pod and test if you are able to perform operations on the AWS S3 bucket
  2. Go inside the pod and execute the following command
  3. Run the command