Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ExtendedRequestId to APIGatewayProxyRequestContext #451

Merged
merged 1 commit into from Jul 12, 2022

Conversation

DanielBauman88
Copy link
Contributor

It exists on APIGatewayWebsocketProxyRequestContext but not ExtendedRequestId.
It is however present on non-websocket requests and should be accessible by consumers of this package.

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@DanielBauman88
Copy link
Contributor Author

DanielBauman88 commented Jul 11, 2022

I validated this with my rest api by deploying my go code and replacing this module with my changes. The extended request id is accessible as expected.

This was supported for websocket requests when this was added but this was never supported for non-websocket requests.

This functionality is important so that customers can long the extendedRequestId in lambda code - this will match what's logged in the APIGW execution logs.

It exists on APIGatewayWebsocketProxyRequestContext but not ExtendedRequestId.
It is however present on non-websocket requests and should be accessible by consumers of this package.

* REST https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html
* HTTP https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-logging-variables.html
@DanielBauman88
Copy link
Contributor Author

Thanks for enabling the WFs. I noticed they failed on the first revision, pushed a new one and validated that the tests pass locally with

✗ go test -race -coverprofile=coverage.txt -covermode=atomic ./...

ok  	github.com/aws/aws-lambda-go/cfn	0.168s	coverage: 72.2% of statements
ok  	github.com/aws/aws-lambda-go/cmd/build-lambda-zip	17.898s	coverage: 54.7% of statements
ok  	github.com/aws/aws-lambda-go/events	0.450s	coverage: 83.2% of statements
?   	github.com/aws/aws-lambda-go/events/test	[no test files]
ok  	github.com/aws/aws-lambda-go/lambda	1.090s	coverage: 90.0% of statements
?   	github.com/aws/aws-lambda-go/lambda/handlertrace	[no test files]
?   	github.com/aws/aws-lambda-go/lambda/messages	[no test files]
?   	github.com/aws/aws-lambda-go/lambdacontext	[no test files]

Copy link
Collaborator

@bmoffatt bmoffatt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bmoffatt
Copy link
Collaborator

Thanks!

@bmoffatt bmoffatt merged commit 6796528 into aws:main Jul 12, 2022
@DanielBauman88
Copy link
Contributor Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants