fargatecli
fargatecli copied to clipboard
EntityAlreadyExists error when creating a service
When creating a service in an empty cluster, I'm seeing the following error:
EntityAlreadyExists: Role with name ecsTaskExecutionRole already exists.
status code: 409, request id: 6eb085be-77e1-11e9-a00c-09daa6044045
It looks like for whatever reason the GetRole call in CreateEcsTaskExecutionRole isn't finding the existing role, and tries to recreate it.
https://github.com/jpignata/fargate/blob/master/iam/role.go#L28
If I delete the role, this code recreates it correctly, but the next service I try to add hits the same error.
Also experiencing this issue. It seems to happen for me when fargate task run fails before launching a container. You can repro this by running fargate with a new IAM user with enough IAM policy grants to create the ecsTaskExecutionRole but nothing else.