org.apache.maven.plugins
maven-compiler-plugin
diff --git a/aws-lambda-java-runtime-interface-client/src/main/java/com/amazonaws/services/lambda/runtime/api/client/runtimeapi/InvocationRequest.java b/aws-lambda-java-runtime-interface-client/src/main/java/com/amazonaws/services/lambda/runtime/api/client/runtimeapi/InvocationRequest.java
index c8df04af..89f0c677 100644
--- a/aws-lambda-java-runtime-interface-client/src/main/java/com/amazonaws/services/lambda/runtime/api/client/runtimeapi/InvocationRequest.java
+++ b/aws-lambda-java-runtime-interface-client/src/main/java/com/amazonaws/services/lambda/runtime/api/client/runtimeapi/InvocationRequest.java
@@ -41,13 +41,24 @@ public class InvocationRequest {
*/
private String cognitoIdentity;
- /**
- * An input stream of the invocation's request body.
- */
- private InputStream stream;
-
private byte[] content;
+ public InvocationRequest(String id,
+ String xrayTraceId,
+ String invokedFunctionArn,
+ long deadlineTimeInMs,
+ String clientContext,
+ String cognitoIdentity,
+ byte[] content) {
+ this.id = id;
+ this.xrayTraceId = xrayTraceId;
+ this.invokedFunctionArn = invokedFunctionArn;
+ this.deadlineTimeInMs = deadlineTimeInMs;
+ this.clientContext = clientContext;
+ this.cognitoIdentity = cognitoIdentity;
+ this.content = content;
+ }
+
public String getId() {
return id;
}
diff --git a/aws-lambda-java-runtime-interface-client/src/main/java/com/amazonaws/services/lambda/runtime/api/client/runtimeapi/LambdaRuntimeClient.java b/aws-lambda-java-runtime-interface-client/src/main/java/com/amazonaws/services/lambda/runtime/api/client/runtimeapi/LambdaRuntimeClient.java
index 05aa50a1..308dc027 100644
--- a/aws-lambda-java-runtime-interface-client/src/main/java/com/amazonaws/services/lambda/runtime/api/client/runtimeapi/LambdaRuntimeClient.java
+++ b/aws-lambda-java-runtime-interface-client/src/main/java/com/amazonaws/services/lambda/runtime/api/client/runtimeapi/LambdaRuntimeClient.java
@@ -1,5 +1,6 @@
package com.amazonaws.services.lambda.runtime.api.client.runtimeapi;
+import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
@@ -7,15 +8,16 @@
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Objects;
+import java.util.Optional;
import static java.net.HttpURLConnection.HTTP_ACCEPTED;
-import static java.nio.charset.StandardCharsets.UTF_8;
+import static java.net.HttpURLConnection.HTTP_BAD_REQUEST;
/**
* LambdaRuntimeClient is a client of the AWS Lambda Runtime HTTP API for custom runtimes.
- *
+ *
* API definition can be found at https://docs.aws.amazon.com/lambda/latest/dg/runtimes-api.html
- *
+ *
* Copyright (c) 2019 Amazon. All rights reserved.
*/
public class LambdaRuntimeClient {
@@ -23,26 +25,75 @@ public class LambdaRuntimeClient {
private final String hostname;
private final int port;
private final String invocationEndpoint;
+ private final String nextInvocationEndpoint;
private static final String DEFAULT_CONTENT_TYPE = "application/json";
private static final String XRAY_ERROR_CAUSE_HEADER = "Lambda-Runtime-Function-XRay-Error-Cause";
private static final String ERROR_TYPE_HEADER = "Lambda-Runtime-Function-Error-Type";
private static final int XRAY_ERROR_CAUSE_MAX_HEADER_SIZE = 1024 * 1024; // 1MiB
+ public static final String LOG_TAG = "LAMBDA_RUNTIME";
+ public static final String REQUEST_ID_HEADER = "Lambda-Runtime-Aws-Request-Id";
+ public static final String TRACE_ID_HEADER = "Lambda-Runtime-Trace-Id";
+ public static final String CLIENT_CONTEXT_HEADER = "Lambda-Runtime-Client-Context";
+ public static final String COGNITO_IDENTITY_HEADER = "Lambda-Runtime-Cognito-Identity";
+ public static final String DEADLINE_MS_HEADER = "Lambda-Runtime-Deadline-Ms";
+ public static final String FUNCTION_ARN_HEADER = "Lambda-Runtime-Invoked-Function-Arn";
+
+ private static final String RUNTIME_BASE_ENDPOINT = "/2018-06-01/runtime";
+ private static final String BASE_INVOCATION_ENDPOINT = RUNTIME_BASE_ENDPOINT + "/invocation";
+ private static final String NEXT_INVOCATION_ENDPOINT = BASE_INVOCATION_ENDPOINT + "/next";
+ private static final String INIT_ERROR_ENDPOINT = RUNTIME_BASE_ENDPOINT + "/init/error";
+
public LambdaRuntimeClient(String hostnamePort) {
Objects.requireNonNull(hostnamePort, "hostnamePort cannot be null");
String[] parts = hostnamePort.split(":");
this.hostname = parts[0];
this.port = Integer.parseInt(parts[1]);
this.invocationEndpoint = invocationEndpoint();
+ this.nextInvocationEndpoint = nextInvocationEndpoint();
}
- public InvocationRequest waitForNextInvocation() {
- return NativeClient.next();
+ public InvocationRequest waitForNextInvocation() throws IOException {
+ URL url = createUrl(nextInvocationEndpoint);
+ HttpURLConnection conn = (HttpURLConnection) url.openConnection();
+ conn.setRequestMethod("GET");
+ conn.setRequestProperty("Accept", DEFAULT_CONTENT_TYPE);
+
+ conn.setDoInput(true);
+ conn.setInstanceFollowRedirects(true);
+
+
+ InvocationRequest result = new InvocationRequest(
+ conn.getHeaderField(REQUEST_ID_HEADER),
+ conn.getHeaderField(TRACE_ID_HEADER),
+ conn.getHeaderField(FUNCTION_ARN_HEADER),
+ Optional.ofNullable(conn.getHeaderField(DEADLINE_MS_HEADER)).map(Long::valueOf).orElse(-1L),
+ conn.getHeaderField(CLIENT_CONTEXT_HEADER),
+ conn.getHeaderField(COGNITO_IDENTITY_HEADER),
+ readBody(conn)
+ );
+
+ conn.disconnect();
+ return result;
}
- public void postInvocationResponse(String requestId, byte[] response) {
- NativeClient.postInvocationResponse(requestId.getBytes(UTF_8), response);
+ public void postInvocationResponse(String requestId, byte[] response) throws IOException {
+ String responseEndpoint = invocationResponseEndpoint(requestId);
+ URL url = createUrl(responseEndpoint);
+ HttpURLConnection conn = (HttpURLConnection) url.openConnection();
+ conn.setRequestMethod("POST");
+ conn.setDoOutput(true);
+ try (OutputStream outputStream = conn.getOutputStream()) {
+ outputStream.write(response, 0, response.length);
+ }
+
+ int responseCode = conn.getResponseCode();
+ if (responseCode != HTTP_ACCEPTED) {
+ throw new LambdaRuntimeClientException(responseEndpoint, responseCode);
+ }
+
+ conn.disconnect();
}
public void postInvocationError(String requestId, byte[] errorResponse, String errorType) throws IOException {
@@ -65,10 +116,10 @@ private void post(String endpoint, byte[] errorResponse, String errorType, Strin
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", DEFAULT_CONTENT_TYPE);
- if(errorType != null && !errorType.isEmpty()) {
+ if (errorType != null && !errorType.isEmpty()) {
conn.setRequestProperty(ERROR_TYPE_HEADER, errorType);
}
- if(errorCause != null && errorCause.getBytes().length < XRAY_ERROR_CAUSE_MAX_HEADER_SIZE) {
+ if (errorCause != null && errorCause.getBytes().length < XRAY_ERROR_CAUSE_MAX_HEADER_SIZE) {
conn.setRequestProperty(XRAY_ERROR_CAUSE_HEADER, errorCause);
}
conn.setFixedLengthStreamingMode(errorResponse.length);
@@ -78,16 +129,36 @@ private void post(String endpoint, byte[] errorResponse, String errorType, Strin
}
int responseCode = conn.getResponseCode();
+ conn.disconnect();
if (responseCode != HTTP_ACCEPTED) {
throw new LambdaRuntimeClientException(endpoint, responseCode);
}
+ }
+
+ private byte[] readBody(HttpURLConnection connection) throws IOException {
+ InputStream bodyInputStream;
+
+ if (connection.getResponseCode() < HTTP_BAD_REQUEST) {
+ bodyInputStream = connection.getInputStream();
+ } else {
+ bodyInputStream = connection.getErrorStream();
+ }
+
+ try (InputStream inputStream = bodyInputStream;
+ ByteArrayOutputStream buffer = new ByteArrayOutputStream()) {
- // don't need to read the response, close stream to ensure connection re-use
- closeQuietly(conn.getInputStream());
+ int nRead;
+ byte[] data = new byte[8];
+ while ((nRead = inputStream.read(data, 0, data.length)) != -1) {
+ buffer.write(data, 0, nRead);
+ }
+
+ return buffer.toByteArray();
+ }
}
private String invocationEndpoint() {
- return "http://" + hostname + ":" + port + "/2018-06-01/runtime/invocation/";
+ return baseSchemeHostPort() + "/2018-06-01/runtime/invocation/";
}
private String invocationErrorEndpoint(String requestId) {
@@ -95,7 +166,19 @@ private String invocationErrorEndpoint(String requestId) {
}
private String initErrorEndpoint() {
- return "http://" + hostname + ":" + port + "/2018-06-01/runtime/init/error";
+ return baseSchemeHostPort() + INIT_ERROR_ENDPOINT;
+ }
+
+ private String nextInvocationEndpoint() {
+ return baseSchemeHostPort() + NEXT_INVOCATION_ENDPOINT;
+ }
+
+ private String invocationResponseEndpoint(String requestId) {
+ return baseSchemeHostPort() + BASE_INVOCATION_ENDPOINT + "/" + requestId + "/response";
+ }
+
+ private String baseSchemeHostPort() {
+ return "http://" + hostname + ":" + port;
}
private URL createUrl(String endpoint) {
@@ -105,12 +188,4 @@ private URL createUrl(String endpoint) {
throw new RuntimeException(e);
}
}
-
- private void closeQuietly(InputStream inputStream) {
- if (inputStream == null) return;
- try {
- inputStream.close();
- } catch (IOException e) {
- }
- }
}
diff --git a/aws-lambda-java-runtime-interface-client/src/main/java/com/amazonaws/services/lambda/runtime/api/client/runtimeapi/NativeClient.java b/aws-lambda-java-runtime-interface-client/src/main/java/com/amazonaws/services/lambda/runtime/api/client/runtimeapi/NativeClient.java
deleted file mode 100644
index a9592e1a..00000000
--- a/aws-lambda-java-runtime-interface-client/src/main/java/com/amazonaws/services/lambda/runtime/api/client/runtimeapi/NativeClient.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. */
-
-package com.amazonaws.services.lambda.runtime.api.client.runtimeapi;
-
-import java.io.InputStream;
-import java.nio.file.Files;
-import java.nio.file.Paths;
-import java.nio.file.StandardCopyOption;
-
-/**
- * This module defines the native Runtime Interface Client which is responsible for all HTTP
- * interactions with the Runtime API.
- */
-class NativeClient {
- private static final String nativeLibPath = "/tmp/.aws-lambda-runtime-interface-client";
- private static final String architecturePathSuffix = "/" + getArchIdentifier();
- // Implementation based on AWS CRT, but adopted to support 64-bit architectures only (ref. https://github.com/awslabs/aws-crt-java/blob/0e9c3db8b07258b57c2503cfc47c787ccef10670/src/main/java/software/amazon/awssdk/crt/CRT.java#L106-L134)
- private static final String supported_arm_architectures = "^(aarch64.*|arm64.*)$";
- private static final String supported_x86_architectures = "^(x8664|amd64|ia32e|em64t|x64|x86_64)$";
- private static final String[] libsToTry = {
- "aws-lambda-runtime-interface-client.glibc.so",
- "aws-lambda-runtime-interface-client.musl.so",
- };
- private static final Throwable[] exceptions = new Throwable[libsToTry.length];
- static {
- boolean loaded = false;
- for (int i = 0; !loaded && i < libsToTry.length; ++i) {
- try (InputStream lib = NativeClient.class.getResourceAsStream(
- Paths.get(architecturePathSuffix, libsToTry[i]).toString())) {
- Files.copy(lib, Paths.get(nativeLibPath), StandardCopyOption.REPLACE_EXISTING);
- System.load(nativeLibPath);
- loaded = true;
- } catch (UnsatisfiedLinkError e) {
- exceptions[i] = e;
- } catch (Exception e) {
- exceptions[i] = e;
- }
- }
- if (!loaded) {
- for (int i = 0; i < libsToTry.length; ++i) {
- System.err.printf("Failed to load the native runtime interface client library %s. Exception: %s\n", libsToTry[i], exceptions[i].getMessage());
- }
- System.exit(-1);
- }
- String userAgent = String.format(
- "aws-lambda-java/%s-%s" ,
- System.getProperty("java.vendor.version"),
- NativeClient.class.getPackage().getImplementationVersion());
- initializeClient(userAgent.getBytes());
- }
-
- /**
- * @return a string describing the detected architecture the RIC is executing on
- * @throws UnknownPlatformException
- */
- static String getArchIdentifier() {
- String arch = System.getProperty("os.arch");
-
- if (arch.matches(supported_x86_architectures)) {
- return "x86_64";
- } else if (arch.matches(supported_arm_architectures)) {
- return "aarch64";
- }
-
- throw new UnknownPlatformException("architecture not supported: " + arch);
- }
-
- static native void initializeClient(byte[] userAgent);
-
- static native InvocationRequest next();
-
- static native void postInvocationResponse(byte[] requestId, byte[] response);
-}
diff --git a/aws-lambda-java-runtime-interface-client/src/main/java/com/amazonaws/services/lambda/runtime/api/client/runtimeapi/UnknownPlatformException.java b/aws-lambda-java-runtime-interface-client/src/main/java/com/amazonaws/services/lambda/runtime/api/client/runtimeapi/UnknownPlatformException.java
deleted file mode 100644
index f0b6d76e..00000000
--- a/aws-lambda-java-runtime-interface-client/src/main/java/com/amazonaws/services/lambda/runtime/api/client/runtimeapi/UnknownPlatformException.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package com.amazonaws.services.lambda.runtime.api.client.runtimeapi;
-
-/**
- * Copyright (c) 2022 Amazon. All rights reserved.
- */
-public class UnknownPlatformException extends RuntimeException {
-
- public UnknownPlatformException(String message) {
- super(message);
- }
-}
diff --git a/aws-lambda-java-runtime-interface-client/src/main/jni/build-jni-lib.sh b/aws-lambda-java-runtime-interface-client/src/main/jni/build-jni-lib.sh
deleted file mode 100755
index 872f3c7a..00000000
--- a/aws-lambda-java-runtime-interface-client/src/main/jni/build-jni-lib.sh
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/bin/bash
-# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
-
-set -euo pipefail
-
-SRC_DIR=$(dirname "$0")
-DST_DIR=${1}
-MULTI_ARCH=${2}
-CURL_VERSION=7.84.0
-
-# Not using associative arrays to maintain bash 3 compatibility with building on MacOS
-# MacOS ships with bash 3 and associative arrays require bash 4+
-# Declaring a map as an array with the column character as a separator :
-declare -a ARCHITECTURES_TO_PLATFORM=(
- "x86_64:linux/amd64"
- "aarch64:linux/arm64/v8"
-)
-
-declare -a TARGETS=("glibc" "musl")
-
-for pair in "${ARCHITECTURES_TO_PLATFORM[@]}"; do
- arch=${pair%%:*}
- platform=${pair#*:}
-
- if [[ "${MULTI_ARCH}" != "true" ]] && [[ "$(arch)" != "${arch}" ]]; then
- echo "multi arch build not requested and host arch is $(arch), so skipping ${arch}:${platform} ..."
- continue
- fi
-
- mkdir -p "${DST_DIR}/classes/${arch}"
-
- for target in "${TARGETS[@]}"; do
- echo "Compiling the native library for target ${target} on architecture ${arch} using Docker platform ${platform}"
- artifact="${DST_DIR}/classes/${arch}/aws-lambda-runtime-interface-client.${target}.so"
-
- if [[ "${MULTI_ARCH}" == "true" ]]; then
- docker build --platform="${platform}" -f "${SRC_DIR}/Dockerfile.${target}" --build-arg CURL_VERSION=${CURL_VERSION} "${SRC_DIR}" -o - | tar -xOf - src/aws-lambda-runtime-interface-client.so > "${artifact}"
- else
- echo "multi-arch not requestsed, assuming this is a workaround to goofyness when docker buildx is enabled on Linux CI environments."
- echo "enabling docker buildx often updates the docker api version, so assuming that docker cli is also too old to use --output type=tar, so doing alternative build-tag-run approach"
- docker build --platform="${platform}" -t "lambda-java-jni-lib-${target}-${arch}" -f "${SRC_DIR}/Dockerfile.${target}" --build-arg CURL_VERSION=${CURL_VERSION} "${SRC_DIR}"
- docker run --rm --entrypoint /bin/cat "lambda-java-jni-lib-${target}-${arch}" /src/aws-lambda-runtime-interface-client.so > "${artifact}"
- fi
-
- [ -f "${artifact}" ]
- if ! file -b "${artifact}" | tr '-' '_' | tee /dev/stderr | grep -q "${arch}"; then
- echo "${artifact} did not appear to be the correct architecture, check that Docker buildx is enabled"
- exit 1
- fi
- done
-done
diff --git a/aws-lambda-java-runtime-interface-client/src/main/jni/com_amazonaws_services_lambda_runtime_api_client_runtimeapi_NativeClient.cpp b/aws-lambda-java-runtime-interface-client/src/main/jni/com_amazonaws_services_lambda_runtime_api_client_runtimeapi_NativeClient.cpp
deleted file mode 100644
index 87fa9f02..00000000
--- a/aws-lambda-java-runtime-interface-client/src/main/jni/com_amazonaws_services_lambda_runtime_api_client_runtimeapi_NativeClient.cpp
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * Copyright 2019-present Amazon.com, Inc. or its affiliates. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License").
- * You may not use this file except in compliance with the License.
- * A copy of the License is located at
- *
- * http://aws.amazon.com/apache2.0
- *
- * or in the "license" file accompanying this file. This file is distributed
- * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-#include
-#include "com_amazonaws_services_lambda_runtime_api_client_runtimeapi_NativeClient.h"
-#include "aws/lambda-runtime/runtime.h"
-#include "aws/lambda-runtime/version.h"
-
-#define CHECK_EXCEPTION(env, expr) \
- expr; \
- if ((env)->ExceptionOccurred()) \
- goto ERROR;
-
-static aws::lambda_runtime::runtime * CLIENT = nullptr;
-
-static jint JNI_VERSION = JNI_VERSION_1_8;
-
-static jclass invocationRequestClass;
-static jfieldID invokedFunctionArnField;
-static jfieldID deadlineTimeInMsField;
-static jfieldID idField;
-static jfieldID contentField;
-static jfieldID clientContextField;
-static jfieldID cognitoIdentityField;
-static jfieldID xrayTraceIdField;
-
-
-jint JNI_OnLoad(JavaVM* vm, void* reserved) {
-
- JNIEnv* env;
- if (vm->GetEnv(reinterpret_cast(&env), JNI_VERSION) != JNI_OK) {
- return JNI_ERR;
- }
-
- jclass tempInvocationRequestClassRef;
- tempInvocationRequestClassRef = env->FindClass("com/amazonaws/services/lambda/runtime/api/client/runtimeapi/InvocationRequest");
- invocationRequestClass = (jclass) env->NewGlobalRef(tempInvocationRequestClassRef);
- env->DeleteLocalRef(tempInvocationRequestClassRef);
-
- idField = env->GetFieldID(invocationRequestClass , "id", "Ljava/lang/String;");
- invokedFunctionArnField = env->GetFieldID(invocationRequestClass , "invokedFunctionArn", "Ljava/lang/String;");
- deadlineTimeInMsField = env->GetFieldID(invocationRequestClass , "deadlineTimeInMs", "J");
- contentField = env->GetFieldID(invocationRequestClass , "content", "[B");
- xrayTraceIdField = env->GetFieldID(invocationRequestClass , "xrayTraceId", "Ljava/lang/String;");
- clientContextField = env->GetFieldID(invocationRequestClass , "clientContext", "Ljava/lang/String;");
- cognitoIdentityField = env->GetFieldID(invocationRequestClass , "cognitoIdentity", "Ljava/lang/String;");
-
- return JNI_VERSION;
-}
-
-void JNI_OnUnload(JavaVM *vm, void *reserved) {
- JNIEnv* env;
- vm->GetEnv(reinterpret_cast(&env), JNI_VERSION);
-
- env->DeleteGlobalRef(invocationRequestClass);
-}
-
-static void throwLambdaRuntimeClientException(JNIEnv *env, std::string message, aws::http::response_code responseCode){
- jclass lambdaRuntimeExceptionClass = env->FindClass("com/amazonaws/services/lambda/runtime/api/client/runtimeapi/LambdaRuntimeClientException");
- jstring jMessage = env->NewStringUTF(message.c_str());
- jmethodID exInit = env->GetMethodID(lambdaRuntimeExceptionClass, "", "(Ljava/lang/String;I)V");
- jthrowable lambdaRuntimeException = (jthrowable) env->NewObject(lambdaRuntimeExceptionClass, exInit, jMessage, static_cast(responseCode));
- env->Throw(lambdaRuntimeException);
-}
-
-static std::string toNativeString(JNIEnv *env, jbyteArray jArray) {
- int length = env->GetArrayLength(jArray);
- jbyte* bytes = env->GetByteArrayElements(jArray, NULL);
- std::string nativeString = std::string((char *)bytes, length);
- env->ReleaseByteArrayElements(jArray, bytes, JNI_ABORT);
- env->DeleteLocalRef(jArray);
- return nativeString;
-}
-
-JNIEXPORT void JNICALL Java_com_amazonaws_services_lambda_runtime_api_client_runtimeapi_NativeClient_initializeClient(JNIEnv *env, jobject thisObject, jbyteArray userAgent) {
- std::string user_agent = toNativeString(env, userAgent);
- std::string endpoint(getenv("AWS_LAMBDA_RUNTIME_API"));
- CLIENT = new aws::lambda_runtime::runtime(endpoint, user_agent);
-}
-
-JNIEXPORT jobject JNICALL Java_com_amazonaws_services_lambda_runtime_api_client_runtimeapi_NativeClient_next
- (JNIEnv *env, jobject thisObject){
- auto outcome = CLIENT->get_next();
- if (!outcome.is_success()) {
- std::string errorMessage("Failed to get next.");
- throwLambdaRuntimeClientException(env, errorMessage, outcome.get_failure());
- return NULL;
- }
-
- jobject invocationRequest;
- jbyteArray jArray;
- const jbyte* bytes;
- auto response = outcome.get_result();
-
- CHECK_EXCEPTION(env, invocationRequest = env->AllocObject(invocationRequestClass));
- CHECK_EXCEPTION(env, env->SetObjectField(invocationRequest, idField, env->NewStringUTF(response.request_id.c_str())));
- CHECK_EXCEPTION(env, env->SetObjectField(invocationRequest, invokedFunctionArnField, env->NewStringUTF(response.function_arn.c_str())));
- CHECK_EXCEPTION(env, env->SetLongField(invocationRequest, deadlineTimeInMsField, std::chrono::duration_cast(response.deadline.time_since_epoch()).count()));
-
- if(response.xray_trace_id != ""){
- CHECK_EXCEPTION(env, env->SetObjectField(invocationRequest, xrayTraceIdField, env->NewStringUTF(response.xray_trace_id.c_str())));
- }
-
- if(response.client_context != ""){
- CHECK_EXCEPTION(env, env->SetObjectField(invocationRequest, clientContextField, env->NewStringUTF(response.client_context.c_str())));
- }
-
- if(response.cognito_identity != ""){
- CHECK_EXCEPTION(env, env->SetObjectField(invocationRequest, cognitoIdentityField, env->NewStringUTF(response.cognito_identity.c_str())));
- }
-
- bytes = reinterpret_cast(response.payload.c_str());
- CHECK_EXCEPTION(env, jArray = env->NewByteArray(response.payload.length()));
- CHECK_EXCEPTION(env, env->SetByteArrayRegion(jArray, 0, response.payload.length(), bytes));
- CHECK_EXCEPTION(env, env->SetObjectField(invocationRequest, contentField, jArray));
-
- return invocationRequest;
-
- ERROR:
- return NULL;
-}
-
-JNIEXPORT void JNICALL Java_com_amazonaws_services_lambda_runtime_api_client_runtimeapi_NativeClient_postInvocationResponse
- (JNIEnv *env, jobject thisObject, jbyteArray jrequestId, jbyteArray jresponseArray) {
- std::string payload = toNativeString(env, jresponseArray);
- if ((env)->ExceptionOccurred()){
- return;
- }
- std::string requestId = toNativeString(env, jrequestId);
- if ((env)->ExceptionOccurred()){
- return;
- }
-
- auto response = aws::lambda_runtime::invocation_response::success(payload, "application/json");
- auto outcome = CLIENT->post_success(requestId, response);
- if (!outcome.is_success()) {
- std::string errorMessage("Failed to post invocation response.");
- throwLambdaRuntimeClientException(env, errorMessage, outcome.get_failure());
- }
-}
diff --git a/aws-lambda-java-runtime-interface-client/src/main/jni/com_amazonaws_services_lambda_runtime_api_client_runtimeapi_NativeClient.h b/aws-lambda-java-runtime-interface-client/src/main/jni/com_amazonaws_services_lambda_runtime_api_client_runtimeapi_NativeClient.h
deleted file mode 100644
index 28a6f444..00000000
--- a/aws-lambda-java-runtime-interface-client/src/main/jni/com_amazonaws_services_lambda_runtime_api_client_runtimeapi_NativeClient.h
+++ /dev/null
@@ -1,21 +0,0 @@
-#include
-
-#ifndef _Included_com_amazonaws_services_lambda_runtime_api_client_runtimeapi_NativeClient
-#define _Included_com_amazonaws_services_lambda_runtime_api_client_runtimeapi_NativeClient
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-JNIEXPORT void JNICALL Java_com_amazonaws_services_lambda_runtime_api_client_runtimeapi_NativeClient_initializeClient
- (JNIEnv *, jobject, jbyteArray);
-
-JNIEXPORT jobject JNICALL Java_com_amazonaws_services_lambda_runtime_api_client_runtimeapi_NativeClient_next
- (JNIEnv *, jobject);
-
-JNIEXPORT void JNICALL Java_com_amazonaws_services_lambda_runtime_api_client_runtimeapi_NativeClient_postInvocationResponse
- (JNIEnv *, jobject, jbyteArray, jbyteArray);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/.github/PULL_REQUEST_TEMPLATE.md b/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/.github/PULL_REQUEST_TEMPLATE.md
deleted file mode 100644
index ab40d21d..00000000
--- a/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/.github/PULL_REQUEST_TEMPLATE.md
+++ /dev/null
@@ -1,6 +0,0 @@
-*Issue #, if available:*
-
-*Description of changes:*
-
-
-By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
diff --git a/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/.gitignore b/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/.gitignore
deleted file mode 100644
index 647f4493..00000000
--- a/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-build
-tags
-TODO
-compile_commands.json
-.clangd
diff --git a/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/CMakeLists.txt b/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/CMakeLists.txt
deleted file mode 100644
index 1765caf0..00000000
--- a/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/CMakeLists.txt
+++ /dev/null
@@ -1,132 +0,0 @@
-cmake_minimum_required(VERSION 3.9)
-set(CMAKE_CXX_STANDARD 11)
-project(aws-lambda-runtime
- VERSION 0.2.7
- LANGUAGES CXX)
-
-option(ENABLE_LTO "Enables link-time optimization, requires compiler support." ON)
-option(ENABLE_TESTS "Enables building the test project, requires AWS C++ SDK." OFF)
-
-add_library(${PROJECT_NAME}
- "src/logging.cpp"
- "src/runtime.cpp"
- "src/backward.cpp"
- "${CMAKE_CURRENT_BINARY_DIR}/version.cpp"
- )
-
-set_target_properties(${PROJECT_NAME} PROPERTIES
- SOVERSION 0
- VERSION ${PROJECT_VERSION})
-
-target_include_directories(${PROJECT_NAME} PUBLIC
- $
- $)
-
-if (ENABLE_LTO)
- include(CheckIPOSupported)
- check_ipo_supported(RESULT has_lto OUTPUT lto_check_output)
- if(has_lto)
- set_property(TARGET ${PROJECT_NAME} PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
- else()
- message(WARNING "Link-time optimization (LTO) is not supported: ${lto_check_output}")
- endif()
-endif()
-
-find_package(CURL REQUIRED)
-if (CMAKE_VERSION VERSION_LESS 3.12)
- target_link_libraries(${PROJECT_NAME} PRIVATE ${CURL_LIBRARIES})
-else()
- target_link_libraries(${PROJECT_NAME} PRIVATE CURL::libcurl)
-endif()
-
-target_include_directories(${PROJECT_NAME} PRIVATE ${CURL_INCLUDE_DIRS})
-
-target_compile_options(${PROJECT_NAME} PRIVATE
- "-fno-exceptions"
- "-fno-rtti"
- "-fvisibility=hidden"
- "-fvisibility-inlines-hidden"
- "-Wall"
- "-Wextra"
- "-Werror"
- "-Wconversion"
- "-Wno-sign-conversion")
-
-find_library(DW_LIB NAMES dw)
-if (NOT DW_LIB STREQUAL DW_LIB-NOTFOUND)
- message("-- Enhanced stack-traces are enabled via libdw: ${DW_LIB}")
- target_compile_definitions(${PROJECT_NAME} PRIVATE "BACKWARD_HAS_DW=1")
- target_link_libraries(${PROJECT_NAME} PUBLIC "${DW_LIB}")
-else()
- find_library(BFD_LIB NAMES bfd)
- if (NOT BFD_LIB STREQUAL BFD_LIB-NOTFOUND)
- message("-- Enhanced stack-traces are enabled via libbfd: ${BFD_LIB}")
- target_compile_definitions(${PROJECT_NAME} PRIVATE "BACKWARD_HAS_BFD=1")
- target_link_libraries(${PROJECT_NAME} PRIVATE "${BFD_LIB}")
- endif()
-endif()
-
-if (LOG_VERBOSITY)
- target_compile_definitions(${PROJECT_NAME} PRIVATE "AWS_LAMBDA_LOG=${LOG_VERBOSITY}")
-elseif(CMAKE_BUILD_TYPE STREQUAL Debug)
- target_compile_definitions(${PROJECT_NAME} PRIVATE "AWS_LAMBDA_LOG=3")
-else ()
- target_compile_definitions(${PROJECT_NAME} PRIVATE "AWS_LAMBDA_LOG=0")
-endif()
-
-#tests
-if (ENABLE_TESTS)
- enable_testing()
- add_subdirectory(tests)
-endif()
-
-#versioning
-configure_file(
- "${CMAKE_CURRENT_SOURCE_DIR}/src/version.cpp.in"
- "${CMAKE_CURRENT_BINARY_DIR}/version.cpp"
- NEWLINE_STYLE LF)
-
-include (CMakePackageConfigHelpers)
-
-write_basic_package_version_file("${PROJECT_NAME}-config-version.cmake"
- VERSION ${PROJECT_VERSION}
- COMPATIBILITY SameMajorVersion)
-
-# installation
-install(FILES "include/aws/http/response.h"
- DESTINATION "include/aws/http")
-
-install(FILES
- "include/aws/lambda-runtime/runtime.h"
- "include/aws/lambda-runtime/version.h"
- "include/aws/lambda-runtime/outcome.h"
- DESTINATION "include/aws/lambda-runtime")
-
-install(FILES "include/aws/logging/logging.h"
- DESTINATION "include/aws/logging")
-
-include(GNUInstallDirs)
-install(TARGETS ${PROJECT_NAME}
- EXPORT ${PROJECT_NAME}-targets
- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
- )
-
-configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/${PROJECT_NAME}-config.cmake"
- "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake"
- @ONLY)
-
-export(EXPORT "${PROJECT_NAME}-targets" NAMESPACE AWS::)
-
-install(EXPORT "${PROJECT_NAME}-targets"
- DESTINATION "${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}/cmake/"
- NAMESPACE AWS::)
-
-install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake"
- "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake"
- DESTINATION "${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}/cmake/")
-
-install(PROGRAMS "${CMAKE_CURRENT_SOURCE_DIR}/packaging/packager"
- DESTINATION "${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}/cmake/")
-
diff --git a/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/CODE_OF_CONDUCT.md b/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/CODE_OF_CONDUCT.md
deleted file mode 100644
index 3b644668..00000000
--- a/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/CODE_OF_CONDUCT.md
+++ /dev/null
@@ -1,4 +0,0 @@
-## Code of Conduct
-This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
-For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
-opensource-codeofconduct@amazon.com with any additional questions or comments.
diff --git a/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/CONTRIBUTING.md b/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/CONTRIBUTING.md
deleted file mode 100644
index e8c3aa58..00000000
--- a/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/CONTRIBUTING.md
+++ /dev/null
@@ -1,61 +0,0 @@
-# Contributing Guidelines
-
-Thank you for your interest in contributing to our project. Whether it's a bug report, new feature, correction, or additional
-documentation, we greatly value feedback and contributions from our community.
-
-Please read through this document before submitting any issues or pull requests to ensure we have all the necessary
-information to effectively respond to your bug report or contribution.
-
-
-## Reporting Bugs/Feature Requests
-
-We welcome you to use the GitHub issue tracker to report bugs or suggest features.
-
-When filing an issue, please check [existing open](https://github.com/awslabs/aws-lambda-cpp-runtime/issues), or [recently closed](https://github.com/awslabs/aws-lambda-cpp-runtime/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aclosed%20), issues to make sure somebody else hasn't already
-reported the issue. Please try to include as much information as you can. Details like these are incredibly useful:
-
-* A reproducible test case or series of steps
-* The version of our code being used
-* Any modifications you've made relevant to the bug
-* Anything unusual about your environment or deployment
-
-
-## Contributing via Pull Requests
-Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:
-
-1. You are working against the latest source on the *master* branch.
-2. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already.
-3. You open an issue to discuss any significant work - we would hate for your time to be wasted.
-
-To send us a pull request, please:
-
-1. Fork the repository.
-2. Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change.
-3. Ensure local tests pass.
-4. Commit to your fork using clear commit messages.
-5. Send us a pull request, answering any default questions in the pull request interface.
-6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.
-
-GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
-[creating a pull request](https://help.github.com/articles/creating-a-pull-request/).
-
-
-## Finding contributions to work on
-Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels (enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any ['help wanted'](https://github.com/awslabs/aws-lambda-cpp-runtime/labels/help%20wanted) issues is a great place to start.
-
-
-## Code of Conduct
-This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
-For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
-opensource-codeofconduct@amazon.com with any additional questions or comments.
-
-
-## Security issue notifications
-If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue.
-
-
-## Licensing
-
-See the [LICENSE](https://github.com/awslabs/aws-lambda-cpp-runtime/blob/master/LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution.
-
-We may ask you to sign a [Contributor License Agreement (CLA)](http://en.wikipedia.org/wiki/Contributor_License_Agreement) for larger changes.
diff --git a/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/README.md b/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/README.md
deleted file mode 100644
index 0812476a..00000000
--- a/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/README.md
+++ /dev/null
@@ -1,220 +0,0 @@
-[![GitHub](https://img.shields.io/github/license/awslabs/aws-lambda-cpp.svg)](https://github.com/awslabs/aws-lambda-cpp/blob/master/LICENSE)
-![CodeBuild](https://codebuild.us-west-2.amazonaws.com/badges?uuid=eyJlbmNyeXB0ZWREYXRhIjoiQkN1b0srbWtnUjNibFVyL2psNmdaM0l4RnVQNzVBeG84QnQvUjRmOEJVdXdHUXMxZ25iWnFZQUtGTkUxVGJhcGZaVEhXY2JOSTFHTlkvaGF2RDRIZlpVPSIsIml2UGFyYW1ldGVyU3BlYyI6IjRiS3hlRjFxVFZHSWViQmQiLCJtYXRlcmlhbFNldFNlcmlhbCI6MX0%3D&branch=master)
-[![Language grade: C/C++](https://img.shields.io/lgtm/grade/cpp/g/awslabs/aws-lambda-cpp.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/awslabs/aws-lambda-cpp/context:cpp)
-## AWS Lambda C++ Runtime
-
-C++ implementation of the lambda runtime API
-
-## Design Goals
-1. Negligible cold-start overhead (single digit millisecond).
-2. Freedom of choice in compilers, build platforms and C standard library versions.
-
-## Building and Installing the Runtime
-Since AWS Lambda runs on GNU/Linux, you should build this runtime library and your logic on GNU/Linux as well.
-
-### Prerequisites
-Make sure you have the following packages installed first:
-1. CMake (version 3.9 or later)
-1. git
-1. Make or Ninja
-1. zip
-1. libcurl-devel (on Debian-basded distros it's libcurl4-openssl-dev)
-
-In a terminal, run the following commands:
-```bash
-$ git clone https://github.com/awslabs/aws-lambda-cpp.git
-$ cd aws-lambda-cpp
-$ mkdir build
-$ cd build
-$ cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/lambda-install
-$ make && make install
-```
-
-To consume this library in a project that is also using CMake, you would do:
-
-```cmake
-cmake_minimum_required(VERSION 3.9)
-set(CMAKE_CXX_STANDARD 11)
-project(demo LANGUAGES CXX)
-find_package(aws-lambda-runtime)
-add_executable(${PROJECT_NAME} "main.cpp")
-target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-lambda-runtime)
-target_compile_features(${PROJECT_NAME} PRIVATE "cxx_std_11")
-target_compile_options(${PROJECT_NAME} PRIVATE "-Wall" "-Wextra")
-
-# this line creates a target that packages your binary and zips it up
-aws_lambda_package_target(${PROJECT_NAME})
-```
-
-And here is how a sample `main.cpp` would look like:
-```cpp
-#include
-
-using namespace aws::lambda_runtime;
-
-static invocation_response my_handler(invocation_request const& req)
-{
- if (req.payload.length() > 42) {
- return invocation_response::failure("error message here"/*error_message*/,
- "error type here" /*error_type*/);
- }
-
- return invocation_response::success("json payload here" /*payload*/,
- "application/json" /*MIME type*/);
-}
-
-int main()
-{
- run_handler(my_handler);
- return 0;
-}
-```
-
-And finally, here's how you would package it all. Run the following commands from your application's root directory:
-
-```bash
-$ mkdir build
-$ cd build
-$ cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=~/lambda-install
-$ make
-$ make aws-lambda-package-demo
-```
-The last command above `make aws-lambda-package-demo` will create a zip file called `demo.zip` in the current directory.
-
-Now, create an IAM role and the Lambda function via the AWS CLI.
-
-First create the following trust policy JSON file
-
-```
-$ cat trust-policy.json
-{
- "Version": "2012-10-17",
- "Statement": [
- {
- "Effect": "Allow",
- "Principal": {
- "Service": ["lambda.amazonaws.com"]
- },
- "Action": "sts:AssumeRole"
- }
- ]
-}
-
-```
-Then create the IAM role:
-
-```bash
-$ aws iam create-role --role-name lambda-demo --assume-role-policy-document file://trust-policy.json
-```
-
-Note down the role Arn returned to you after running that command. We'll need it in the next steps:
-
-Attach the following policy to allow Lambda to write logs in CloudWatch:
-```bash
-$ aws iam attach-role-policy --role-name lambda-demo --policy-arn arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
-```
-
-Make sure you attach the appropriate policies and/or permissions for any other AWS services that you plan on using.
-
-And finally, create the Lambda function:
-
-```
-$ aws lambda create-function --function-name demo \
---role \
---runtime provided --timeout 15 --memory-size 128 \
---handler demo --zip-file fileb://demo.zip
-```
-
-And to invoke the function:
-```bash
-$ aws lambda invoke --function-name demo --payload '{"answer":42}' output.txt
-```
-
-## Using the C++ SDK for AWS with this runtime
-This library is completely independent from the AWS C++ SDK. You should treat the AWS C++ SDK as just another dependency in your application.
-See [the examples section](https://github.com/awslabs/aws-lambda-cpp/tree/master/examples/) for a demo utilizing the AWS C++ SDK with this Lambda runtime.
-
-## Supported Compilers
-Any *fully* compliant C++11 compiler targeting GNU/Linux x86-64 should work. Please avoid compiler versions that provide half-baked C++11 support.
-
-- Use GCC v5.x or above
-- Use Clang v3.3 or above
-
-## Packaging, ABI, GNU C Library, Oh My!
-Lambda runs your code on some version of Amazon Linux. It would be a less than ideal customer experience if you are forced to build your application on that platform and that platform only.
-
-However, the freedom to build on any linux distro brings a challenge. The GNU C Library ABI. There is no guarantee the platform used to build the Lambda function has the same GLIBC version as the one used by AWS Lambda. In fact, you might not even be using GNU's implementation. For example you could build a C++ Lambda function using musl libc.
-
-To ensure that your application will run correctly on Lambda, we must package the entire C runtime library with your function.
-If you choose to build on the same [Amazon Linux version used by lambda](https://docs.aws.amazon.com/lambda/latest/dg/current-supported-versions.html), you can avoid packaging the C runtime in your zip file.
-This can be done by passing the `NO_LIBC` flag in CMake as follows:
-
-```cmake
-aws_lambda_package_target(${PROJECT_NAME} NO_LIBC)
-```
-### Common Pitfalls with Packaging
-
-* Any library dependency your Lambda function has that is dynamically loaded via `dlopen` will NOT be automatically packaged. You **must** add those dependencies manually to the zip file.
-This applies to any configuration or resource files that your code depends on.
-
-* If you are making HTTP calls over TLS (https), keep in mind that the CA bundle location is different between distros.
-For example, if you are using the AWS C++ SDK, it's best to set the following configuration options:
-
-```cpp
-Aws::Client::ClientConfiguration config;
-config.caFile = "/etc/pki/tls/certs/ca-bundle.crt";
-```
-If you are not using the AWS C++ SDK, but happen to be using libcurl directly, you can set the CA bundle location by doing:
-```c
-curl_easy_setopt(curl_handle, CURLOPT_CAINFO, "/etc/pki/tls/certs/ca-bundle.crt");
-```
-
-## FAQ & Troubleshooting
-1. **Why is the zip file so large? what are all those files?**
- Typically, the zip file is large because we have to package the entire C standard library.
- You can reduce the size by doing some or all of the following:
- - Ensure you're building in release mode `-DCMAKE_BUILD_TYPE=Release`
- - If possible, build your function using musl libc, it's tiny. The easiest way to do this, assuming your code is portable, is to build on Alpine linux, which uses musl libc by default.
-1. **How to upload a zip file that's bigger than 50MB via the CLI?**
- Upload your zip file to S3 first:
- ```bash
- $ aws s3 cp demo.zip s3://mys3bucket/demo.zip
- ```
- NOTE: you must use the same region for your S3 bucket as the lambda.
-
- Then you can create the Lambda function this way:
-
- ```bash
- $ aws lambda create-function --function-name demo \
- --role \
- --runtime provided --timeout 15 --memory-size 128 \
- --handler demo
- --code "S3Bucket=mys3bucket,S3Key=demo.zip"
- ```
-1. **My code is crashing, how can I debug it?**
-
- - Starting with [v0.2.0](https://github.com/awslabs/aws-lambda-cpp/releases/tag/v0.2.0) you should see a stack-trace of the crash site in the logs (which are typically stored in CloudWatch).
- - To get a more detailed stack-trace with source-code information such as line numbers, file names, etc. you need to install one of the following packages:
- - On Debian-based systems - `sudo apt install libdw-dev` or `sudo apt install binutils-dev`
- - On RHEL based systems - `sudo yum install elfutils-devel` or `sudo yum install binutils-devel`
- If you have either of those packages installed, CMake will detect them and automatically link to them. No other
- steps are required.
- - Turn up the logging verbosity to the maximum.
- - Build the runtime in Debug mode. `-DCMAKE_BUILD_TYPE=Debug`. Verbose logs are enabled by default in Debug builds.
- - To enable verbose logs in Release builds, build the runtime with the following CMake flag `-DLOG_VERBOSITY=3`
- - If you are using the AWS C++ SDK, see [this FAQ](https://github.com/aws/aws-sdk-cpp/wiki#how-do-i-turn-on-logging) on how to adjust its logging verbosity
- - Run your code locally on an Amazon Linux AMI or Docker container to reproduce the problem
- - If you go the AMI route, [use the official one](https://docs.aws.amazon.com/lambda/latest/dg/current-supported-versions.html) recommended by AWS Lambda
- - If you go the Docker route, use the following command to launch a container running AL2017.03
- `$ docker run -v /tmp:/tmp -it --security-opt seccomp=unconfined amazonlinux:2017.03`
- The `security-opt` argument is necessary to run `gdb`, `strace`, etc.
-1. **CURL problem with the SSL CA cert**
- - Make sure you are using a `libcurl` version built with OpenSSL, or one of its flavors (BoringSSL, LibreSSL)
- - Make sure you tell `libcurl` where to find the CA bundle file.
- - You can try hitting the non-TLS version of the endpoint if available. (Not Recommended).
-1. **No known conversion between `std::string` and `Aws::String`**
- - Either turn off custom memory management in the AWS C++ SDK or build it as a static library (`-DBUILD_SHARED_LIBS=OFF`)
-
-## License
-
-This library is licensed under the Apache 2.0 License.
diff --git a/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/ci/codebuild/amazonlinux-2017.03.yml b/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/ci/codebuild/amazonlinux-2017.03.yml
deleted file mode 100644
index eab1bafb..00000000
--- a/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/ci/codebuild/amazonlinux-2017.03.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-version: 0.1
-# This uses the docker image specified in ci/docker/amazon-linux-2017.03
-phases:
- pre_build:
- commands:
- - alias cmake=cmake3
- - pip install awscli
- - ci/codebuild/build-cpp-sdk.sh
- build:
- commands:
- - echo Build started on `date`
- - ci/codebuild/build.sh -DENABLE_TESTS=ON -DTEST_RESOURCE_PREFIX=amzn201703
- - ci/codebuild/run-tests.sh aws-lambda-package-lambda-test-fun amzn201703
- - ci/codebuild/run-tests.sh aws-lambda-package-lambda-test-fun-no-glibc amzn201703
- post_build:
- commands:
- - echo Build completed on `date`
-
diff --git a/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/ci/codebuild/build-cpp-sdk.sh b/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/ci/codebuild/build-cpp-sdk.sh
deleted file mode 100755
index 93ae7ebe..00000000
--- a/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/ci/codebuild/build-cpp-sdk.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/bash
-
-set -euo pipefail
-
-# build the AWS C++ SDK
-cd /aws-sdk-cpp
-git pull
-mkdir build
-cd build
-cmake .. -GNinja -DBUILD_ONLY="lambda" \
- -DCMAKE_BUILD_TYPE=Release \
- -DENABLE_UNITY_BUILD=ON \
- -DBUILD_SHARED_LIBS=ON \
- -DENABLE_TESTING=OFF \
- -DCMAKE_INSTALL_PREFIX=/install $@
-ninja
-ninja install
diff --git a/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/ci/codebuild/build.sh b/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/ci/codebuild/build.sh
deleted file mode 100755
index 53a9544e..00000000
--- a/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/ci/codebuild/build.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/bash
-
-set -euo pipefail
-
-# build the lambda-runtime
-cd $CODEBUILD_SRC_DIR
-mkdir build
-cd build
-cmake .. -GNinja -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/install $@
-ninja
-ninja install
diff --git a/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/ci/codebuild/format-check.sh b/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/ci/codebuild/format-check.sh
deleted file mode 100755
index 3afb8023..00000000
--- a/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/ci/codebuild/format-check.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/bash
-
-set -euo pipefail
-
-CLANG_FORMAT=clang-format
-
-if NOT type $CLANG_FORMAT > /dev/null 2>&1; then
- echo "No appropriate clang-format found."
- exit 1
-fi
-
-FAIL=0
-SOURCE_FILES=$(find src include tests -type f -name "*.h" -o -name "*.cpp")
-for i in $SOURCE_FILES
-do
- if [ $($CLANG_FORMAT -output-replacements-xml $i | grep -c " "API Gateway" -> "Create an API". Please view the settings below.
- * API Type: HTTP API
- * Security: Open
- * API name: Hello-World-API (or desired name)
- * Deployment stage: default
-1. Once you have added the API gateway, locate the newly created endpoint. View how to test the endpoint below.
-
-## Test the endpoint
-Feel free to test the endpoint any way you desire. Below is a way to test using cURL:
-
-```
-curl -v -X POST \
- '?name=Bradley&city=Chicago' \
- -H 'content-type: application/json' \
- -H 'day: Sunday' \
- -d '{ "time": "evening" }'
-```
-
-With the expected response being:
-```
-{
- "message": "Good evening, Bradley of Chicago. Happy Sunday!"
-}
-```
diff --git a/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/examples/api-gateway/main.cpp b/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/examples/api-gateway/main.cpp
deleted file mode 100644
index 90f10355..00000000
--- a/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/examples/api-gateway/main.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-#include
-#include
-#include
-
-using namespace aws::lambda_runtime;
-
-invocation_response my_handler(invocation_request const& request)
-{
-
- using namespace Aws::Utils::Json;
-
- JsonValue json(request.payload);
- if (!json.WasParseSuccessful()) {
- return invocation_response::failure("Failed to parse input JSON", "InvalidJSON");
- }
-
- auto v = json.View();
- Aws::SimpleStringStream ss;
- ss << "Good ";
-
- if (v.ValueExists("body") && v.GetObject("body").IsString()) {
- auto body = v.GetString("body");
- JsonValue body_json(body);
-
- if (body_json.WasParseSuccessful()) {
- auto body_v = body_json.View();
- ss << (body_v.ValueExists("time") && body_v.GetObject("time").IsString() ? body_v.GetString("time") : "");
- }
- }
- ss << ", ";
-
- if (v.ValueExists("queryStringParameters")) {
- auto query_params = v.GetObject("queryStringParameters");
- ss << (query_params.ValueExists("name") && query_params.GetObject("name").IsString()
- ? query_params.GetString("name")
- : "")
- << " of ";
- ss << (query_params.ValueExists("city") && query_params.GetObject("city").IsString()
- ? query_params.GetString("city")
- : "")
- << ". ";
- }
-
- if (v.ValueExists("headers")) {
- auto headers = v.GetObject("headers");
- ss << "Happy "
- << (headers.ValueExists("day") && headers.GetObject("day").IsString() ? headers.GetString("day") : "")
- << "!";
- }
-
- JsonValue resp;
- resp.WithString("message", ss.str());
-
- return invocation_response::success(resp.View().WriteCompact(), "application/json");
-}
-
-int main()
-{
- run_handler(my_handler);
- return 0;
-}
diff --git a/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/examples/dynamodb/CMakeLists.txt b/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/examples/dynamodb/CMakeLists.txt
deleted file mode 100644
index 8447e019..00000000
--- a/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/examples/dynamodb/CMakeLists.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-cmake_minimum_required(VERSION 3.5)
-set(CMAKE_CXX_STANDARD 11)
-project(ddb-demo LANGUAGES CXX)
-
-find_package(aws-lambda-runtime)
-find_package(AWSSDK COMPONENTS dynamodb)
-
-add_executable(${PROJECT_NAME} "main.cpp")
-
-target_link_libraries(${PROJECT_NAME} PUBLIC AWS::aws-lambda-runtime ${AWSSDK_LINK_LIBRARIES})
-
-target_compile_options(${PROJECT_NAME} PRIVATE
- "-fno-exceptions"
- "-fno-rtti"
- "-Wall"
- "-Wextra"
- "-Werror"
- "-Wconversion"
- "-Wno-sign-conversion")
-
-target_compile_features(${PROJECT_NAME} PRIVATE "cxx_std_11")
-
-aws_lambda_package_target(${PROJECT_NAME})
-
diff --git a/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/examples/dynamodb/README.md b/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/examples/dynamodb/README.md
deleted file mode 100644
index db84fd87..00000000
--- a/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/examples/dynamodb/README.md
+++ /dev/null
@@ -1,52 +0,0 @@
-# Example using the AWS C++ SDK with Lambda & DynamoDB
-
-We'll build a Lambda function that can be used as an API Gateway proxy to fetch records from a DynamoDB table.
-To also show case how this can be done on a Linux distro other than Amazon Linux, you can use the Dockerfile in this directory to create an Alpine Linux environment in which you can run the following instructions.
-
-That being said, the instructions below should work on any Linux distribution.
-
-## Build the AWS C++ SDK
-Start by building the SDK from source.
-```bash
-$ mkdir ~/install
-$ git clone https://github.com/aws/aws-sdk-cpp.git
-$ cd aws-sdk-cpp
-$ mkdir build
-$ cd build
-$ cmake .. -DBUILD_ONLY="dynamodb" \
- -DCMAKE_BUILD_TYPE=Release \
- -DBUILD_SHARED_LIBS=OFF \
- -DENABLE_UNITY_BUILD=ON \
- -DCUSTOM_MEMORY_MANAGEMENT=OFF \
- -DCMAKE_INSTALL_PREFIX=~/install \
- -DENABLE_UNITY_BUILD=ON
-
-$ make -j 4
-$ make install
-```
-
-## Build the Runtime
-Now let's build the C++ Lambda runtime, so in a separate directory clone this repository and follow these steps:
-
-```bash
-$ git clone https://github.com/awslabs/aws-lambda-cpp-runtime.git
-$ cd aws-lambda-cpp-runtime
-$ mkdir build
-$ cd build
-$ cmake .. -DCMAKE_BUILD_TYPE=Release \
- -DBUILD_SHARED_LIBS=OFF \
- -DCMAKE_INSTALL_PREFIX=~/install \
-$ make
-$ make install
-```
-
-## Build the application
-The last step is to build the Lambda function in `main.cpp` and run the packaging command as follows:
-
-```bash
-$ cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=~/install
-$ make
-$ make aws-lambda-package-ddb-demo
-```
-
-You should now have a zip file called `ddb-demo.zip`. Follow the instructions in the main README to upload it and invoke the lambda.
diff --git a/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/examples/dynamodb/main.cpp b/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/examples/dynamodb/main.cpp
deleted file mode 100644
index a8b86621..00000000
--- a/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/examples/dynamodb/main.cpp
+++ /dev/null
@@ -1,229 +0,0 @@
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-// API Gateway Input format
-// {
-// "resource": "Resource path",
-// "path": "Path parameter",
-// "httpMethod": "Incoming request's method name"
-// "headers": {String containing incoming request headers}
-// "multiValueHeaders": {List of strings containing incoming request headers}
-// "queryStringParameters": {query string parameters }
-// "multiValueQueryStringParameters": {List of query string parameters}
-// "pathParameters": {path parameters}
-// "stageVariables": {Applicable stage variables}
-// "requestContext": {Request context, including authorizer-returned key-value pairs}
-// "body": "A JSON string of the request payload."
-// "isBase64Encoded": "A boolean flag to indicate if the applicable request payload is Base64-encode"
-// }
-
-static char const TAG[] = "lambda";
-
-struct criteria {
- criteria(Aws::Utils::Json::JsonView data) : error_msg(nullptr)
- {
- using namespace Aws::Utils;
- auto path_params = data.GetObject("pathParameters");
- if (!path_params.ValueExists("productId")) {
- error_msg = "Missing URL parameter {productId}.";
- return;
- }
-
- product_id = path_params.GetString("productId");
- auto qs = data.GetObject("queryStringParameters");
-
- if (!qs.ValueExists("startDate")) {
- error_msg = "Missing query string parameter 'startDate'.";
- return;
- }
- start_date = DateTime(qs.GetString("startDate"), DateFormat::ISO_8601);
- if (!start_date.WasParseSuccessful()) {
- error_msg = "Invalid input format. startDate must be in ISO 8601 format.";
- return;
- }
-
- if (!qs.ValueExists("endDate")) {
- error_msg = "Missing query string parameter 'endDate'.";
- return;
- }
- end_date = DateTime(qs.GetString("endDate"), DateFormat::ISO_8601);
- if (!end_date.WasParseSuccessful()) {
- error_msg = "Invalid input format. endDate must be in ISO 8601 format.";
- return;
- }
- }
-
- std::string product_id;
- Aws::Utils::DateTime start_date;
- Aws::Utils::DateTime end_date;
- char const* error_msg;
-};
-
-Aws::Utils::Json::JsonValue query(criteria const cr, Aws::DynamoDB::DynamoDBClient const& client)
-{
- using namespace Aws::DynamoDB;
- using namespace Aws::DynamoDB::Model;
- using namespace Aws::Utils::Json;
-
- AWS_LOGSTREAM_DEBUG(
- TAG,
- "criteria is: product_id: " << cr.product_id << " start_date epoch: " << cr.start_date.Millis()
- << " end_date epoch: " << cr.end_date.Millis());
-
- QueryRequest query;
-
- auto const& table_name = Aws::Environment::GetEnv("TABLE_NAME");
- query.SetTableName(table_name);
- query.SetKeyConditionExpression("#H = :h AND #R BETWEEN :s AND :e");
- query.AddExpressionAttributeNames("#H", "product_id");
- query.AddExpressionAttributeNames("#R", "date_time");
-
- query.AddExpressionAttributeValues(":h", AttributeValue(cr.product_id));
- AttributeValue date;
- date.SetN(std::to_string(cr.start_date.Millis() / 1000));
- query.AddExpressionAttributeValues(":s", date);
-
- date.SetN(std::to_string(cr.end_date.Millis() / 1000));
- query.AddExpressionAttributeValues(":e", date);
-
- auto outcome = client.Query(query);
- if (outcome.IsSuccess()) {
- auto const& maps = outcome.GetResult().GetItems(); // returns vector of map
- if (maps.empty()) {
- AWS_LOGSTREAM_DEBUG(TAG, "No data returned from query");
- return {};
- }
-
- // Schema
- // string_attr :product_id, hash_key: true
- // epoch_time_attr :date_time, range_key: true
- // string_attr :product_title
- // string_attr :marketplace
- // string_attr :product_category
- // date_attr :review_date
- // integer_attr :star_rating
- // float_attr :postive
- // float_attr :mixed
- // float_attr :neutral
- // float_attr :negative
-
- JsonValue output;
- output.WithString("product", maps[0].find("product_title")->second.GetS());
- output.WithString("category", maps[0].find("product_category")->second.GetS());
- Aws::Utils::Array sentiments(maps.size());
- for (size_t i = 0; i < maps.size(); i++) {
- JsonValue review;
- auto&& m = maps[i];
-
- auto it = m.find("review_date");
- if (it != m.end()) {
- review.WithString("date", it->second.GetS());
- }
-
- it = m.find("positive");
- if (it != m.end()) {
- review.WithString("positive", it->second.GetN());
- }
-
- it = m.find("negative");
- if (it != m.end()) {
- review.WithString("negative", it->second.GetN());
- }
-
- it = m.find("mixed");
- if (it != m.end()) {
- review.WithString("mixed", it->second.GetN());
- }
-
- it = m.find("neutral");
- if (it != m.end()) {
- review.WithString("neutral", it->second.GetN());
- }
-
- sentiments[i] = std::move(review);
- }
- output.WithArray("sentiment", sentiments);
- return output;
- }
-
- AWS_LOGSTREAM_ERROR(TAG, "database query failed: " << outcome.GetError());
- return {};
-}
-
-
-aws::lambda_runtime::invocation_response my_handler(
- aws::lambda_runtime::invocation_request const& req,
- Aws::DynamoDB::DynamoDBClient const& client)
-{
- using namespace Aws::Utils::Json;
- AWS_LOGSTREAM_DEBUG(TAG, "received payload: " << req.payload);
- JsonValue eventJson(req.payload);
- assert(eventJson.WasParseSuccessful());
- const criteria cr(eventJson);
- if (cr.error_msg) {
- JsonValue response;
- response.WithString("body", cr.error_msg).WithInteger("statusCode", 400);
- auto const apig_response = response.View().WriteCompact();
- AWS_LOGSTREAM_ERROR(TAG, "Validation failed. " << apig_response);
- return aws::lambda_runtime::invocation_response::success(apig_response, "application/json");
- }
-
- auto result = query(cr, client);
- auto const query_response = result.View().WriteCompact();
- AWS_LOGSTREAM_DEBUG(TAG, "query response: " << query_response);
-
- JsonValue response;
- if (result.View().ValueExists("product")) {
- response.WithString("body", query_response).WithInteger("statusCode", 200);
- }
- else {
- response.WithString("body", "No data found for this product.").WithInteger("statusCode", 400);
- }
-
- auto const apig_response = response.View().WriteCompact();
- AWS_LOGSTREAM_DEBUG(TAG, "api gateway response: " << apig_response);
-
- return aws::lambda_runtime::invocation_response::success(apig_response, "application/json");
-}
-
-std::function()> GetConsoleLoggerFactory()
-{
- return [] {
- return Aws::MakeShared(
- "console_logger", Aws::Utils::Logging::LogLevel::Trace);
- };
-}
-
-int main()
-{
- using namespace Aws;
- SDKOptions options;
- options.loggingOptions.logLevel = Aws::Utils::Logging::LogLevel::Trace;
- options.loggingOptions.logger_create_fn = GetConsoleLoggerFactory();
- InitAPI(options);
- {
- Aws::Client::ClientConfiguration config;
- config.region = Aws::Environment::GetEnv("AWS_REGION");
- config.caFile = "/etc/pki/tls/certs/ca-bundle.crt";
- config.disableExpectHeader = true;
-
- auto credentialsProvider = Aws::MakeShared(TAG);
- Aws::DynamoDB::DynamoDBClient client(credentialsProvider, config);
- auto handler_fn = [&client](aws::lambda_runtime::invocation_request const& req) {
- return my_handler(req, client);
- };
- aws::lambda_runtime::run_handler(handler_fn);
- }
- ShutdownAPI(options);
- return 0;
-}
diff --git a/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/examples/s3/CMakeLists.txt b/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/examples/s3/CMakeLists.txt
deleted file mode 100644
index b398a4e2..00000000
--- a/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/examples/s3/CMakeLists.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-cmake_minimum_required(VERSION 3.5)
-set(CMAKE_CXX_STANDARD 11)
-project(encoder LANGUAGES CXX)
-
-find_package(aws-lambda-runtime)
-find_package(AWSSDK COMPONENTS s3)
-
-add_executable(${PROJECT_NAME} "main.cpp")
-
-target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-lambda-runtime ${AWSSDK_LINK_LIBRARIES})
-
-target_compile_options(${PROJECT_NAME} PRIVATE
- "-Wall"
- "-Wextra"
- "-Wconversion"
- "-Wshadow"
- "-Wno-sign-conversion")
-
-target_compile_features(${PROJECT_NAME} PRIVATE "cxx_std_11")
-
-aws_lambda_package_target(${PROJECT_NAME})
-
diff --git a/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/examples/s3/README.md b/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/examples/s3/README.md
deleted file mode 100644
index 8bc3255a..00000000
--- a/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/examples/s3/README.md
+++ /dev/null
@@ -1,51 +0,0 @@
-# Example using the AWS C++ SDK with Lambda
-
-We'll build a lambda that downloads an image file from S3 and sends it back in the response as Base64 encoded that can be displayed in a web page for example.
-To also show case how this can be done on a Linux distro other than Amazon Linux, you can use the Dockerfile in this directory to create an Alpine Linux environment in which you can run the following instructions.
-
-That being said, the instructions below should work on any Linux distribution.
-
-## Build the AWS C++ SDK
-Start by building the SDK from source.
-```bash
-$ mkdir ~/install
-$ git clone https://github.com/aws/aws-sdk-cpp.git
-$ cd aws-sdk-cpp
-$ mkdir build
-$ cd build
-$ cmake .. -DBUILD_ONLY="s3" \
- -DCMAKE_BUILD_TYPE=Release \
- -DBUILD_SHARED_LIBS=OFF \
- -DCUSTOM_MEMORY_MANAGEMENT=OFF \
- -DCMAKE_INSTALL_PREFIX=~/install \
- -DENABLE_UNITY_BUILD=ON
-
-$ make
-$ make install
-```
-
-## Build the Runtime
-Now let's build the C++ Lambda runtime, so in a separate directory clone this repository and follow these steps:
-
-```bash
-$ git clone https://github.com/awslabs/aws-lambda-cpp-runtime.git
-$ cd aws-lambda-cpp-runtime
-$ mkdir build
-$ cd build
-$ cmake .. -DCMAKE_BUILD_TYPE=Release \
- -DBUILD_SHARED_LIBS=OFF \
- -DCMAKE_INSTALL_PREFIX=~/install \
-$ make
-$ make install
-```
-
-## Build the application
-The last step is to build the Lambda function in `main.cpp` and run the packaging command as follows:
-
-```bash
-$ cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=~/install
-$ make
-$ make aws-lambda-package-encoder
-```
-
-You should now have a zip file called `encoder.zip`. Follow the instructions in the main README to upload it and invoke the lambda.
diff --git a/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/examples/s3/main.cpp b/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/examples/s3/main.cpp
deleted file mode 100644
index 45b935bf..00000000
--- a/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/examples/s3/main.cpp
+++ /dev/null
@@ -1,128 +0,0 @@
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-using namespace aws::lambda_runtime;
-
-std::string download_and_encode_file(
- Aws::S3::S3Client const& client,
- Aws::String const& bucket,
- Aws::String const& key,
- Aws::String& encoded_output);
-
-std::string encode(Aws::String const& filename, Aws::String& output);
-char const TAG[] = "LAMBDA_ALLOC";
-
-static invocation_response my_handler(invocation_request const& req, Aws::S3::S3Client const& client)
-{
- using namespace Aws::Utils::Json;
- JsonValue json(req.payload);
- if (!json.WasParseSuccessful()) {
- return invocation_response::failure("Failed to parse input JSON", "InvalidJSON");
- }
-
- auto v = json.View();
-
- if (!v.ValueExists("s3bucket") || !v.ValueExists("s3key") || !v.GetObject("s3bucket").IsString() ||
- !v.GetObject("s3key").IsString()) {
- return invocation_response::failure("Missing input value s3bucket or s3key", "InvalidJSON");
- }
-
- auto bucket = v.GetString("s3bucket");
- auto key = v.GetString("s3key");
-
- AWS_LOGSTREAM_INFO(TAG, "Attempting to download file from s3://" << bucket << "/" << key);
-
- Aws::String base64_encoded_file;
- auto err = download_and_encode_file(client, bucket, key, base64_encoded_file);
- if (!err.empty()) {
- return invocation_response::failure(err, "DownloadFailure");
- }
-
- return invocation_response::success(base64_encoded_file, "application/base64");
-}
-
-std::function()> GetConsoleLoggerFactory()
-{
- return [] {
- return Aws::MakeShared(
- "console_logger", Aws::Utils::Logging::LogLevel::Trace);
- };
-}
-
-int main()
-{
- using namespace Aws;
- SDKOptions options;
- options.loggingOptions.logLevel = Aws::Utils::Logging::LogLevel::Trace;
- options.loggingOptions.logger_create_fn = GetConsoleLoggerFactory();
- InitAPI(options);
- {
- Client::ClientConfiguration config;
- config.region = Aws::Environment::GetEnv("AWS_REGION");
- config.caFile = "/etc/pki/tls/certs/ca-bundle.crt";
-
- auto credentialsProvider = Aws::MakeShared(TAG);
- S3::S3Client client(credentialsProvider, config);
- auto handler_fn = [&client](aws::lambda_runtime::invocation_request const& req) {
- return my_handler(req, client);
- };
- run_handler(handler_fn);
- }
- ShutdownAPI(options);
- return 0;
-}
-
-std::string encode(Aws::IOStream& stream, Aws::String& output)
-{
- Aws::Vector bits;
- bits.reserve(stream.tellp());
- stream.seekg(0, stream.beg);
-
- char streamBuffer[1024 * 4];
- while (stream.good()) {
- stream.read(streamBuffer, sizeof(streamBuffer));
- auto bytesRead = stream.gcount();
-
- if (bytesRead > 0) {
- bits.insert(bits.end(), (unsigned char*)streamBuffer, (unsigned char*)streamBuffer + bytesRead);
- }
- }
- Aws::Utils::ByteBuffer bb(bits.data(), bits.size());
- output = Aws::Utils::HashingUtils::Base64Encode(bb);
- return {};
-}
-
-std::string download_and_encode_file(
- Aws::S3::S3Client const& client,
- Aws::String const& bucket,
- Aws::String const& key,
- Aws::String& encoded_output)
-{
- using namespace Aws;
-
- S3::Model::GetObjectRequest request;
- request.WithBucket(bucket).WithKey(key);
-
- auto outcome = client.GetObject(request);
- if (outcome.IsSuccess()) {
- AWS_LOGSTREAM_INFO(TAG, "Download completed!");
- auto& s = outcome.GetResult().GetBody();
- return encode(s, encoded_output);
- }
- else {
- AWS_LOGSTREAM_ERROR(TAG, "Failed with error: " << outcome.GetError());
- return outcome.GetError().GetMessage();
- }
-}
diff --git a/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/include/aws/http/response.h b/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/include/aws/http/response.h
deleted file mode 100644
index 9b8cbda1..00000000
--- a/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/include/aws/http/response.h
+++ /dev/null
@@ -1,174 +0,0 @@
-#pragma once
-/*
- * Copyright 2018-present Amazon.com, Inc. or its affiliates. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License").
- * You may not use this file except in compliance with the License.
- * A copy of the License is located at
- *
- * http://aws.amazon.com/apache2.0
- *
- * or in the "license" file accompanying this file. This file is distributed
- * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-#include
-#include
-#include
-#include // tolower
-#include
-
-namespace aws {
-namespace http {
-enum class response_code;
-class response {
-public:
- /**
- * lower-case the name but store the value as is
- */
- inline void add_header(std::string name, std::string const& value);
- inline void append_body(const char* p, size_t sz);
- inline bool has_header(char const* header) const;
- inline std::string const& get_header(char const* header) const;
- inline response_code get_response_code() const { return m_response_code; }
- inline void set_response_code(aws::http::response_code c);
- inline void set_content_type(char const* ct);
- inline std::string const& get_body() const;
-
-private:
- response_code m_response_code;
- using key_value_collection = std::vector>;
- key_value_collection m_headers;
- std::string m_body;
- std::string m_content_type;
-};
-
-enum class response_code {
- REQUEST_NOT_MADE = -1,
- CONTINUE = 100,
- SWITCHING_PROTOCOLS = 101,
- PROCESSING = 102,
- OK = 200,
- CREATED = 201,
- ACCEPTED = 202,
- NON_AUTHORITATIVE_INFORMATION = 203,
- NO_CONTENT = 204,
- RESET_CONTENT = 205,
- PARTIAL_CONTENT = 206,
- MULTI_STATUS = 207,
- ALREADY_REPORTED = 208,
- IM_USED = 226,
- MULTIPLE_CHOICES = 300,
- MOVED_PERMANENTLY = 301,
- FOUND = 302,
- SEE_OTHER = 303,
- NOT_MODIFIED = 304,
- USE_PROXY = 305,
- SWITCH_PROXY = 306,
- TEMPORARY_REDIRECT = 307,
- PERMANENT_REDIRECT = 308,
- BAD_REQUEST = 400,
- UNAUTHORIZED = 401,
- PAYMENT_REQUIRED = 402,
- FORBIDDEN = 403,
- NOT_FOUND = 404,
- METHOD_NOT_ALLOWED = 405,
- NOT_ACCEPTABLE = 406,
- PROXY_AUTHENTICATION_REQUIRED = 407,
- REQUEST_TIMEOUT = 408,
- CONFLICT = 409,
- GONE = 410,
- LENGTH_REQUIRED = 411,
- PRECONDITION_FAILED = 412,
- REQUEST_ENTITY_TOO_LARGE = 413,
- REQUEST_URI_TOO_LONG = 414,
- UNSUPPORTED_MEDIA_TYPE = 415,
- REQUESTED_RANGE_NOT_SATISFIABLE = 416,
- EXPECTATION_FAILED = 417,
- IM_A_TEAPOT = 418,
- AUTHENTICATION_TIMEOUT = 419,
- METHOD_FAILURE = 420,
- UNPROC_ENTITY = 422,
- LOCKED = 423,
- FAILED_DEPENDENCY = 424,
- UPGRADE_REQUIRED = 426,
- PRECONDITION_REQUIRED = 427,
- TOO_MANY_REQUESTS = 429,
- REQUEST_HEADER_FIELDS_TOO_LARGE = 431,
- LOGIN_TIMEOUT = 440,
- NO_RESPONSE = 444,
- RETRY_WITH = 449,
- BLOCKED = 450,
- REDIRECT = 451,
- REQUEST_HEADER_TOO_LARGE = 494,
- CERT_ERROR = 495,
- NO_CERT = 496,
- HTTP_TO_HTTPS = 497,
- CLIENT_CLOSED_TO_REQUEST = 499,
- INTERNAL_SERVER_ERROR = 500,
- NOT_IMPLEMENTED = 501,
- BAD_GATEWAY = 502,
- SERVICE_UNAVAILABLE = 503,
- GATEWAY_TIMEOUT = 504,
- HTTP_VERSION_NOT_SUPPORTED = 505,
- VARIANT_ALSO_NEGOTIATES = 506,
- INSUFFICIENT_STORAGE = 506,
- LOOP_DETECTED = 508,
- BANDWIDTH_LIMIT_EXCEEDED = 509,
- NOT_EXTENDED = 510,
- NETWORK_AUTHENTICATION_REQUIRED = 511,
- NETWORK_READ_TIMEOUT = 598,
- NETWORK_CONNECT_TIMEOUT = 599
-};
-
-inline void response::set_response_code(http::response_code c)
-{
- m_response_code = c;
-}
-
-inline void response::set_content_type(char const* ct)
-{
- m_content_type = ct;
-}
-
-inline std::string const& response::get_body() const
-{
- return m_body;
-}
-inline void response::add_header(std::string name, std::string const& value)
-{
- std::transform(name.begin(), name.end(), name.begin(), ::tolower);
- m_headers.emplace_back(name, value);
-}
-
-inline void response::append_body(const char* p, size_t sz)
-{
- // simple and generates significantly less code than std::stringstream
- constexpr size_t min_capacity = 512;
- if (m_body.capacity() < min_capacity) {
- m_body.reserve(min_capacity);
- }
-
- m_body.append(p, sz);
-}
-
-inline bool response::has_header(char const* header) const
-{
- return std::any_of(m_headers.begin(), m_headers.end(), [header](std::pair const& p) {
- return p.first == header;
- });
-}
-
-inline std::string const& response::get_header(char const* header) const
-{
- auto it = std::find_if(m_headers.begin(), m_headers.end(), [header](std::pair const& p) {
- return p.first == header;
- });
- assert(it != m_headers.end());
- return it->second;
-}
-
-} // namespace http
-} // namespace aws
diff --git a/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/include/aws/lambda-runtime/outcome.h b/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/include/aws/lambda-runtime/outcome.h
deleted file mode 100644
index b5d0b8b0..00000000
--- a/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/include/aws/lambda-runtime/outcome.h
+++ /dev/null
@@ -1,96 +0,0 @@
-#pragma once
-/*
- * Copyright 2018-present Amazon.com, Inc. or its affiliates. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License").
- * You may not use this file except in compliance with the License.
- * A copy of the License is located at
- *
- * http://aws.amazon.com/apache2.0
- *
- * or in the "license" file accompanying this file. This file is distributed
- * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-#include
-#include
-
-namespace aws {
-namespace lambda_runtime {
-
-template
-class outcome {
-public:
- outcome(TResult const& s) : m_s(s), m_success(true) {}
- outcome(TResult&& s) : m_s(std::move(s)), m_success(true) {}
-
- outcome(TFailure const& f) : m_f(f), m_success(false) {}
- outcome(TFailure&& f) : m_f(std::move(f)), m_success(false) {}
-
- outcome(outcome const& other) : m_success(other.m_success)
- {
- if (m_success) {
- new (&m_s) TResult(other.m_s);
- }
- else {
- new (&m_f) TFailure(other.m_f);
- }
- }
-
- outcome(outcome&& other) noexcept : m_success(other.m_success)
- {
- if (m_success) {
- new (&m_s) TResult(std::move(other.m_s));
- }
- else {
- new (&m_f) TFailure(std::move(other.m_f));
- }
- }
-
- ~outcome()
- {
- if (m_success) {
- m_s.~TResult();
- }
- else {
- m_f.~TFailure();
- }
- }
-
- TResult const& get_result() const&
- {
- assert(m_success);
- return m_s;
- }
-
- TResult&& get_result() &&
- {
- assert(m_success);
- return std::move(m_s);
- }
-
- TFailure const& get_failure() const&
- {
- assert(!m_success);
- return m_f;
- }
-
- TFailure&& get_failure() &&
- {
- assert(!m_success);
- return std::move(m_f);
- }
-
- bool is_success() const { return m_success; }
-
-private:
- union {
- TResult m_s;
- TFailure m_f;
- };
- bool m_success;
-};
-} // namespace lambda_runtime
-} // namespace aws
diff --git a/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/include/aws/lambda-runtime/runtime.h b/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/include/aws/lambda-runtime/runtime.h
deleted file mode 100644
index 94e1e22c..00000000
--- a/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/include/aws/lambda-runtime/runtime.h
+++ /dev/null
@@ -1,183 +0,0 @@
-#pragma once
-/*
- * Copyright 2018-present Amazon.com, Inc. or its affiliates. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License").
- * You may not use this file except in compliance with the License.
- * A copy of the License is located at
- *
- * http://aws.amazon.com/apache2.0
- *
- * or in the "license" file accompanying this file. This file is distributed
- * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-#include
-#include
-#include
-#include
-#include
-#include "aws/lambda-runtime/outcome.h"
-#include "aws/http/response.h"
-
-namespace aws {
-namespace lambda_runtime {
-
-struct invocation_request {
- /**
- * The user's payload represented as a UTF-8 string.
- */
- std::string payload;
-
- /**
- * An identifier unique to the current invocation.
- */
- std::string request_id;
-
- /**
- * X-Ray tracing ID of the current invocation.
- */
- std::string xray_trace_id;
-
- /**
- * Information about the client application and device when invoked through the AWS Mobile SDK.
- */
- std::string client_context;
-
- /**
- * Information about the Amazon Cognito identity provider when invoked through the AWS Mobile SDK.
- */
- std::string cognito_identity;
-
- /**
- * The ARN requested. This can be different in each invoke that executes the same version.
- */
- std::string function_arn;
-
- /**
- * Function execution deadline counted in milliseconds since the Unix epoch.
- */
- std::chrono::time_point deadline;
-
- /**
- * The number of milliseconds left before lambda terminates the current execution.
- */
- inline std::chrono::milliseconds get_time_remaining() const;
-};
-
-class invocation_response {
-private:
- /**
- * The output of the function which is sent to the lambda caller.
- */
- std::string m_payload;
-
- /**
- * The MIME type of the payload.
- * This is always set to 'application/json' in unsuccessful invocations.
- */
- std::string m_content_type;
-
- /**
- * Flag to distinguish if the contents are for successful or unsuccessful invocations.
- */
- bool m_success;
-
- /**
- * Instantiate an empty response. Used by the static functions 'success' and 'failure' to create a populated
- * invocation_response
- */
- invocation_response() = default;
-
-public:
- // Create a success or failure response. Typically, you should use the static functions invocation_response::success
- // and invocation_response::failure, however, invocation_response::failure doesn't allow for arbitrary payloads.
- // To support clients that need to control the entire error response body (e.g. adding a stack trace), this
- // constructor should be used instead.
- // Note: adding an overload to invocation_response::failure is not feasible since the parameter types are the same.
- invocation_response(std::string const& payload, std::string const& content_type, bool success)
- : m_payload(payload), m_content_type(content_type), m_success(success)
- {
- }
-
- /**
- * Create a successful invocation response with the given payload and content-type.
- */
- static invocation_response success(std::string const& payload, std::string const& content_type);
-
- /**
- * Create a failure response with the given error message and error type.
- * The content-type is always set to application/json in this case.
- */
- static invocation_response failure(std::string const& error_message, std::string const& error_type);
-
- /**
- * Get the MIME type of the payload.
- */
- std::string const& get_content_type() const { return m_content_type; }
-
- /**
- * Get the payload string. The string is assumed to be UTF-8 encoded.
- */
- std::string const& get_payload() const { return m_payload; }
-
- /**
- * Returns true if the payload and content-type are set. Returns false if the error message and error types are set.
- */
- bool is_success() const { return m_success; }
-};
-
-struct no_result {
-};
-
-class runtime {
-public:
- using next_outcome = aws::lambda_runtime::outcome;
- using post_outcome = aws::lambda_runtime::outcome;
-
- runtime(std::string const& endpoint, std::string const& user_agent);
- runtime(std::string const& endpoint);
- ~runtime();
-
- /**
- * Ask lambda for an invocation.
- */
- next_outcome get_next();
-
- /**
- * Tells lambda that the function has succeeded.
- */
- post_outcome post_success(std::string const& request_id, invocation_response const& handler_response);
-
- /**
- * Tells lambda that the function has failed.
- */
- post_outcome post_failure(std::string const& request_id, invocation_response const& handler_response);
-
-private:
- void set_curl_next_options();
- void set_curl_post_result_options();
- post_outcome do_post(
- std::string const& url,
- std::string const& request_id,
- invocation_response const& handler_response);
-
-private:
- std::string const m_user_agent_header;
- std::array const m_endpoints;
- CURL* const m_curl_handle;
-};
-
-inline std::chrono::milliseconds invocation_request::get_time_remaining() const
-{
- using namespace std::chrono;
- return duration_cast(deadline - system_clock::now());
-}
-
-// Entry method
-void run_handler(std::function const& handler);
-
-} // namespace lambda_runtime
-} // namespace aws
diff --git a/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/include/aws/lambda-runtime/version.h b/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/include/aws/lambda-runtime/version.h
deleted file mode 100644
index eafcbde7..00000000
--- a/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/include/aws/lambda-runtime/version.h
+++ /dev/null
@@ -1,41 +0,0 @@
-#pragma once
-/*
- * Copyright 2018-present Amazon.com, Inc. or its affiliates. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License").
- * You may not use this file except in compliance with the License.
- * A copy of the License is located at
- *
- * http://aws.amazon.com/apache2.0
- *
- * or in the "license" file accompanying this file. This file is distributed
- * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-namespace aws {
-namespace lambda_runtime {
-
-/**
- * Returns the major component of the library version.
- */
-unsigned get_version_major();
-
-/**
- * Returns the minor component of the library version.
- */
-unsigned get_version_minor();
-
-/**
- * Returns the patch component of the library version.
- */
-unsigned get_version_patch();
-
-/**
- * Returns the semantic version of the library in the form Major.Minor.Patch
- */
-char const* get_version();
-
-} // namespace lambda_runtime
-} // namespace aws
diff --git a/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/include/aws/logging/logging.h b/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/include/aws/logging/logging.h
deleted file mode 100644
index 0b5d0ef9..00000000
--- a/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/include/aws/logging/logging.h
+++ /dev/null
@@ -1,67 +0,0 @@
-#pragma once
-/*
- * Copyright 2018-present Amazon.com, Inc. or its affiliates. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License").
- * You may not use this file except in compliance with the License.
- * A copy of the License is located at
- *
- * http://aws.amazon.com/apache2.0
- *
- * or in the "license" file accompanying this file. This file is distributed
- * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied. See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-#include
-
-namespace aws {
-namespace logging {
-
-enum class verbosity {
- error,
- info,
- debug,
-};
-
-void log(verbosity v, char const* tag, char const* msg, va_list args);
-
-[[gnu::format(printf, 2, 3)]] inline void log_error(char const* tag, char const* msg, ...)
-{
- va_list args;
- va_start(args, msg);
- log(verbosity::error, tag, msg, args);
- va_end(args);
- (void)tag;
- (void)msg;
-}
-
-[[gnu::format(printf, 2, 3)]] inline void log_info(char const* tag, char const* msg, ...)
-{
-#if AWS_LAMBDA_LOG >= 1
- va_list args;
- va_start(args, msg);
- log(verbosity::info, tag, msg, args);
- va_end(args);
-#else
- (void)tag;
- (void)msg;
-#endif
-}
-
-[[gnu::format(printf, 2, 3)]] inline void log_debug(char const* tag, char const* msg, ...)
-{
-#if AWS_LAMBDA_LOG >= 2
- va_list args;
- va_start(args, msg);
- log(verbosity::debug, tag, msg, args);
- va_end(args);
-#else
- (void)tag;
- (void)msg;
-#endif
-}
-
-} // namespace logging
-} // namespace aws
diff --git a/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/src/backward.cpp b/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/src/backward.cpp
deleted file mode 100644
index cc64abdb..00000000
--- a/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/src/backward.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-// Pick your poison.
-//
-// On GNU/Linux, you have few choices to get the most out of your stack trace.
-//
-// By default you get:
-// - object filename
-// - function name
-//
-// In order to add:
-// - source filename
-// - line and column numbers
-// - source code snippet (assuming the file is accessible)
-
-// Install one of the following library then uncomment one of the macro (or
-// better, add the detection of the lib and the macro definition in your build
-// system)
-
-// - apt-get install libdw-dev ...
-// - g++/clang++ -ldw ...
-// #define BACKWARD_HAS_DW 1
-
-// - apt-get install binutils-dev ...
-// - g++/clang++ -lbfd ...
-// #define BACKWARD_HAS_BFD 1
-
-#include "backward.h"
-
-namespace backward {
-
-backward::SignalHandling sh;
-
-} // namespace backward
diff --git a/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/src/backward.h b/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/src/backward.h
deleted file mode 100644
index e9e56c79..00000000
--- a/aws-lambda-java-runtime-interface-client/src/main/jni/deps/aws-lambda-cpp-0.2.7/src/backward.h
+++ /dev/null
@@ -1,4291 +0,0 @@
-// clang-format off
-/*
- * backward.hpp
- * Copyright 2013 Google Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-#ifndef H_6B9572DA_A64B_49E6_B234_051480991C89
-#define H_6B9572DA_A64B_49E6_B234_051480991C89
-
-#ifndef __cplusplus
-# error "It's not going to compile without a C++ compiler..."
-#endif
-
-#if defined(BACKWARD_CXX11)
-#elif defined(BACKWARD_CXX98)
-#else
-# if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1800)
-# define BACKWARD_CXX11
-# define BACKWARD_ATLEAST_CXX11
-# define BACKWARD_ATLEAST_CXX98
-# else
-# define BACKWARD_CXX98
-# define BACKWARD_ATLEAST_CXX98
-# endif
-#endif
-
-// You can define one of the following (or leave it to the auto-detection):
-//
-// #define BACKWARD_SYSTEM_LINUX
-// - specialization for linux
-//
-// #define BACKWARD_SYSTEM_DARWIN
-// - specialization for Mac OS X 10.5 and later.
-//
-// #define BACKWARD_SYSTEM_UNKNOWN
-// - placebo implementation, does nothing.
-//
-#if defined(BACKWARD_SYSTEM_LINUX)
-#elif defined(BACKWARD_SYSTEM_DARWIN)
-#elif defined(BACKWARD_SYSTEM_UNKNOWN)
-#elif defined(BACKWARD_SYSTEM_WINDOWS)
-#else
-# if defined(__linux) || defined(__linux__)
-# define BACKWARD_SYSTEM_LINUX
-# elif defined(__APPLE__)
-# define BACKWARD_SYSTEM_DARWIN
-# elif defined(_WIN32)
-# define BACKWARD_SYSTEM_WINDOWS
-# else
-# define BACKWARD_SYSTEM_UNKNOWN
-# endif
-#endif
-
-#define NOINLINE __attribute__((noinline))
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#if defined(BACKWARD_SYSTEM_LINUX)
-
-// On linux, backtrace can back-trace or "walk" the stack using the following
-// libraries:
-//
-// #define BACKWARD_HAS_UNWIND 1
-// - unwind comes from libgcc, but I saw an equivalent inside clang itself.
-// - with unwind, the stacktrace is as accurate as it can possibly be, since
-// this is used by the C++ runtine in gcc/clang for stack unwinding on
-// exception.
-// - normally libgcc is already linked to your program by default.
-//
-// #define BACKWARD_HAS_BACKTRACE == 1
-// - backtrace seems to be a little bit more portable than libunwind, but on
-// linux, it uses unwind anyway, but abstract away a tiny information that is
-// sadly really important in order to get perfectly accurate stack traces.
-// - backtrace is part of the (e)glib library.
-//
-// The default is:
-// #define BACKWARD_HAS_UNWIND == 1
-//
-// Note that only one of the define should be set to 1 at a time.
-//
-# if BACKWARD_HAS_UNWIND == 1
-# elif BACKWARD_HAS_BACKTRACE == 1
-# else
-# undef BACKWARD_HAS_UNWIND
-# define BACKWARD_HAS_UNWIND 1
-# undef BACKWARD_HAS_BACKTRACE
-# define BACKWARD_HAS_BACKTRACE 0
-# endif
-
-// On linux, backward can extract detailed information about a stack trace
-// using one of the following libraries:
-//
-// #define BACKWARD_HAS_DW 1
-// - libdw gives you the most juicy details out of your stack traces:
-// - object filename
-// - function name
-// - source filename
-// - line and column numbers
-// - source code snippet (assuming the file is accessible)
-// - variables name and values (if not optimized out)
-// - You need to link with the lib "dw":
-// - apt-get install libdw-dev
-// - g++/clang++ -ldw ...
-//
-// #define BACKWARD_HAS_BFD 1
-// - With libbfd, you get a fair amount of details:
-// - object filename
-// - function name
-// - source filename
-// - line numbers
-// - source code snippet (assuming the file is accessible)
-// - You need to link with the lib "bfd":
-// - apt-get install binutils-dev
-// - g++/clang++ -lbfd ...
-//
-// #define BACKWARD_HAS_DWARF 1
-// - libdwarf gives you the most juicy details out of your stack traces:
-// - object filename
-// - function name
-// - source filename
-// - line and column numbers
-// - source code snippet (assuming the file is accessible)
-// - variables name and values (if not optimized out)
-// - You need to link with the lib "dwarf":
-// - apt-get install libdwarf-dev
-// - g++/clang++ -ldwarf ...
-//
-// #define BACKWARD_HAS_BACKTRACE_SYMBOL 1
-// - backtrace provides minimal details for a stack trace:
-// - object filename
-// - function name
-// - backtrace is part of the (e)glib library.
-//
-// The default is:
-// #define BACKWARD_HAS_BACKTRACE_SYMBOL == 1
-//
-// Note that only one of the define should be set to 1 at a time.
-//
-# if BACKWARD_HAS_DW == 1
-# elif BACKWARD_HAS_BFD == 1
-# elif BACKWARD_HAS_DWARF == 1
-# elif BACKWARD_HAS_BACKTRACE_SYMBOL == 1
-# else
-# undef BACKWARD_HAS_DW
-# define BACKWARD_HAS_DW 0
-# undef BACKWARD_HAS_BFD
-# define BACKWARD_HAS_BFD 0
-# undef BACKWARD_HAS_DWARF
-# define BACKWARD_HAS_DWARF 0
-# undef BACKWARD_HAS_BACKTRACE_SYMBOL
-# define BACKWARD_HAS_BACKTRACE_SYMBOL 1
-# endif
-
-# include
-# include
-# ifdef __ANDROID__
-// Old Android API levels define _Unwind_Ptr in both link.h and
-// unwind.h Rename the one in link.h as we are not going to be using
-// it
-# define _Unwind_Ptr _Unwind_Ptr_Custom
-# include
-# undef _Unwind_Ptr
-# else
-# include
-# endif
-# include
-# include
-# include
-# include
-
-# if BACKWARD_HAS_BFD == 1
-// NOTE: defining PACKAGE{,_VERSION} is required before including
-// bfd.h on some platforms, see also:
-// https://sourceware.org/bugzilla/show_bug.cgi?id=14243
-# ifndef PACKAGE
-# define PACKAGE
-# endif
-# ifndef PACKAGE_VERSION
-# define PACKAGE_VERSION
-# endif
-# include
-# ifndef _GNU_SOURCE
-# define _GNU_SOURCE
-# include
-# undef _GNU_SOURCE
-# else
-# include
-# endif
-# endif
-
-# if BACKWARD_HAS_DW == 1
-# include
-# include
-# include
-# endif
-
-# if BACKWARD_HAS_DWARF == 1
-# include
-# include
-# include
-# include
-# include