Add a deploy SwiftPM plugin and a Swift-based DSL to the Swift runtime for AWS Lambda

Hello Swift Community,

I'm Esraa Eid, and I'll be working on the Add a deploy SwiftPM plugin and a Swift-based DSL to the Swift runtime for AWS Lambda project as part of GSoC 2024, with @sebsto as my mentor.

I want to initiate a discussion about the project idea and would love to hear your input and feedback. Please feel free to share your thoughts with me. Just a heads-up, this is my first post here and I'm still getting the hang of things. If I don't quite fit in or make any mistakes, please bear with me and pardon any mistakes! :nerd_face:

Overview:

Deploying AWS Lambda functions using AWS SAM (Serverless Application Model) currently requires manual creation of a deployment descriptor. This poses challenges for Swift developers, as it involves learning a new DSL and adopting new tools like SAM CLI and Docker. To simplify this process, the community proposed a Swift-based DSL and a Swift package plugin. However, these solutions rely heavily on accurately mimicking the evolving SAM AWS deployment descriptor.


Goal:

The goal of this project is to automatically generate the AWSLambdaDeploymentDescriptor library based on the SAM template definition. This generated code will be used by the Swift-based DSL to create SAM YAML templates required to deploy Lambda functions and their dependencies to AWS.


Deliverables:

  1. Automated Swift Data Structure Generator
  2. Enhanced DSL for SAM Template Definition
  3. Enhanced Coverage and Support for SAM Resources/Properties
  4. Integration with SwiftPM Plugin

Proposed Modifications:

  1. Automated Swift Data Structure Generator:
  • Conduct a detailed analysis of the SAM schema definition.
  • Develop a component capable of parsing the JSON SAM template definition and generating Swift Codable data structures.
  • Implement unit tests to ensure correct parsing of the JSON SAM template.
  1. Enhanced DSL for SAM Template Definition:
  • Modify the existing DSL to seamlessly integrate with the generated Swift data structures.
  • Develop integration tests to validate the DSL's functionality in generating SAM YAML templates accurately.
  1. Enhanced Coverage and Support for SAM Resources/Properties:
  • Extend the DSL syntax to include SAM template output sections.
  • Implement a mechanism to include generic CloudFormation text within the SAM template defined using the DSL.
  1. Integration with SwiftPM Plugin:
  • Integrate the automated Swift data structure generator and adjusted DSL into the existing SwiftPM plugin architecture.
  • Enable easy usage within Swift projects for Lambda function deployments.
  • Add unit tests to validate the complete workflow of using the SwiftPM plugin with the automated data structure generator and adapted DSL.

For additional details, feel free to explore the GSoC proposal on Google Docs.

Looking forward to your feedback and suggestions! :sparkles:

8 Likes

Great proposal! This will help lower the barrier to using Swift on Server even further.

Looking forward to seeing first results.

Wish you a great time working on this project. :grinning:

2 Likes