Codepipeline deployed by CDK fails on the first run

0

Hi, I am writing CodeCommit and CodePipeline project with CDK.

But I am facing an issue: When the pipeline is created for the first time, it starts automatically and always fails at the build stage with an error. If I restart the pipeline from the Management Console, it runs without any errors.

  • First run -> fail at the build stage
  • Restart pipepine manually -> build success

The error message is

Error calling startBuild: User: arn:aws:sts::111111111111:assumed-role/blabla-XXXXXXX/nnnnnn is not authorized to perform: codebuild:StartBuild on resource: arn:aws:codebuild:ap-northeast-1:111111111111:project/SampleBuildProject because no identity-based policy allows the codebuild:StartBuild action (Service: AWSCodeBuild; Status Code: 400; Error Code: AccessDeniedException; Request ID: xxx; Proxy: null)

I confirmed that the role had 'startBuild' action.

I think it happens because the pipeline deployment is still running when the first build runs.

Is there any solution to avoid this?

Thanks!

yk
已提問 2 年前檢視次數 64 次
沒有答案

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南