dherault / dherault/serverless-offline

[Support] Help supporting Swift Lambda with a SwiftRunner please!

Open
#1,673 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
5.3k
Forks
811
Avg merge
2d 4h
Merged PRs (30d)
3

Description

## Feature Request

https://github.com/serverless/serverless/issues/11840

I'm currently trying to pull in a Swift lambda into SLS, which I am currently able to get a local running server out of the box using Swift Lambda Runtime.

How do I extend Serverless Offline to proxy invocations for my swift function to this server so that it can respond to invocations?

I'm staring at these files and it does not seem extensible :)

https://github.com/dherault/serverless-offline/blob/56d986b672602b3600fe9b552ecb4ee392ca2201/src/lambda/LambdaFunction.js

https://github.com/dherault/serverless-offline/blob/43dfea4fc97f57d439186523ab5e7b3bc3770e55/src/lambda/handler-runner/HandlerRunner.js

Edit: I do see some effort in the codebase with the `supportedProvided` set of runtimes `provided` and `provided.al2`. I assume there might be some future consideration here? I can't see it being used elsewhere though. Updated my proposal below to align.

---

### Proposed Solution

Option 1:

maybe a extension property in serverless.yml like the following

```
functions:
swift-function:
handler: src/index.handler
runtime: 'provided'
offline:
proxy: 'localhost:7000/invoke'
```

or maybe configuration in the `custom` property

```
custom:
offline:
runtimes:
swift:
proxy: 'localhost:7000/invoke'

functions:
swift-function:
handler: src/index.handler
runtime: 'swift'
```

Option 2:

Or just simply a new Runner maintained by your team

Option 3:

or maybe a facility for adding custom runners for other plugins?

Option 4:

or expose some hooks?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.