...
How exactly AWS has to be configured for the scenario can be read under Instance profile configuration in AWS .
Alternatively we can use ECS services to deploy a container image. For this purpose read this documentation: Attach task-execution role to task definition in Elastic Container Service