awswrangler.opensearch.connect(host: str, port: Optional[int] = 443, boto3_session: Optional[boto3.session.Session] = Session(region_name=None), region: Optional[str] = None, username: Optional[str] = None, password: Optional[str] = None) opensearchpy.client.OpenSearch

Create a secure connection to the specified Amazon OpenSearch domain.


We use opensearch-py, an OpenSearch python client.

The username and password are mandatory if the OS Cluster uses Fine Grained Access Control. If fine grained access control is disabled, session access key and secret keys are used.

  • host (str) – Amazon OpenSearch domain, for example:

  • port (int) – OpenSearch Service only accepts connections over port 80 (HTTP) or 443 (HTTPS)

  • boto3_session (boto3.Session(), optional) – Boto3 Session. The default boto3 Session will be used if boto3_session receive None.

  • region – AWS region of the Amazon OS domain. If not provided will be extracted from boto3_session.

  • username – Fine-grained access control username. Mandatory if OS Cluster uses Fine Grained Access Control.

  • password – Fine-grained access control password. Mandatory if OS Cluster uses Fine Grained Access Control.


OpenSearch low-level client.

Return type