Cognito user pool - SoftupTechnologies/infrastructure-components GitHub Wiki

Path: /lib/cognito-user-pool/index.ts

Exports: UserPoolService

Required construct packages: @aws-cdk/aws-cognito

Creates a Amazon Cognito user pool. With a user pool, your users can sign in to your web or mobile app through Amazon Cognito. To make it customizable for your use case, modify the properties in the UserPoolService class.

Usage

import * as cdk from '@aws-cdk/core';
import { UserPoolService } from './cognito-user-pool';

export class ServerlessInfrastructureCdkStack extends cdk.Stack {
  constructor(scope: cdk.App, id: string, props: StackProps) {
    super(scope, id);

    const userPool = new UserPoolService(this, 'UserPool', {
      ...props,
    });
  }
}

Construct props

Name Type Required Default Description
projectName string true undefined Project name
clientName string true undefined Client name
clientAppUrls string true undefined Client App Callback and Logout Urls
facebookAppId string true undefined Facebook App Id
facebookAppSecret string true undefined Facebook App Secret
env Envs { dev, stage, prod } true undefined Environment

Properties

Name Type Description
userPoolName string Created user pool name.
userPoolId string Created user pool id.
userPool cognito.UserPool Created user pool instance.