Skip to content

CloudFormation wrapper should recover from panics #172

Closed
@aidansteele

Description

@aidansteele

type CustomResourceLambdaFunction func(context.Context, Event) (reason string, err error)

If a CustomResourceLambdaFunction (definition above) panics, it is recovered from in the generic Lambda handling below:

if err := recover(); err != nil {
panicInfo := getPanicInfo(err)
response.Error = &messages.InvokeResponse_Error{
Message: panicInfo.Message,
Type: getErrorType(err),
StackTrace: panicInfo.StackTrace,
ShouldExit: true,
}
}

This will cause stack creations/updates to hang for a long time, as CloudFormation has a very long timeout waiting for a response. It would be a significant improvement if the custom resource wrapper recovered from panics and sent the error to the CloudFormation service.

Is this something you would be open to? I would be happy to submit a PR for review if you are ok with the idea.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions