How to do it...

  1. Create the project from the following template:
$ sls create --template-url https://github.com/danteinc/js-cloud-native-cookbook/tree/master/ch7/synthetics --path cncb-synthetics
  1. Navigate to the cncb-synthetics directory cd cncb-synthetics.
  2. Install the dependencies with npm install.
  3. Review the file named src/App.js and update the clientId and domain fields with the values for the user pool stack.
  4. Build the app with npm run build.
  5. Deploy the stack:
Deploying a CloudFront distribution can take upward of 20 minutes.
$ npm run dp:lcl -- -s $MY_STAGE> cncb-synthetics@1.0.0 dp:lcl <path-to-your-workspace>/cncb-synthetics> sls deploy -r us-east-1 --account cncb "-s" "john"...WebsiteDistributionURL: https://dqvo8ga8z7ao3.cloudfront.net ...

Get JavaScript Cloud Native Development Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.