wing icon indicating copy to clipboard operation
wing copied to clipboard

Access AWS lambda context in wing

Open eladcon opened this issue 9 months ago • 2 comments

Use Case

I want to access some information that is available on the context variable passed to the handler (E.g. access function name or request id in AWS)

Proposed Solution

No response

Implementation Notes

No response

Component

No response

Community Notes

  • Please vote by adding a 👍 reaction to the issue to help us prioritize.
  • If you are interested to work on this issue, please leave a comment.
  • If this issue is labeled needs-discussion, it means the spec has not been finalized yet. Please reach out on the #dev channel in the Wing Slack.

eladcon avatar May 05 '24 14:05 eladcon

Maybe we can start by exposing the info through an API like

bring aws;

new cloud.Function(inflight (msg: str) => {
  let ctx = aws.context; // or aws.getContext();
});

Chriscbr avatar May 06 '24 16:05 Chriscbr

Sounds good, but I'd go with aws.Function.context() to associate with Lambda functions

eladb avatar May 07 '24 13:05 eladb

Congrats! :rocket: This was released in Wing 0.74.2.

monadabot avatar May 21 '24 04:05 monadabot