Skip to content

aws-user-group-cuneo/serverless-101

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AWS User Group - Cuneo

Serverless 101

Simple Serverless example project to show Lambda/API Gateway/DynamoDB in action.

Requirements

Getting Start

1 - Clone this repository

git clone git@github.com:aws-user-group-cuneo/serverless-101.git

2 - Install NPM dependencies

npm install

3 - Configure AWS CLI access

aws configure

Additional you can create a specific profile for this project:

aws configure --profile awsug-serverless-101

4 - Configure project

You need to change the frontend bucket name to not collide with other users. Do this change into serverless.yml file:

custom:
  frontend: 
    bucket: ${self:service}-${self:provider.stage}-<my name or something random> #change this with a different name
    dir: './frontend'
    cacheControl: '0'
    deploy: sync

5 - Deploy backend services

npm run deploy

6 - Configure frontend

Change the API endpoint inside frontend/index.html inside script tag;

var ENDPOINT = 'https://xxxxxxx.execute-api.eu-west-1.amazonaws.com/test'; // Change this with your endpoint

7 - Deploy frontend static website

npm run deploy:frontend

End

If you correctly complete all steps you'll see the static website on: http://your-bucket-name.s3-website-eu-west-1.amazonaws.com