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)