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

질문됨 4년 전3784회 조회
2개 답변
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

답변함 4년 전
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.

답변함 3년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠