Under Analytics, choose Amazon OpenSearch Service.
Choose Create domain.
Provide a name for the domain.
Choose Standard create.
For templates, choose Dev/test.
For the deployment option, choose Domain with standby.
For Version, choose the latest version.
Ignore the Data nodes, Warm and cold data storage, Dedicated master nodes, Snapshot configuration, and Custom endpoint sections.
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 Create master user and provide a username and password.
Ignore the SAML authentication and Amazon Cognito authentication sections.
For Access policy, choose Only use fine-grained access control. In this tutorial, fine-grained access control handles authentication, not the domain access policy.
Keep rest all as defaults.
Click Create.
New domains typically take 15 to 30 minutes to initialize.
Copy the domain endpoint under General information.
USERNAME=master
PASSWORD=Master@123
DOMAINENDPOINT=https://search-movies-afndo3wvhhypa2f4abi7cidgqi.us-east-1.es.amazonaws.com
curl -XPUT -u "$USERNAME:$PASSWORD" \
"${DOMAINENDPOINT}/movies/_doc/1" \
-d '{"director": "Burton, Tim", "genre": ["Comedy","Sci-Fi"], "year": 1996, "actor": ["Jack Nicholson","Pierce Brosnan","Sarah Jessica Parker"], "title": "Mars Attacks!"}' \
-H 'Content-Type: application/json'
cat > data.json << EOF
{ "index" : { "_index": "movies", "_id" : "2" } }
{"director": "Frankenheimer, John", "genre": ["Drama", "Mystery", "Thriller", "Crime"], "year": 1962, "actor": ["Lansbury, Angela", "Sinatra, Frank", "Leigh, Janet", "Harvey, Laurence", "Silva, Henry", "Frees, Paul", "Gregory, James", "Bissell, Whit", "McGiver, John", "Parrish, Leslie", "Edwards, James", "Flowers, Bess", "Dhiegh, Khigh", "Payne, Julie", "Kleeb, Helen", "Gray, Joe", "Nalder, Reggie", "Stevens, Bert", "Masters, Michael", "Lowell, Tom"], "title": "The Manchurian Candidate"}
{ "index" : { "_index": "movies", "_id" : "3" } }
{"director": "Baird, Stuart", "genre": ["Action", "Crime", "Thriller"], "year": 1998, "actor": ["Downey Jr., Robert", "Jones, Tommy Lee", "Snipes, Wesley", "Pantoliano, Joe", "Jacob, Ir\u00e8ne", "Nelligan, Kate", "Roebuck, Daniel", "Malahide, Patrick", "Richardson, LaTanya", "Wood, Tom", "Kosik, Thomas", "Stellate, Nick", "Minkoff, Robert", "Brown, Spitfire", "Foster, Reese", "Spielbauer, Bruce", "Mukherji, Kevin", "Cray, Ed", "Fordham, David", "Jett, Charlie"], "title": "U.S. Marshals"}
{ "index" : { "_index": "movies", "_id" : "4" } }
{"director": "Ray, Nicholas", "genre": ["Drama", "Romance"], "year": 1955, "actor": ["Hopper, Dennis", "Wood, Natalie", "Dean, James", "Mineo, Sal", "Backus, Jim", "Platt, Edward", "Ray, Nicholas", "Hopper, William", "Allen, Corey", "Birch, Paul", "Hudson, Rochelle", "Doran, Ann", "Hicks, Chuck", "Leigh, Nelson", "Williams, Robert", "Wessel, Dick", "Bryar, Paul", "Sessions, Almira", "McMahon, David", "Peters Jr., House"], "title": "Rebel Without a Cause"}
EOF
curl -XPOST -u "$USERNAME:$PASSWORD" \
"${DOMAINENDPOINT}/_bulk" \
--data-binary @data.json \
-H 'Content-Type: application/json'
curl -XGET -u "$USERNAME:$PASSWORD" "${DOMAINENDPOINT}/movies/_search?q=mars&pretty=true"
https://search-movies-afndo3wvhhypa2f4abi7cidgqi.us-east-1.es.amazonaws.com/_dashboards/
Under Domains, select the movies domain.
Choose Delete and confirm deletion.