github.com/Foodji/aws-lambda-go@v1.20.2/events/README_Cognito_UserPools_PostConfirmation.md (about) 1 # Sample Function 2 3 The following is a sample Lambda function that receives Amazon Cognito User Pools post-confirmation event as an input and writes some of the record data to CloudWatch Logs. (Note that by default anything written to Console will be logged as CloudWatch Logs events.) 4 5 Please see instructions for setting up the Cognito triggers at https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html . 6 7 ```go 8 package main 9 10 import ( 11 "fmt" 12 13 "github.com/aws/aws-lambda-go/lambda" 14 "github.com/aws/aws-lambda-go/events" 15 ) 16 17 func handler(event events.CognitoEventUserPoolsPostConfirmation) (events.CognitoEventUserPoolsPostConfirmation, error) { 18 fmt.Printf("PostConfirmation for user: %s\n", event.UserName) 19 return event, nil 20 } 21 22 func main() { 23 lambda.Start(handler) 24 } 25 ```