Implementing an Elasticsearch Backed Search Microservice

1.5 hours
  • 3 Learning Objectives

About this Hands-on Lab

In this lab, we will create a Lambda function which will connect the provided web interface to an Elasticsearch domain to provide search functionality.

**Note:** This lab can have extended launch times (10 to 30 minutes).

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Investigate the Lab Environment

With the provided information, log in to the AWS web console and look around at the provided resources. You should find:

  • An Elasticsearch domain
  • A Franken_Search Lambda function
  • An S3 bucket containing the files for the Frankenwords site
  • An API Gateway configured to trigger the Franken_Search Lambda function
Update the Lambda Function

Update the Franken_Search function to forward an appropriately formatted query to the provided Elasticsearch domain and return a JSON string with the required information.

The JSON object, which is expected by the frontend site, should be structured as follows:

{
    "total_hits": integer,
    "chapter_count": integer,
    "total_score": float,
    "hits": [
        {
            "location": string,
            "score": float
        }
    ]
}
Test Frankenwords!

Test the Frankenwords site to ensure functionality, and learn how often words and phrases are used in Mary Shelley’s Frankenstein!

Additional Resources

The Frankenwords frontend web development team has completed their version 1.0 interface, which is intended to provide statistical information about the appearance of words and phrases in the novel Frankenstein by Mary Shelley. The backend team has stood up an Elasticsearch domain in Amazon Elasticsearch Service. It is your job to complete the connection between the two teams by writing a Lambda function which will forward search entries to the Elasticsearch domain as properly formatted queries, and return a appropriately formatted response.

You've been provided with the following login information for the Elasticsearch domain:

  • Username: cloud_user
  • Password: Strongpass1!

Lab Resources

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?