bug: cfn.LambdaWrap doesn't fail correctly when custom resources error out

Open
#404 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
aws, go
Domain
cloud

Research direction

Start with the cfn.LambdaWrap entry point and reproduce the issue using the lambda.Start and boom example from the report. Trace the custom resource error path and verify that returning errors.New("BOOM") makes CloudFormation fail resource creation and roll back instead of succeeding.

Written by the indexing model from the issue text.

Description

bug type/cfn

Hi,

When creating lambda functions that respond to CFN Custom Resources, the cfn.LambdaWrap function does not make the resource creation fail as it should when returning an error.

Example:

func main() {
	lambda.Start(cfn.LambdaWrap(boom))
}

func boom(ctx context.Context, event cfn.Event) (physicalResourceID string, data map[string]interface{}, err error) {
	return "", nil, errors.New("BOOM")
}

Expected result:
The custom cloudformation resource creation fails, and rolls back.

Actual result:
Resource creation succeeds.

Dominant language
Go
Stars
3.8k
Forks
578
Avg merge
16h 56m
Merged PRs (30d)
2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from aws/aws-lambda-go

All issues in aws/aws-lambda-go

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.