All Projects → swift-sprinter → aws-serverless-swift-api-template

swift-sprinter / aws-serverless-swift-api-template

Licence: Apache-2.0 license
A Serverless REST API template, implemented in Swift with swift-aws-lambda-runtime.

Programming Languages

HTML
75241 projects
swift
15916 projects
Makefile
30231 projects

Projects that are alternatives of or similar to aws-serverless-swift-api-template

aws-secure-websockets
Secure web socket implementation using AWS products and serverless framework
Stars: ✭ 49 (+16.67%)
Mutual labels:  aws-apigateway, serverless-framework, aws-dynamodb
telegram-stepfunctions-bot
Serverless Telegram bot made on 4 AWS Lambda chained by AWS Step Functions. All of this written on Serverless Framework using plugins.
Stars: ✭ 26 (-38.1%)
Mutual labels:  serverless-framework, aws-dynamodb
desktop
A native GUI application that makes it easy to explore and test Serverless Framework applications built on AWS Lambda.
Stars: ✭ 42 (+0%)
Mutual labels:  serverless-framework, aws-dynamodb
serverless-swagger-api
Simplifies the process of generating an API Gateway API from a swagger file.
Stars: ✭ 15 (-64.29%)
Mutual labels:  aws-apigateway, serverless-framework
Architect
The simplest, most powerful way to build serverless applications
Stars: ✭ 1,925 (+4483.33%)
Mutual labels:  aws-apigateway, aws-dynamodb
Dracker
An iOS and React App to track debt and send/receive payments.
Stars: ✭ 22 (-47.62%)
Mutual labels:  aws-apigateway, aws-dynamodb
Serverless
⚡ Serverless Framework – Build web, mobile and IoT applications with serverless architectures using AWS Lambda, Azure Functions, Google CloudFunctions & more! –
Stars: ✭ 41,584 (+98909.52%)
Mutual labels:  serverless-framework, aws-dynamodb
hyper-kube-config
H Y P E R K U B E - A Serverless API and kubectl plugin providing a storage and retrieval Kubernetes cluster credentials. Hyperkube leverages AWS Secrets Manager for storing credential information.
Stars: ✭ 27 (-35.71%)
Mutual labels:  aws-apigateway, serverless-framework
Chalice
Python Serverless Microframework for AWS
Stars: ✭ 8,513 (+20169.05%)
Mutual labels:  aws-apigateway, serverless-framework
Serverless Sam
Serverless framework plugin to export AWS SAM templates for a service
Stars: ✭ 143 (+240.48%)
Mutual labels:  aws-apigateway, serverless-framework
Aws Lambda Typescript
This sample uses the Serverless Application Framework to implement an AWS Lambda function in TypeScript, deploy it via CloudFormation, publish it through API Gateway to a custom domain registered on Route53, and document it with Swagger.
Stars: ✭ 228 (+442.86%)
Mutual labels:  aws-apigateway, serverless-framework
cloudwatch-public-metrics
Expose AWS Cloudwatch Metrics as a public HTML page using AWS Lambda and server-side rendering
Stars: ✭ 27 (-35.71%)
Mutual labels:  serverless-framework
a-crash-course-on-serverless-with-nodejs
A quick and easy guide of how to hook up a single Serverless service.
Stars: ✭ 28 (-33.33%)
Mutual labels:  serverless-framework
serverless-modular
⚡️ serverless plugin for microservice code management and deployment.
Stars: ✭ 19 (-54.76%)
Mutual labels:  serverless-framework
fastapi-mangum-example
Deploy FastAPI as Lambda using serverless and mangum
Stars: ✭ 21 (-50%)
Mutual labels:  serverless-framework
serverless-typescript-starter
A Serverless starter that adds TypeScript, serverless-offline, linting, environment variables, and unit test support.
Stars: ✭ 75 (+78.57%)
Mutual labels:  serverless-framework
DynamodbToCSV4j
Dump DynamoDB data into a CSV file using java
Stars: ✭ 18 (-57.14%)
Mutual labels:  aws-dynamodb
serverless-create-global-dynamodb-table
serverless plugin that would create global dynamodb tables for specified tables
Stars: ✭ 25 (-40.48%)
Mutual labels:  aws-dynamodb
serverless-authorizers
Examples to use aws API Gateway authorizer feature to authorize your endpoints with different ways
Stars: ✭ 31 (-26.19%)
Mutual labels:  serverless-framework
tencent-cam-policy
Easily create an Tencent CAM Policy with Serverless Components
Stars: ✭ 20 (-52.38%)
Mutual labels:  serverless-framework

AWS Serverless Swift API Template

Swift 5.3 docker amazonlinux2

This package demostrates how to write a Scalable REST API with the Serverless stack by using only Swift as development language.

Product API Example

The example shows how to build a Rest API based on a Product swift class.

public struct Product: Codable {
    public let sku: String
    public let name: String
    public let description: String
    public var createdAt: String?
    public var updatedAt: String?
}

API Definition

The API implements the following schema:

- /Product
    -> GET - List Products
    -> POST - Create Products
    -> PUT - Update Products
- /Product/{sku}
    -> DELETE - Delete Product
    -> GET - Get Product

More details of the API are described in swagger.json.

The file can be imported in popular tool such as PostMan.

Be sure to update the "host": "<BASE_URL>" with the url provided during the deployment.

The full swagger-doc.html has been generated using pretty-swag

Serverless architecture

The architecture is based on the classical AWS Serverless stack: APIGateway, Lambda and DynamoDB.

  • APIGateway: acts as a proxy for the Lambda and exposing it to the internet.
  • Lambda: is the computational layer.
  • DynamoDB: is the AWS NoSQL database

Advantages:

  • Pay per use
  • No fixed costs
  • Auto-Scaling
  • DevOps

REST API Application

The application uses swift-aws-lambda-runtime as AWS Custom Lambda Runtime and acts as a presentation layer of the DynamoDB content providing a REST API.

The following frameworks are used:

Requirements

git clone https://github.com/swift-sprinter/aws-serverless-swift-api-template.git
cd aws-serverless-swift-api-template
  • Ensure you can run make:
make --version

the Makefile was developed with this version:

GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i386-apple-darwin11.3.0

Build

Use the following command to build the code before using the serverless commands:

./build.sh

Deploy

Deploy the full solution to your AWS using Serverless:

./deploy.sh

After the deployment is completed, the URL of the website is provided by the Serverless framework.

Update

Rebuild the code and update the Lambda to your AWS using Serverless:

./update.sh

Remove

To remove the deployment use:

serverless remove

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].