What can cause the error "Invalid setup params for ECS deployment: Execution Role ARN is required for Fargate tasks" even when the Execution Role ARN is specified in Deployment specification?

This issue can be seen in case of ECS Fargate Deployment where Execution Role ARN is required as listed in our docs: https://docs.harness.io/article/riu73ehy2m-ecs-services#container_specification

But sometimes even after specifying the same inside ECS Fargate Service > Deployment specification > Container specification, it can fail with error message in workflow execution:

Invalid setup params for ECS deployment: Execution Role ARN is required for Fargate tasks

This happens when the the JSON file specified in Container specification > Advanced settings starts with following and retrieved directly using command “aws ecs describe-task-definition”

{
“taskDefinition”: {
“containerDefinitions”: [
{
“name”: “news-service”,
“image”: “${DOCKER_IMAGE_NAME}”,
“cpu”: 0,
“links”: ,
“portMappings”: [
{

Whereas we expect the Container specification to start like following(without “taskDefinition”):

“containerDefinitions”: [
{
“name”: “news-service”,
“image”: “${DOCKER_IMAGE_NAME}”,
“cpu”: 0,
“links”: ,
“portMappings”: [
{

Complete sample snippet :

2 Likes