You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+52
Original file line number
Diff line number
Diff line change
@@ -137,6 +137,58 @@ print('\nDeleting index:')
137
137
print(response)
138
138
```
139
139
140
+
## Using IAM credentials for authentication
141
+
142
+
Refer the AWS documentation regarding usage of IAM credentials to sign requests to OpenSearch APIs - [Signing HTTP requests to Amazon OpenSearch Service.](https://docs.aws.amazon.com/opensearch-service/latest/developerguide/request-signing.html#request-signing-python)
143
+
144
+
Opensearch-py client library also provides an in-house IAM based authentication feature, `AWSV4SignerAuth` that will help users to connect to their opensearch clusters by making use of IAM roles.
145
+
146
+
#### Pre-requisites to use `AWSV4SignerAuth`
147
+
- Python version 3.6 or above,
148
+
- Install [botocore](https://pypi.org/project/botocore/) using pip
149
+
150
+
`pip install botocore`
151
+
152
+
Here is the sample code that uses `AWSV4SignerAuth` -
153
+
154
+
```python
155
+
from opensearchpy import OpenSearch, RequestsHttpConnection, AWSV4SignerAuth
156
+
import boto3
157
+
158
+
host =''# cluster endpoint, for example: my-test-domain.us-east-1.es.amazonaws.com
0 commit comments