Using ECS Container Authentication Endpoint

When you run code within an ECS image, AsyncAws is able to fetch Credentials from the Role attached to the instance using and internal aws endpoint.

When running an application on ECS, this is the simplest way to grant permissions to the application. You have nothing to configure on the application, you only grant permissions on the Role attached to the instance.

More about this in the AWS official documentation: IAM Roles for Tasks