Comments (6)
@Andrea-Scuderi the approach I used for SAM is to let the function developer describe its environment in Swift (like a SwiftUI struct) and generate the YAML based on that.
Example :
import AWSLambdaDeploymentDescriptor
DeploymentDescriptor {
// a mandatory description
"Description of this deployment descriptor"
// the lambda function
Function(name: "HttpApiLambda") {
EventSources {
HttpApi(method: .GET, path: "/test") // example of an API for a specific HTTP verb and path
}
// optional environment variables
EnvironmentVariables {
[ "NAME1": "VALUE1" ]
}
}
}
The same file could be generated for SAM or Serverless. It can have DynamoDB, IAM Policies, SQS queues ... The long part is to write the Swift struct that models all SAM/Serverless constructs.
from swift-aws-lambda-runtime.
Closing as there is a proposed SLS plugin on the SLS project.
from swift-aws-lambda-runtime.
Hello @darylteo
Are you thinking about a SwiftPM plugin to would generate a Serverless deployment descriptor ? Or a serverless plugin to scaffold a Swift project and its associate resources.
I am currently working on a SPM plugin that generates a SAM deployment descriptor. That work / approach could be extended to Serverless too.
Have a look at this PR (#291) and let me know what you think.
from swift-aws-lambda-runtime.
Hello @darylteo @sebsto,
I've prepared an example of the output required with Serverless using Breeze
the library I'm developing: https://github.com/swift-sprinter/Breeze/tree/main/Example.
Using Breeze
it's very easy to create a Serverless business logic for APIGateway, Lambda, Dynamo. The difficult part is to help users in the deployment.
That code has been generated by a command line, but it's still in development.
Not sure what could be the best approach:
1 - Have a SPM plugin, but it's not clear how to add additional resources (DynamoDB, ....)
2 - Use a dedicate command line
3 - Have a Plugin in Serverless
Maybe we need all the approaches, happy to contribute.
from swift-aws-lambda-runtime.
@sebsto @darylteo
Here the dedicated command line I've prepared for 💨Breeze
https://github.com/swift-sprinter/Breeze/pull/6
The command line relies on a new library I've prepared to load serverless.yml.
https://github.com/swift-sprinter/swift-sls-adapter.git
Once the solution [1] is ready, I can add the plugin for Serverless
Happy to get suggestions, comments and contributions.
from swift-aws-lambda-runtime.
Are you thinking about a SwiftPM plugin to would generate a Serverless deployment descriptor ? Or a serverless plugin to scaffold a Swift project and its associate resources.
@sebsto sorry I meant a ServerlessFramework plugin. I want to use SLS to do my deployments.
@Andrea-Scuderi Ah I think this is coming from the opposite direction of what I was thinking of. My use case is to use Swift in a mish mash of other runtimes using ServerlessFramework(SLS), so it's imperative that I work in SLS.
As you can see here, serverless/serverless#11840 (comment) I made a local plugin in SLS for starting a offline server so I can invoke commands into it. There are some minor inconveniences (can't proxy invoke through sls invoke local
, but it works for now.
Sorry for the confusion!
from swift-aws-lambda-runtime.
Related Issues (20)
- Replacement for Lambda.run? HOT 5
- How to fix newline in input causing Swift AWS lambda to fail in localhost testing HOT 2
- README.MD example about SimpleLambdaHandler HOT 3
- Archive plugin execution error with AWS SDK HOT 14
- Discussions repository Feature HOT 5
- Archive plugin to generate libraries (*.so) HOT 2
- [Idea] Could Lambda Layers Custom Runtime improve cold start performance? HOT 3
- [Feature Request] Somehow don't touch Package.resolved during lambda package archive to work better with VSCode. HOT 1
- [BUG] Can't compile code with NSFileCoordinator (cannot find in scope) HOT 3
- CI builds fails with Swift 5.9 and Swift nightly HOT 4
- [Question] Can DocC remove license headers from source code file HOT 4
- Add support for SPM Resources HOT 1
- print statements do not work despite context.logger.info(stringLiteral:) working HOT 1
- Debugging locally on a different invocation endpoint HOT 3
- Function crash details not reported HOT 6
- Event JSON HOT 4
- Compile error on Windows HOT 1
- Doesn't compile with the Linux Static SDK (aka musl)
- [plugin] add option to compile with the Static Linux SDK instead of docker HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swift-aws-lambda-runtime.