Lambda function never succeeds in codepipeline

前端 未结 1 767
忘了有多久
忘了有多久 2021-01-20 03:43

When I run my Lambda function in Codepipeline it ends properly and does what I want as I can see in logs, but it never succeeds in pipeline

相关标签:
1条回答
  • 2021-01-20 04:34

    Maybe I need to send 'putJobSuccessResult' as shown here to CodePipeline?

    Yes, you need to call putJobSuccessResult from your Lambda function.

    But if so then why if it's not a custom action?

    This tells CodePipeline that your Lambda function is finished, and what to do next.

    CodePipeline has a feature where if you pass a 'continuation token' then CodePipeline will re-invoke your function and pass the state in the continuation token to the next invocation. This allows you to have actions running longer than the Lambda invocation timeout. You can pass this info when you call putJobSuccessResult.

    Also, it separates "failing an action" from "failing the function". This allows you to fail the action without failing the lambda function. This is desirable because Lambda has a retry behavior if the function fails.

    And what are custom actions at all?

    With a custom action you need your own code to call PollForJobs, which typically runs on eg. a long running EC2 instance. The Lambda invoke action will call a Lambda function without you having to run your own instance / host.

    0 讨论(0)
提交回复
热议问题