Skip to content

Commit a855631

Browse files
author
Ramisa Alam
committed
feat: add tenant id header to next invocation request
1 parent 934d254 commit a855631

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

include/aws/lambda-runtime/runtime.h

+5
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ struct invocation_request {
6161
*/
6262
std::chrono::time_point<std::chrono::system_clock> deadline;
6363

64+
/**
65+
* Tenant ID of the current invocation.
66+
*/
67+
std::string tenant_id;
68+
6469
/**
6570
* The number of milliseconds left before lambda terminates the current execution.
6671
*/

src/runtime.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ static constexpr auto CLIENT_CONTEXT_HEADER = "lambda-runtime-client-context";
4141
static constexpr auto COGNITO_IDENTITY_HEADER = "lambda-runtime-cognito-identity";
4242
static constexpr auto DEADLINE_MS_HEADER = "lambda-runtime-deadline-ms";
4343
static constexpr auto FUNCTION_ARN_HEADER = "lambda-runtime-invoked-function-arn";
44+
static constexpr auto TENANT_ID_HEADER = "lambda-runtime-aws-tenant-id";
4445

4546
enum Endpoints {
4647
INIT,
@@ -315,6 +316,12 @@ runtime::next_outcome runtime::get_next()
315316
req.payload.c_str(),
316317
static_cast<int64_t>(req.get_time_remaining().count()));
317318
}
319+
320+
out = resp.get_header(TENANT_ID_HEADER);
321+
if (out.is_success()) {
322+
req.tenant_id = std::move(out).get_result();
323+
}
324+
318325
return {req};
319326
}
320327

0 commit comments

Comments
 (0)