Invoking create-user function

  1. Open the Functions section of Lambda console

  2. Click create-user function.

  3. Open the Test tab

  4. In the Test event section,

    • Event name: Fill in create-user-event

    • Event JSON: Replace the placeholder event with

      {
        "email": "nguyenvanan@gmail.com",
        "name": "Nguyen Van An"
      }
      
  5. Click Save

    alt text

  6. Click Test

  7. In the Execution functions banner, click Details.

    alt text

  8. You can check the response of the Lambda function and information about the execution of the Lambda function

    alt text

  9. Verify that a new user is created in DynamoDB table UsersTable

    • Open the Explore items page of the DynamoDB management console.
    • Select the UsersTable table
    • The Scan operation should be automatically run.
    • Verify that a new user is created (in other words, a new DynamoDB item is created.)

    alt text

  10. Invoke the create-user Lambda function in this step with different Event JSON to create some more users:

    {
      "email": "nguyenvanbinh@gmail.com",
      "name": "Nguyen Van Binh"
    }
    
    {
      "email": "nguyenvancanh@gmail.com",
      "name": "Nguyen Van Canh"
    }
    
    {
      "email": "nguyenvandong@gmail.com",
      "name": "Nguyen Van Dong"
    }
    
    {
      "email": "nguyenvanem@gmail.com",
      "name": "Nguyen Van Em"
    }
    
  11. After invoking the create-user Lambda function with these 4 events, you should have 5 users.

    • Open the Explore items page of the DynamoDB management console.

    • Select the UsersTable table

    • Click Refresh button

    • Verify that there are 5 items in the DynamoDB table.

      alt text