awslabs / fargatecli

CLI for AWS Fargate
Apache License 2.0
893 stars 114 forks source link

InvalidParameterException: Unable to assume the service linked role. #35

Open luisbebop opened 6 years ago

luisbebop commented 6 years ago

On the first run got this problem:

[!] Could not run ECS task
InvalidParameterException: Unable to assume the service linked role. Please verify that the ECS service linked role exists.
status code: 400, request id: 83d5f2a7-12bf-11e8-8f9d-3fc6a73cfa3d

Fixed using the guide bellow: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service_IAM_role.html

ps: Nice project. Congratz! 🎉

jpignata commented 6 years ago

Interesting. I saw this a few times this week in a workshop we did through the Amazon ECS console. I'll see what I can do to reproduce.

jpignata commented 6 years ago

I suppose we can manually create the service linked role before creating a service to be safe.

panbanda commented 6 years ago

Just to clarify, an official response:

If you are using a CloudFormation template to create a ECS service via the “AWS::IAM::Policy” and “AWS::ECS::Service” resource types, the dependency of the service on the policy has not been declared by using the DependsOn attribute. Because CloudFormation creates, updates, and deletes resources in parallel, creating “AWS::ECS::Service” without specifying the dependency on “AWS::IAM::Policy” can cause CloudFormation to attempt to create “AWS::ECS::Service” before the “AWS::IAM::Policy” is ready.

https://aws.amazon.com/premiumsupport/knowledge-center/assume-role-validate-listeners/