跳至内容

Role is not valid

0

Hello everyone,

I am using Code Pipeline to trigger a Code Deploy deployment. The setup is working for the same application in 2 other different AWS accounts, but not on the 3rd account.

When the deployment is triggered, it fails immediately with "Role is not valid". I have no more information about why the role is not valid.
What I already tried that gave me same result:

  • recreate the pipeline with a different name
  • clone another pipeline and then reconfigure the new one
  • delete the Code Deploy deployment configuration and recreate it
  • took the JSON value of a working policy attached to the Role, compared it to the role generated by the pipeline, no differences
  • choose a shorter name for my pipeline (and the role automatically generated)

--> How to get more information about why the role is not valid ?
--> Any suggestions to solve my problem ?

I would be very grateful ! Thanks

Notes:
the deploy action I am triggering is "Amazon ECS (Blue/Green)"
I am using this king of setup: https://docs.aws.amazon.com/codepipeline/latest/userguide/tutorials-ecs-ecr-codedeploy.html

已提问 7 年前6419 查看次数

3 回答
2

Hi again,
I resolved the issue.
After contacting AWS Support I got some suggestion to resolve the issue:

"one possible cause of this error is the ECS Task Execution Role, defined in the task definition. It is possible that the arn of the ECS task execution role has an error or typo
This could occur, for example, if the task definition is the same as in another account - the role provided may be from that account."

Indeed, the role is cause was not the role used to create the pipeline, or the "ECS Task Execution Role" itself (defined in the AWS account). The problem was the dynamic configuration I was providing to code deploy in "taskdefinition.json". I had to fix the value I provide for the attribute "executionRoleArn".

Suggestion to AWS: display a more explicit error message (tell at least which role is in cause).

Cheers,
Tony

已回答 7 年前

0

I bumped into the same error message while operating via CI.
It turned out that I forgot to assume the user role before calling ECS operation.

已回答 5 年前

0

The error indicates that there is a misconfiguration in the task definition, such as malformed or misplaced parameters, or an incorrect resource ID/ARN reference. I solved this issue by placing the "requires_compatibilities" outside the container block.

In addition to using the right IAM role for the native ECS blue/green deployment strategy, which is supposed to use a role assumed by ecs.amazonaws.com

已回答 1 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

相关内容