Skip to content

yaasita/serverless-application

Ā 
Ā 

Repository files navigation

Serverless Application

CircleCI

This is a serverless application using AWS SAM.

Prerequisite

  • pyenv
  • aws-cli
  • docker
  • direnv

Installation

git clone https://github.com/AlisProject/serverless-application.git
cd serverless-application
pyenv install

# libraries
python -m venv venv
. venv/bin/activate
pip install -r requirements.txt
pip install -r requirements_test.txt

Environment valuables

# Create .envrc to suit your environment.
cp -pr .envrc.sample .envrc
vi .envrc # edit

# allow
direnv allow

Test

# lunch docker for localstackļ¼ˆfor MAC OSļ¼‰
TMPDIR=/private$TMPDIR docker-compose up -d

# exec
python exec_test.py

Set SSM valuables

You have to specify SSM valuables as can as possible.

Deployment via AWS Cloud Formation

Create S3 bucket

aws s3api create-bucket --bucket ${ALIS_APP_ID}-serverless-deploy-bucket \
  --create-bucket-configuration LocationConstraint=$AWS_DEFAULT_REGION

Packaging and deployment

Packaging

./packaging.sh

DynamoDB

./deploy.sh database

# Show all tables.
aws dynamodb list-tables |grep ${ALIS_APP_ID}database |sort |tr -d ' '

And add all of generated table names to SSM.

Cognito

./deploy.sh cognito

Specify generated Cognito User Pool ARN to SSM.

Lambda & API Gateway

./deploy.sh api

About

šŸ¤ ALIS Media - Serverless Application

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.4%
  • Other 0.6%