Failed registering Scalable Target when defining auto scale option for ECS

enter image description here

But I am getting this error:

Failed registering Scalable Target

Scalable Target could not register scalable target: 1 validation error detected: Value '' at 'roleARN' failed to satisfy constraint: Member must have length greater than or equal to 1 (Service: AWSApplicationAutoScaling; Status Code: 400; Error Code: ValidationException; Request ID: dff37db1-4be5-11e7-8739-df4df785c602)

enter image description here

I really don't know how to resolve this issue.

I have used an account play-admin to create all these cluster and service. It has the following rights:

enter image description here

The task is run using this role play-ecs:

enter image description here

I have also put in the trust relationship to this role:enter image description here

My Question:

What permission do I need to grant to get the autoscaling to work? What confuse me greatly is in the message: "Member must have length greater than or equal to 1 ", what does this member refer to? The IAM account I used to create this autoscaling? The role of the task? Or the newly created 'IAM autoscale role' (see the following screen shot)? If it is the last one, it seems like it is beyond my control.

*This screensot shows that a step IAM Autoscale role: <create_new> is executed by ECS

enter image description here


Solution 1:

For what it's worth, I had to add the trust relationship of "application-autoscaling.amazonaws.com" on my "ecsAutoscaleRole".