aws-amplify / amplify-cli

The AWS Amplify CLI is a toolchain for simplifying serverless web and mobile development.
Apache License 2.0
2.82k stars 821 forks source link

RFC: Amplify CLI Swift Lambda runtime support #10818

Open ammarkarachi opened 4 years ago

ammarkarachi commented 4 years ago

Problem:

iOS developers don’t have a native development experience for functions today. While we serve Android customers (Java), Web customers (JS) and a variety of other customers (Python, Go, .Net Core), iOS developers have yet the ability to author functions in a language that they are most immediately familiar with.

Proposed solution:

AWS Lambda recently added support for the Swift runtime (5.2). To enable a great experience for iOS developers, the Amplify CLI’s add function workflow will allow iOS developers to pick Swift as their preferred function runtime.

Developer experience:

amplify add function

❯ amplify-dev add function
? Provide a friendly name for your resource to be used as a label for this categ
ory in the project: layersdemo66def23d
? Provide the AWS Lambda function name: layersdemo66def23d
? Choose the runtime that you want to use: (Use arrow keys)
.NET Core 3.1
Go
Java
NodeJS
❯ Swift
Python
> Only one template found - using Hello World by default.
? Do you want to access other resources in this project from your Lambda function? (Y/n)
....

Customers can choose the “Swift” runtime during amplify add function. Amplify CLI will create a “Hello World” project for the customer and in its final step, open the .swift file let the customer edit the function.

amplify mock function <function-name>

Customer can mock Swift functions locally when the Swift runtime is available.

Useful resources

kneekey23 commented 4 years ago

Would be great if the CLI also added the appropriate bash script and docker file with the precreated image to the solution in addition to just the swift file to get started. I have these files for reference if need be.

renebrandel commented 4 years ago

We should also make sure we handle dependencies like existence of docker & swift etc. These dependencies should be documented here: https://docs.amplify.aws/cli/function#supported-lambda-runtimes

3a4oT commented 3 years ago

Would love to see this happen. 💯

tomhirschfeld commented 3 years ago

Can we focus on making amplify usable instead of adding more runtimes and options? Very basic things are extremely broken like lambda layers, or codegen for the graphql API. Every time I see an RFC for a large new thing like this I laugh and feel like a dupe for using amplify. My team wastes so much time just trying to get the basics working, please focus on the basics!

eneko commented 3 years ago

Please, add this functionality. This could be very helpful for lots of iOS developers, helping them to familiarize with AWS Lambda.

dave-moser commented 3 years ago

This would be a great add, particularly with the recent launch of the AWS SDK for Swift.

jtouzy commented 1 year ago

A big part of this is implemented in https://github.com/aws-amplify/amplify-cli/pull/5280 Why it has been closed like that? Any further details? As many says, Swift integration to Amplify would be extremely powerful.