awswrangler.opensearch.connect¶
- awswrangler.opensearch.connect(host: str, port: Optional[int] = 443, boto3_session: Optional[Session] = None, region: Optional[str] = None, username: Optional[str] = None, password: Optional[str] = None) OpenSearch ¶
Create a secure connection to the specified Amazon OpenSearch domain.
Note
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.
- Parameters
host (str) – Amazon OpenSearch domain, for example: my-test-domain.us-east-1.es.amazonaws.com.
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.
- Returns
OpenSearch low-level client. https://github.com/opensearch-project/opensearch-py/blob/main/opensearchpy/client/__init__.py
- Return type
opensearchpy.OpenSearch