swift-aws-lambda-runtime icon indicating copy to clipboard operation
swift-aws-lambda-runtime copied to clipboard

Plugin v2 proposal

Open sebsto opened this issue 11 months ago • 4 comments

A proposal for a new set of SwiftPM plugins to facilitate the scaffolding, build, archive, and deployment of Lambda functions.

This is a call for comments to finalize the design before starting an actual implementation

sebsto avatar Dec 25 '24 22:12 sebsto

What would be the output of the init plugin?

fabianfett avatar Mar 07 '25 06:03 fabianfett

At minimum, a main.swift file. for more complex scenario, such as streaming functions, a main.swift and a SAM template.yaml file for deployment.

The idea is to scaffold your project with just 4 commands. No copy paste required.

# Step 1: Create a new Swift executable package
swift package init --type executable --name MyLambda

# Step 2: Add the Swift AWS Lambda Runtime dependency
swift package add-dependency https://github.com/swift-server/swift-aws-lambda-runtime.git --branch main
swift package add-target-dependency AWSLambdaRuntime MyLambda --package swift-aws-lambda-runtime

# Step 3: Call the lambda-init plugin
swift package lambda-init

sebsto avatar Mar 07 '25 07:03 sebsto

I'm afraid the devil is in the details here. Can we write out what the expected output is?

fabianfett avatar Mar 07 '25 07:03 fabianfett

@fabianfett I updated the proposal doc based on community feedback and your questions. There is a change log at the top.

sebsto avatar Mar 13 '25 15:03 sebsto