Preparation

Before we get to the main content of this workshop, we need to reset the web application.

  1. Download the below source code
  1. Run the below commands
sam build
sam deploy --guided
  1. Enter the following content:
  • Stack Name []: fcj-book-store
  • AWS Region []: ap-southeast-1
  • Confirm changes before deploy [Y/n]: y
  • Allow SAM CLI IAM role creation [Y/n]: y
  • Disable rollback [y/N]: n
  • BooksList may not have authorization defined, Is this okay? [y/N]: y
  • BookCreate may not have authorization defined, Is this okay? [y/N]: y
  • BookDelete may not have authorization defined, Is this okay? [y/N]: y
  • Login may not have authorization defined, Is this okay? [y/N]: y
  • Register may not have authorization defined, Is this okay? [y/N]: y
  • ConfirmUser may not have authorization defined, Is this okay? [y/N]: y
  • Save arguments to configuration file [Y/n]: y
  1. Open AWS APIs Gateway console

  2. Click API Gateway REST API to Lambda

Preparation

  1. Click Stage on the left menu
  • Click staging
  • Record the InvokeURL

Preparation

  1. Run the below command to download the source code of FCJ-Serverless-Workshop to your device
git clone https://github.com/AWS-First-Cloud-Journey/FCJ-Serverless-Workshop.git
  1. Run the below commands to build project
cd FCJ-Serverless-Workshop
yarn build
  1. We have finished building the front-end. Next, run the below command to upload build folder to S3 bucket
aws s3 cp build s3://fcj-book-store --recursive

So we have rebuilt the web application.