Creating Cognito user pool with CloudFormation template

Various sections of the CloudFormation template correspond to the CLI commands that we saw in the previous section. The complete template YAML file is available in the code files:

  1. Start the template with the template format version and a description (optional):
---AWSTemplateFormatVersion: '2010-09-09'Description: 'My First Cognito User Pool'
  1. Start to define the user pool resource with the type, AWS::Cognito::UserPool:
Resources:  MyFirstUserPool:    Type: AWS::Cognito::UserPool
  1. Under Properties, first, define a Policies property with a PasswordPolicy, as follows:
Properties:  Policies:    PasswordPolicy:      MinimumLength: 8      RequireLowercase: true      RequireNumbers: true      RequireSymbols: true ...

Get Serverless Programming 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.