Search code examples
amazon-web-servicesamazon-s3amazon-ecs

How to access AWS S3 from within an ECS - Fargate cluster


I have an ECS-Fargate cluster running, and my application needs to access S3 bucket to store files as well as retrieve these files. How do i get my application to access S3 from within the cluster.


Solution

  • You would use the AWS SDK for the programming language you are using just like you would if your code was running anywhere else.

    The only ECS/Fargate specific thing here is that you would need to assign an ECS Task Role with the appropriate S3 permissions. Note that this is separate from the ECS Task Execution Role.