Skip navigation links

Did this page help you?

Package com.amazonaws.services.lambda.invoke

A higher-level wrapper for AWS Lambda's Invoke operation.

See: Description

Package com.amazonaws.services.lambda.invoke Description

A higher-level wrapper for AWS Lambda's Invoke operation. Allows you to model the input and/or output of your Lambda functions as POJOs and transparently invoke operations using your model types.

Step 1: Model your function's input and/or output as a set of Java POJOs and/or Exceptions.

public class AddRequest { private final int leftHandSide; private final int rightHandSide; public AddRequest(int leftHandSide, int rightHandSide) { this.leftHandSide = leftHandSide; this.rightHandSide = rightHandSide; } public int getLeftHandSide() { return leftHandSide; } public int getRightHandSide() { return rightHandSide; } } public class AddResult { private int sum; public int getSum() { return sum; } public void setSum(int sum) { this.sum = sum; } } public class OverflowException extends LambdaFunctionException { public AddException(String message) { super(message, true, "Overflow"); } }

Input types will be automatically converted to JSON to pass to your Lambda function. The JSON response from your function will be converted to the corresponding result type.

Step 2: Create an interface representing your function(s).

public interface CloudAdder {

Copyright © 2013 Amazon Web Services, Inc. All Rights Reserved.