We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Congnito를 통해 회원가입이 완료되면 이벤트를 발생시켜 DynamoDB에 User 정보를 저장한다.
유저가 회원가입을 한 후 이메일 인증을 하면 Cognito의 PostConfrimation 트리거가 동작한다.
람다 함수에서 해당 이벤트를 받아 이벤트로부터 User 정보를 받아와서 DynamoDB에 저장한다.
성공 / 실패 여부를 context 를 통해 전달한다.
람다 함수 생성
'use strict'; const uuid = require('uuid'); const AWS = require('aws-sdk'); AWS.config.setPromisesDependency(require('bluebird')); const dynamoDb = new AWS.DynamoDB.DocumentClient(); // Cognito Post Confirmation Event를 받은 후 DynamoDB에 User 정보 저장 module.exports.registerUserToDynamoDB = async (event, context, callback) => { const user_info = { TableName: process.env.USER_TABLE, Item: { userId: uuid.v4(), email: event.request.userAttributes.email, nickname: event.request.userAttributes.nickname } }; try { const res = await dynamoDb.put(user_info).promise(); if (res) { // Send successful message context.succeed(event); } } catch (error) { // Send error message context.fail(err); } }; **2.** **serverless.yml 파일에 환경 설정** resources: Resources: CognitoUserPoolLunchSquad: Type: 'AWS::Cognito::UserPool' RegisterUserToDynamoDB: handler: api/users.registerUserToDynamoDB description: Register user in DynamoDB after recieve cognito post confirmation event events: - cognitoUserPool: pool: LunchSquad trigger: PostConfirmation
3. Cognito에서 람다 함수를 PostConfirmation 트리거로 설정
The text was updated successfully, but these errors were encountered:
sonypark
No branches or pull requests
목표
Congnito를 통해 회원가입이 완료되면 이벤트를 발생시켜 DynamoDB에 User 정보를 저장한다.
프로세스
유저가 회원가입을 한 후 이메일 인증을 하면 Cognito의 PostConfrimation 트리거가 동작한다.
람다 함수에서 해당 이벤트를 받아 이벤트로부터 User 정보를 받아와서 DynamoDB에 저장한다.
성공 / 실패 여부를 context 를 통해 전달한다.
람다 함수 생성
3. Cognito에서 람다 함수를 PostConfirmation 트리거로 설정
참고 링크
The text was updated successfully, but these errors were encountered: