Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add example scripts and docs for Serverless Framework #113

Merged
merged 7 commits into from
Jun 12, 2020

Conversation

Andrea-Scuderi
Copy link
Contributor

Motivation

Add scripting examples to support the Serverless framework

Changes

Add the serverless templates for the LambdaFunction examples:

  • Add serverless folder with the Serverless templates
  • Add the deployment script: serverless-deploy.sh
  • Add the removal script: serverless-remove.sh
  • Update the README.md with the serverless instructions

@swift-server-bot
Copy link

Can one of the admins verify this patch?

3 similar comments
@swift-server-bot
Copy link

Can one of the admins verify this patch?

@swift-server-bot
Copy link

Can one of the admins verify this patch?

@swift-server-bot
Copy link

Can one of the admins verify this patch?

hello:
handler: HelloWorld
memorySize: 128
events:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

other templates above do not include http integration. intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it wasn't intentional. I'll remove it.

Copy link
Contributor Author

@Andrea-Scuderi Andrea-Scuderi Jun 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tomerd
Copy link
Contributor

tomerd commented Jun 6, 2020

thanks @Andrea-Scuderi I dont have much experience with serverless but on the surface looks great. couple of questions inline

cc @gibbster @tachyonics @fabianfett that may have more experience with serverless

@tomerd
Copy link
Contributor

tomerd commented Jun 6, 2020

@swift-server-bot test this please

@tomerd
Copy link
Contributor

tomerd commented Jun 6, 2020

thanks @Andrea-Scuderi can you also rebase (sorry the UI won't let me)

@tomerd
Copy link
Contributor

tomerd commented Jun 7, 2020

cc @davedelong

@@ -85,3 +85,86 @@ The SAM template will provide an output labelled `LambdaApiGatewayEndpoint` whic
***Warning:*** This SAM template is only intended as a sample and creates a publicly accessible HTTP endpoint.

For all other samples use the AWS Lambda console.

### Deployment instructions using AWS Serverless Framework

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AWS Serverless Framework sounds like "serverless" is a official tool provided by AWS. But that would be SAM.

I recommend changing this to something else that makes it clear that this is about serverless.com

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jenslauterbach
Copy link

This PR might be a good time to also re-think the Examples folder structure. If this PR would be merged it would more or less mix the SAM and serverless example files. If someone else creates a similar PR for another tool (maybe Terraform or whatever), then we would have more and more examples mixed together in the same folder.

Maybe switch to:

Examples/
    SAM/
    serverless/
    ...

This way all of those tools could have their own README.md and it would be clearer which tool the example is for.

WDYT?

@tomerd
Copy link
Contributor

tomerd commented Jun 7, 2020

@swift-server-bot test this please

@Andrea-Scuderi
Copy link
Contributor Author

@jenslauterbach Note that the swift examples are the same.
This PR just add a different way to deploy them.

The serverless folder contains the yml files for the serverless templates, while the scripts are in the scripts folder. I could move the SAM templates in a similar folder. We could also move the template folders under the folder scripts.

Examples/
    -> scripts/
         -> serverless
         -> SAM        

@tomerd Not sure if this is out of scope for this PR. Do we plan to reorganise the folder in this PR?

@tomerd
Copy link
Contributor

tomerd commented Jun 8, 2020

@Andrea-Scuderi @jenslauterbach agreed this may be a good opportunity to reorganize the scripts so if not too much trouble let do that

- Move scripts to Examples
- Add a common config.sh script
- Move SAM templates to Examples/scripts/SAM
- Move Serverless templates to Examples/scripts/serverless
- Update the scripts to work with new folder structure and config.sh
- Move Dockerfile to Examples
@Andrea-Scuderi
Copy link
Contributor Author

@tomerd
I refactored the scripts folder with the goal to be independent from the LambdaFunctions folder.
In this way we can have multiple folder under Examples in the future.

  • Move scripts to Examples
  • Add a common config.sh script to get the user choice
  • Move SAM templates to Examples/scripts/SAM
  • Move Serverless templates to Examples/scripts/serverless
  • Update the scripts to work with new folder structure and config.sh
  • Move Dockerfile to Examples

Copy link
Contributor

@tomerd tomerd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Andrea-Scuderi these changes look great with one exception: there are two separate examples currently under the "Examples" directory and they have their own deployment setup. To prevent confusion and mixing them up, let keep the scope of changes to the "LambdaFunctions" directory and assume the scripts run from "Examples/LambdaFunctions" instead of from "Examples"

@Andrea-Scuderi
Copy link
Contributor Author

@tomerd
Moved back the scripts folder under LambdaFunctions

14ef7fe

@tomerd
Copy link
Contributor

tomerd commented Jun 12, 2020

@swift-server-bot test this please

@tomerd
Copy link
Contributor

tomerd commented Jun 12, 2020

@swift-server-bot test this please

@tomerd tomerd merged commit c683b41 into swift-server:master Jun 12, 2020
@tomerd
Copy link
Contributor

tomerd commented Jun 12, 2020

thanks @Andrea-Scuderi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants