From 0afc01b4d45a6376b14f37342ff612b3d404ed3b Mon Sep 17 00:00:00 2001 From: Karri Balk Date: Mon, 29 Mar 2021 11:10:33 -0400 Subject: [PATCH] Add missing part of previous commit; restore InvokeFunction --- modules/aws/lambda.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/aws/lambda.go b/modules/aws/lambda.go index 5b8aede06..370b5b8fc 100644 --- a/modules/aws/lambda.go +++ b/modules/aws/lambda.go @@ -45,10 +45,9 @@ type LambdaOutput struct { // InvokeFunction invokes a lambda function. func InvokeFunction(t testing.TestingT, region, functionName string, payload interface{}) []byte { - input := &LambdaOptions{Payload: &payload} - out, err := InvokeFunctionWithParams(t, region, functionName, input) + out, err := InvokeFunctionE(t, region, functionName, payload) require.NoError(t, err) - return out.Payload + return out } // InvokeFunctionE invokes a lambda function. @@ -93,7 +92,10 @@ func InvokeFunctionWithParams(t testing.TestingT, region, functionName string, i } } - invokeInput := &lambda.InvokeInput{InvocationType: &invocationType} + invokeInput := &lambda.InvokeInput{ + FunctionName: &functionName, + InvocationType: &invocationType, + } if input.Payload != nil { payloadJson, err := json.Marshal(input.Payload)