API Gateway プロキシ統合を備えた Lambda 関数があります。つまり、プロキシ + リソースを入力として受け入れます。
APIGatewayProxyRequestEventタイプを入力として受け入れ、APIGatewayProxyRequestOutputを応答/出力として提供する Java Lambda クラスがあります。
public class DashboardOrchestratorHandler implements RequestHandler<APIGatewayProxyRequestEvent, APIGatewayProxyResponseEvent> {
@Override
public APIGatewayProxyResponseEvent handleRequest(APIGatewayProxyRequestEvent event, Context context) {
APIGatewayProxyResponseEvent response = new APIGatewayProxyResponseEvent();
response.setIsBase64Encoded(false);
response.setStatusCode(200);
HashMap<String, String> headers = new HashMap<String, String>();
headers.put("Content-Type", "text/html");
response.setHeaders(headers);
response.setBody("<!DOCTYPE html><html><head><title>AWS Lambda sample</title></head><body>" +
"<h1>Welcome</h1><p>Page generated by a Lambda function.</p>" +
"</body></html>");
// log execution details
//Util.logEnvironment(event, context, gson);
return response;
}
}
現在、リクエスト パスとリクエスト パラメータに基づいてさまざまなクラスを調整する方法に関するガイドラインを探しています。