Failed registering Scalable Target when defining auto scale option for ECS

amazon-ecsamazon-iam

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

Best Answer

I had the same issue today and it appears that when you're setting up the configuration it creates a new IAM role but at the moment of executing the steps you mentioned something happens and that ARN is not passed (this is an AWS bug, I already reported it).

So what I did was try to configure the auto scaling for the service again, but this time it didn't create the ecsAutoscaleRole because it was already created, so it worked :)