AWS opensearch is AWS’s version of elasticserch. For faster development and easy interaction with AWS opensearch service, here is how one can configure the domain to use master user name and password,
and get public access.
To create an OpenSearch Service domain using the console:
Go to https://aws.amazon.com and choose Sign In to the Console.
Under Analytics, choose Amazon OpenSearch Service.Choose Create domain.
Provide a name for the domain.
For the domain creation method, choose Standard create.
3.
To quickly configure a production domain with best practices, you can choose Easy create. For the development and testing purposes of this tutorial, we’ll use Standard create.
For templates, choose Dev/test.
For the deployment option, choose Domain with standby.
For Version, choose the latest version.
For now, ignore the Data nodes, Warm and cold data storage, Dedicated master nodes, Snapshot configuration, and Custom endpoint sections.
For simplicity in this tutorial, use a public access domain. Under Network, choose Public access.
In the
fine-grained access control
settings, keep the Enable fine-grained access control check box selected.
Select Createmaster user
and provide a username andpassword
.For now, ignore the SAML authentication and Amazon Cognito authentication sections.
For
Access policy
, chooseOnly use fine-grained access control
. In this tutorial, fine-grained access control handles authentication, not the domain access policy.
Ignore the rest of the settings and choose Create. New domains typically take 15–30 minutes to initialize, but can take longer depending on the configuration. After your domain initializes, select it to open its configuration pane. Note the domain endpoint under General information (for example, https://search-my-domain.us-east-1.es.amazonaws.com), which you’ll use in the next step.
If you get error by clicking the dashboard or later when requesting in Python, some error like this:
User: anonymous is not authorized to perform: es:ESHttpGet with an explicit deny in a resource-based policy |
Double check step 11, make sure you are choosing the Only use fine-grained access control
.
how to index one record in Python
Need to replace domain_endpint and user name and passwords with your domain.
import requests |
how to index bulk texts in Python
import requests |
how to query texts in python
import requests |