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年前60ビュー
回答なし

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ