All Projects → bsdkurt → aws-node-custom-user-pool

bsdkurt / aws-node-custom-user-pool

Licence: MIT license
Serverless AWS Cognito Custom User Pool Example

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to aws-node-custom-user-pool

lambda-smush-py
Gain additional code space via cheeky compression for Python AWS Lambda functions defined in-line to CloudFormation templates.
Stars: ✭ 17 (+13.33%)
Mutual labels:  lambda, cloudformation
Serverless Domain Manager
Serverless plugin for managing custom domains with API Gateways.
Stars: ✭ 783 (+5120%)
Mutual labels:  lambda, cloudformation
Auto Tag
Automatically tag AWS resources on creation, for cost assignment
Stars: ✭ 322 (+2046.67%)
Mutual labels:  lambda, cloudformation
SecretsManagerwithCloudFormation
Implements a Lambda-backed CloudFormation Custom Resource for AWS Secrets Manager
Stars: ✭ 20 (+33.33%)
Mutual labels:  lambda, cloudformation
Aws Iot Certificate Vending Machine
The CVM allows a device to apply for its own certificate and installation.
Stars: ✭ 64 (+326.67%)
Mutual labels:  lambda, cloudformation
CloudWatch2S3
Logging infrastructure for exporting all CloudWatch logs from multiple accounts to a single S3 bucket
Stars: ✭ 31 (+106.67%)
Mutual labels:  lambda, cloudformation
Dawson Cli
A serverless web framework for Node.js on AWS (CloudFormation, CloudFront, API Gateway, Lambda)
Stars: ✭ 721 (+4706.67%)
Mutual labels:  lambda, cloudformation
Cloudformation templates
AWS - CloudFormation Templates
Stars: ✭ 505 (+3266.67%)
Mutual labels:  lambda, cloudformation
go-localstack
Go Wrapper for using localstack
Stars: ✭ 56 (+273.33%)
Mutual labels:  lambda, cloudformation
Serverless Application
🍤 ALIS Media - Serverless Application
Stars: ✭ 52 (+246.67%)
Mutual labels:  lambda, cloudformation
cim
CIM takes the pain out of Infrastructure as Code and CloudFormation
Stars: ✭ 51 (+240%)
Mutual labels:  lambda, cloudformation
Lambstatus
[Maintenance mode] Serverless Status Page System
Stars: ✭ 1,323 (+8720%)
Mutual labels:  lambda, cloudformation
aws-maven-plugin
Deploys resources to AWS using maven
Stars: ✭ 25 (+66.67%)
Mutual labels:  lambda, cloudformation
cfn-encrypt
🔑🔐☁️ Cloudformation custom resource that enables creation of KMS encrypted strings and SSM secure parameters
Stars: ✭ 13 (-13.33%)
Mutual labels:  lambda, cloudformation
aws-cloudformation-cognito-identity-pool
A Lambda-backed Custom Resource for a Cognito Identity Pool in CloudFormation
Stars: ✭ 35 (+133.33%)
Mutual labels:  lambda, cloudformation
Aws Toolkit Vscode
AWS Toolkit for Visual Studio Code, an extension for working with AWS services including AWS Lambda.
Stars: ✭ 823 (+5386.67%)
Mutual labels:  lambda, cloudformation
Awesome Aws
A curated list of awesome Amazon Web Services (AWS) libraries, open source repos, guides, blogs, and other resources. Featuring the Fiery Meter of AWSome.
Stars: ✭ 9,895 (+65866.67%)
Mutual labels:  lambda, cloudformation
Hands-On-Serverless-Applications-with-Go
Hands-On Serverless Applications with Go, published by Packt.
Stars: ✭ 92 (+513.33%)
Mutual labels:  lambda, cloudformation
shelvery-aws-backups
Automating EBS RDS EC2 backups on lambda
Stars: ✭ 31 (+106.67%)
Mutual labels:  lambda
lambdakiq
ActiveJob on SQS & Lambda
Stars: ✭ 131 (+773.33%)
Mutual labels:  lambda

Serverless AWS Cognito Custom User Pool Example

This example demonstrates how to create an AWS Cognito custom user pool.

serverless License: MIT

Use-cases

As of October 2017 AWS Cloud Formation does not directly support creating Cognito user pools with UsernameAttributes or VerificationMessageTemplate. The UsernameAttributes setting may not be changed after creation. In order to create a user pool with the UsernameAttributes set, a custom resource type must be used which calls a lambda that uses the AWS api to create the pool for you. When AWS fixes these issues this will become obsolete, however it still serves as an example of how to implement a custom resource type backed by a lambda.

Prerequisites

You will need serverless and aws-cli installed and configured.

How to Install

serverless install -u https://github.com/bsdkurt/aws-node-custom-user-pool
cd aws-node-custom-user-pool
serverless deploy

How to Test

The service includes a lambda that is configured to run as a post confirmation trigger when a new user is confirmed by Cognito. To test everything is working as expected create and confirm a user in Cognito via the aws-cli. First you will need the User Pool Id and the Pool App Client Id.

export UserPoolId=$(aws cloudformation describe-stacks --stack-name custom-user-pool-dev | grep -A 1 UserPoolId | tail -1 | cut -d'"' -f 4)
export UserPoolClientId=$(aws cloudformation describe-stacks --stack-name custom-user-pool-dev | grep -A 1 UserPoolClientId | tail -1 | cut -d'"' -f 4)

Then create and confirm a user. Note, please change the email address below to your email address.

aws cognito-idp sign-up --region us-east-2 --client-id ${UserPoolClientId} --username [email protected] --password Passw0rd! --user-attributes Name="name",Value="Your Name"
aws cognito-idp admin-confirm-sign-up --region us-east-2  --user-pool-id ${UserPoolId} --username [email protected]

The postConfirmation lambda will have executed when the user was confirmed. To verify it executed go to the AWS web console and navigate to the CloudWatch Logs for the lambda at /aws/lambda/custom-user-pool-dev-postConfirmation. There should be a log message similar to:

2017-09-28T13:29:18.504Z ExaMple0-a451-11e7-91f3-edc45b79707c User confirmed: User-Pool us-east-2_ExaMple00, UserId: ExAmplE0-53a5-45df-b480-96b1bb6b0b51

How to Remove

serverless remove
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].