Create OpenSearch Instance

  1. Open Amazon OpenSearch Service console

  2. Click Create domain

CreateOpenSearch

  1. Enter domain name: fcjdms
    • Selecting deployment type is Development and testing

CreateOpenSearch

  1. In Data nodes section:
    • Select 1 availability zone
    • Select t3.small.search for instance type
    • Enter 2 for number of nodes
    • Select General Purpose (SSD) - gp2 for EC2 volume type

CreateOpenSearch

  1. Expand the Dedicated master nodes section and check to Enbale dedicated master nodes
    • Selecting instance type is t3.small.search

CreateOpenSearch

  1. Select Public access for Network
    • Select Create master user
    • Enter username, password and confirm password

CreateOpenSearch

  1. In the Access policy section, select Only use fine-grained access control

CreateOpenSearch

  1. Scroll down to bottom and click Create

CreateOpenSearch

  1. Wait a few minutes for the domain to initialize

CreateOpenSearch

  1. Once the domain is ready, note down the domain endpoint and click the OpenSearch Dashboards URL.

CreateOpenSearch

  1. Open the AWS Lambda console. Select search_docs function
    • Select Configuration tab
    • Select Environment variables on the left menu
    • Click Edit

CreateOpenSearch

  1. Click Add environment variable
    • Enter SEARCH_DOMAIN for Key
    • Paste the OpenSearch domain endpoint to Value cell và delete https://
    • Click Save

CreateOpenSearch

  1. Repeat steps 11 and 12 for load_stream function
  2. Back to the OpenSearch Dashboards tab, and enter the user information you created. Then press Log in.

CreateOpenSearch

  1. Open the menu in the upper left corner and select Security

CreateOpenSearch

  1. Select Roles on the left menu.
    • Select all_access

CreateOpenSearch

  1. Select Mapped users tab and click Manage mapping.

CreateOpenSearch

  1. In the Backend roles section:
    • Enter the Role ARN of role that the search_docs is executing.
    • Click Add another backend role
    • Enter the Role ARN of the role that the load_stream function is executing.
    • Click Map

CreateOpenSearch

  1. You have completed map the Lambda role to a user of OpenSearch domain.

CreateOpenSearch