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

Access AWS lambda context in wing #6412

Closed
eladcon opened this issue May 5, 2024 · 3 comments · Fixed by #6424
Closed

Access AWS lambda context in wing #6412

eladcon opened this issue May 5, 2024 · 3 comments · Fixed by #6424
Assignees
Labels
☁️ aws Related to Amazon Web Services support ✨ enhancement New feature or request needs-discussion Further discussion is needed prior to impl

Comments

@eladcon
Copy link
Collaborator

eladcon commented May 5, 2024

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 eladcon added ✨ enhancement New feature or request needs-discussion Further discussion is needed prior to impl labels May 5, 2024
@Chriscbr
Copy link
Contributor

Chriscbr commented May 6, 2024

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();
});

@eladb
Copy link
Contributor

eladb commented May 7, 2024

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

@staycoolcall911 staycoolcall911 added the ☁️ aws Related to Amazon Web Services support label May 9, 2024
@mergify mergify bot closed this as completed in #6424 May 21, 2024
mergify bot pushed a commit that referenced this issue May 21, 2024
Closes #6412

## Checklist

- [x] Title matches [Winglang's style guide](https://www.winglang.io/contributing/start-here/pull_requests#how-are-pull-request-titles-formatted)
- [x] Description explains motivation and solution
- [x] Tests added (always)
- [ ] Docs updated (only required for features)
- [ ] Added `pr/e2e-full` label if this feature requires end-to-end testing

*By submitting this pull request, I confirm that my contribution is made under the terms of the [Wing Cloud Contribution License](https://github.com/winglang/wing/blob/main/CONTRIBUTION_LICENSE.md)*.
@monadabot
Copy link
Contributor

Congrats! 🚀 This was released in Wing 0.74.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
☁️ aws Related to Amazon Web Services support ✨ enhancement New feature or request needs-discussion Further discussion is needed prior to impl
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

5 participants