How to mock CodeBuild with Step Functions Local

0

Hi, Does Step Functions Local support CodeBuild? I have a step in my state machine which starts as follows:

"StartBuild": { "Type": "Task", "Resource": "arn:aws:states:::codebuild:startBuild.sync", "Parameters": { "ProjectName": "${project_name}", etc.

I'm mocking the response from this step to have StatusCode 200 in my MockConfigFile.json. When I run this in Step Functions Local, my Docker container gives this error: The provided ARN 'arn:aws:states:us-east-1:123456789012:codebuild:startBuild.sync' is invalid.

Is there any advice on how to mock this step?

質問済み 1ヶ月前134ビュー
1回答
1

The issue might stem from an incomplete definition in your mock configuration file. If you haven't specified mocked service integration responses in the file, Step Functions Local will attempt to invoke the actual AWS service integration using the ARN provided in your state machine definition.

For instance, if your state machine includes a task with the resource ARN for an AWS CodeBuild project (arn:aws:states:::codebuild:startBuild.sync), and there's no mocked response for this task in the configuration file, Step Functions Local will try to start an actual build using the CodeBuild service. This explains the error message you're encountering: The provided ARN 'arn:aws:states:us-east-1:123456789012:codebuild:startBuild.sync' is invalid. because the mocked service integration responses were not found.

Try to check the Key sources to properly construct your mock configuration file.

Key sources:

profile picture
エキスパート
回答済み 1ヶ月前
  • Thanks for your reply - I've been working from those resources and my MockConfigFile.json already looks like so: "MockedStartBuildSuccess":{ "0": { "Return": { "StatusCode": 200 "BuildId": "testid" } } }, I am still getting the same error. If I swap this CodeBuild stage for a Lambda function the step passes. Do the return arguments need to be different for CodeBuild, or is this CodeBuild resource not supported by Step Functions Local?

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

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

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

関連するコンテンツ