Skip to content

Commit

Permalink
Add missing part of previous commit; restore InvokeFunction
Browse files Browse the repository at this point in the history
  • Loading branch information
kbalk committed Mar 29, 2021
1 parent 4ce8177 commit 0afc01b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions modules/aws/lambda.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 0afc01b

Please sign in to comment.