Skip to content

serverless-barcelona/serverless-workshop-2

Repository files navigation

Serverless Workshop 1

Serverless Barcelona Meetup

This PoC is part of the Serverless Workshop organized by the Serverless Barcelona Meetup. It's implemented with the Serverless Framework and not intended for production environments and the purpose of this workshop is to explain how to deploy a typical use case adopting the serverless services that AWS offers.

What it contains

  • A serverless stack deployable in a AWS account
  • A Bitbucket pipeline to deploy the stack

Stack details

Workshop

The stack will deploy:

  • A website bucket where to store static HTML and JS.
  • An Api-Gateway endpoint with two path (/private-api /open-api )
  • A Cognito User Pool where to create users and to use with the Api-Gateway Authorizer to protect the api calls that arrive to the /private-api
  • A Lambda which responds to the /open-api path
  • A Lambda which responds to the /private-api

How to deploy through Bitbucket pipeline

  • Clone this repo to a private repository in your Bitbucket account
  • Enable the pipeline in your bitbucket repository: Bitbucket
  • Configure the repository variables: Bitbucket
  • Change the service name in the serverless.yml file (fill it with another one, ie: serverless-workshop-YOUR_AWS_ACCOUNTID)
  • Push the changes to the master branch to trigger the pipeline and deploy the stack

How to try the stack

  • Open the website bucket Url in your browser (you can find it in the pipeline output or in the Cloudformation stack output) Bitbucket
  • Try to click on the CALL AUTHENTICATED button, you will receive a 401 response (Unauthorized)
  • Register a new user with a valid email address
  • Confirm the registration by inserting the code that you will receive by mail
  • Sign in
  • Try the CALL AUTHENTICATED button again, you will receive a message like that: Bitbucket

Notes

You have to follow the previous steps in the exact order, if something goes wrong and you want to recreate the user with the same email, you must go to the Cognito User Pool console --> Users and Groups, and disable/delete the user. We know, the UX is not the best one, but the PoC is built to start with the serverless framework, Cognito, Api-Gateway, Authorizer and Lambda.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published