MCPcopy
hub / github.com/aws/aws-lambda-go / Example

Function Example

cfn/example_test.go:15–25  ·  view source on GitHub ↗

CloudFormation custom resources require a different response handling due to the way stacks execute. The cfn.LambdaWrap helper catches all errors and ensures the correct response is sent to the pre-signed URL that comes with the event. This example safely 'Echo' back anything given into the Echo pa

()

Source from the content-addressed store, hash-verified

13//
14// This example safely 'Echo' back anything given into the Echo parameter within the Custom Resource call.
15func Example() {
16 lambda.Start(cfn.LambdaWrap(func(ctx context.Context, event cfn.Event) (physicalResourceID string, data map[string]interface{}, err error) {
17 v, _ := event.ResourceProperties["Echo"].(string)
18
19 data = map[string]interface{}{
20 "Echo": v,
21 }
22
23 return
24 }))
25}

Callers

nothing calls this directly

Calls 2

StartFunction · 0.92
LambdaWrapFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…