Creating the Lambda and API Gateway for User Registration

After we create our code for user registration, it is time to create a Lambda function and configure it to use with API Gateway. As a first step, let's create a new Lambda function in our CloudFormation template:

"UserRegistrationLambda": { 
  "Type": "AWS::Lambda::Function", 
  "Properties": { 
    "Handler": "com.serverlessbook.lambda.userregistration.Handler", 
    "Runtime": "java8", 
    "Timeout": "300", 
    "MemorySize": "1024", 
    "Description": "User registration Lambda", 
    "Role": { 
      "Fn::GetAtt": [ 
        "LambdaExecutionRole", 
        "Arn" 
      ] 
    }, 
    "Code": { 
     "S3Bucket": { 
       "Ref": "DeploymentBucket" 
      }, 
      "S3Key": { 
        "Fn::Sub": "artifacts/lambda- userregistration/${ProjectVersion}/${DeploymentTime}.jar" } }, "Environment": ...

Get Building Serverless Architectures 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.