

# Creating a OpenSearch Service connection
<a name="creating-opensearch-connection"></a>

**Prerequisites**:
+ Identify the domain endpoint, {{aosEndpoint}} and port, {{aosPort}} you would like to read from, or create the resource by following instructions in the Amazon OpenSearch Service documentation. For more information on creating a domain, see [Creating and managing Amazon OpenSearch Service domains](https://docs.amazonaws.cn//opensearch-service/latest/developerguide/createupdatedomains.html) in the Amazon OpenSearch Service documentation.

  An Amazon OpenSearch Service domain endpoint will have the following default form, https://search-{{domainName}}-{{unstructuredIdContent}}.{{region}}.es.amazonaws.com. For more information on identifying your domain endpoint, see [Creating and managing Amazon OpenSearch Service domains](https://docs.amazonaws.cn//opensearch-service/latest/developerguide/createupdatedomains.html) in the Amazon OpenSearch Service documentation. 

  Identify or generate HTTP basic authentication credentials, {{aosUser}} and {{aosPassword}} for your domain.

**To configure a connection to OpenSearch Service:**

1. In Amazon Secrets Manager, create a secret using your OpenSearch Service credentials. To create a secret in Secrets Manager, follow the tutorial available in [ Create an Amazon Secrets Manager secret ](https://docs.amazonaws.cn//secretsmanager/latest/userguide/create_secret.html) in the Amazon Secrets Manager documentation. After creating the secret, keep the Secret name, {{secretName}} for the next step. 
   + When selecting **Key/value pairs**, create a pair for the key `USERNAME` with the value {{aosUser}}.
   + When selecting **Key/value pairs**, create a pair for the key `PASSWORD` with the value {{aosPassword}}.

1. In the Amazon Glue console, create a connection by following the steps in [Adding an Amazon Glue connection](console-connections.md). After creating the connection, keep the connection name, {{connectionName}}, for future use in Amazon Glue. 
   + When selecting a **Connection type**, select OpenSearch Service.
   + When selecting a Domain endpoint, provide {{aosEndpoint}}.
   + When selecting a port, provide {{aosPort}}.
   + When selecting an **Amazon Secret**, provide {{secretName}}.