You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm relatively new to rolling my own stack to AWS using CDK (I'm using the Typescript flavour), having worked with other clouds previously.
I'm not sure if this is the correct medium to ask these question, so please advice if there's another place for better reach?
As per the title my stack is an API Gateway proxying webhook requests to a Lambda function, I already have the stack defined and implemented and can synth, deploy and destroy without an issue.
However, I have noticed log entries on CloudWatch that my handler emits a requestId that does not match the lambda's
I'm assuming the one in yellow is the actual Lambda's requestId and the one my code emits is the Api Gateway's that is included in the request's body.
I would prefer to use the Lambda's requestId instead, so that I can actually consistently observe reports about these (time/billing, etc).
My CDK stack integration with the lambda and API looks like this:
I have used Amazon Q to ask this question but neither of the examples have worked, seems to me that requestTemplates only apply if the gateway is not actually proxying?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I'm relatively new to rolling my own stack to AWS using CDK (I'm using the Typescript flavour), having worked with other clouds previously.
I'm not sure if this is the correct medium to ask these question, so please advice if there's another place for better reach?
As per the title my stack is an API Gateway proxying webhook requests to a Lambda function, I already have the stack defined and implemented and can synth, deploy and destroy without an issue.
However, I have noticed log entries on CloudWatch that my handler emits a requestId that does not match the lambda's
I'm assuming the one in yellow is the actual Lambda's requestId and the one my code emits is the Api Gateway's that is included in the request's body.
I would prefer to use the Lambda's requestId instead, so that I can actually consistently observe reports about these (time/billing, etc).
My CDK stack integration with the lambda and API looks like this:
And my Lamba's GO code like this:
I have used Amazon Q to ask this question but neither of the examples have worked, seems to me that requestTemplates only apply if the gateway is not actually proxying?
Any advice?
Thank you
Beta Was this translation helpful? Give feedback.
All reactions