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
()
| 13 | // |
| 14 | // This example safely 'Echo' back anything given into the Echo parameter within the Custom Resource call. |
| 15 | func 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 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…