Skip to content

Commit 6796528

Browse files
Add ExtendedRequestId to APIGatewayProxyRequestContext (#451)
1 parent 0260078 commit 6796528

File tree

3 files changed

+19
-16
lines changed

3 files changed

+19
-16
lines changed

events/apigw.go

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,23 @@ type APIGatewayProxyResponse struct {
3030
// APIGatewayProxyRequestContext contains the information to identify the AWS account and resources invoking the
3131
// Lambda function. It also includes Cognito identity information for the caller.
3232
type APIGatewayProxyRequestContext struct {
33-
AccountID string `json:"accountId"`
34-
ResourceID string `json:"resourceId"`
35-
OperationName string `json:"operationName,omitempty"`
36-
Stage string `json:"stage"`
37-
DomainName string `json:"domainName"`
38-
DomainPrefix string `json:"domainPrefix"`
39-
RequestID string `json:"requestId"`
40-
Protocol string `json:"protocol"`
41-
Identity APIGatewayRequestIdentity `json:"identity"`
42-
ResourcePath string `json:"resourcePath"`
43-
Path string `json:"path"`
44-
Authorizer map[string]interface{} `json:"authorizer"`
45-
HTTPMethod string `json:"httpMethod"`
46-
RequestTime string `json:"requestTime"`
47-
RequestTimeEpoch int64 `json:"requestTimeEpoch"`
48-
APIID string `json:"apiId"` // The API Gateway rest API Id
33+
AccountID string `json:"accountId"`
34+
ResourceID string `json:"resourceId"`
35+
OperationName string `json:"operationName,omitempty"`
36+
Stage string `json:"stage"`
37+
DomainName string `json:"domainName"`
38+
DomainPrefix string `json:"domainPrefix"`
39+
RequestID string `json:"requestId"`
40+
ExtendedRequestID string `json:"extendedRequestId"`
41+
Protocol string `json:"protocol"`
42+
Identity APIGatewayRequestIdentity `json:"identity"`
43+
ResourcePath string `json:"resourcePath"`
44+
Path string `json:"path"`
45+
Authorizer map[string]interface{} `json:"authorizer"`
46+
HTTPMethod string `json:"httpMethod"`
47+
RequestTime string `json:"requestTime"`
48+
RequestTimeEpoch int64 `json:"requestTimeEpoch"`
49+
APIID string `json:"apiId"` // The API Gateway rest API Id
4950
}
5051

5152
// APIGatewayV2HTTPRequest contains data coming from the new HTTP API Gateway

events/testdata/apigw-request.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
"domainName": "gy415nuibc.execute-api.us-east-2.amazonaws.com",
6565
"domainPrefix": "y0ne18dixk",
6666
"requestId": "deef4878-7910-11e6-8f14-25afc3e9ae33",
67+
"extendedRequestId": "TWegAcC4EowCHnA=",
6768
"protocol": "HTTP/1.1",
6869
"identity": {
6970
"cognitoIdentityPoolId": "theCognitoIdentityPoolId",

events/testdata/apigw-restapi-openapi-request.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
"domainName": "gy415nuibc.execute-api.us-east-2.amazonaws.com",
6666
"domainPrefix": "y0ne18dixk",
6767
"requestId": "deef4878-7910-11e6-8f14-25afc3e9ae33",
68+
"extendedRequestId": "TWegAcC4EowCHnA=",
6869
"protocol": "HTTP/1.1",
6970
"identity": {
7071
"cognitoIdentityPoolId": "theCognitoIdentityPoolId",

0 commit comments

Comments
 (0)