Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
OpenSearch 2.11
Describe the issue:
I am trying IAM role based authentication to opensearch server using opensearchpy python library. This gives me this error. (I am using the basic authentication steps as in one of the opensearch doc). Please advice on what I am doing wrong.
opensearchpy.exceptions.AuthorizationException: AuthorizationException(403, '{"message":"The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.\\n\\nThe Canonical String for this request should have been\\n\'GET\\n/\\n\\nhost:localhost
Configuration:
credentials = boto3.Session().get_credentials()
auth = AWSV4SignerAuth(credentials, region)
client = OpenSearch(
hosts = [{'host': 'localhost', 'port': 9300}],
http_auth = auth,
#http_auth=(userName, password),
http_compress=True,
use_ssl = True,
verify_certs = False,
connection_class=RequestsHttpConnection,
)
info = client.info()
print(f"{info['version']['distribution']}: {info['version']['number']}")
Relevant Logs or Screenshots: