Amazon OpenSearch Service: AWS SDK 3 supported on OpenSearch 7.1? Receiving Forbidden Error

0

We are currently working on upgrading AWS SDK version from 2 to 3, and during the process we have encountered the issue where NodeHttpHandler fails to Authenticate the HTTPRequest, SignedV4 Request and throws the Forbidden 403 error.

We use Amazon OpenSearch Service 7.1, and AWS SDK 3 version, are they supported versions? Where can I find the relevant documentation ?

Also, any idea about the 403 Forbidden error would help, thanks!

code used: let request = new HttpRequest({ method: method, protocol: 'https', hostname: endPoint, port: 443, path: requestPath, query: '', headers: { host: endPoint, 'Content-Type': 'application/json', }, body: body, }); let response ={};
try { const accessKey= me.env[ ${prefix}_ACCESS_KEY_ID] const secretAcess=me.env[${prefix}_SECRET_ACCESS_KEY] let credentialsFromPreix={ accessKeyId: accessKey, secretAccessKey: secretAcess } const signer = new SignatureV4({ credentials: credentialsFromPreix, region: region, service: 'es', sha256: Sha256,
}); const signedRequest = await signer.sign(request); const client = new NodeHttpHandler(); const { response } = await client.handle(signedRequestChanged);

Error Received: 2023-11-06T15:54:02.943Z 8fe69aca-365a-4458-b040-3addde260e0b INFO esresponse Data:HttpResponse { statusCode: 403, reason: 'Forbidden', headers: { date: 'Mon, 06 Nov 2023 15:54:02 GMT', 'content-type': 'application/json', 'content-length': '861', connection: 'keep-alive', 'x-amzn-requestid': '2368ab7a-57be-448d-adcf-a6ce24483b45', 'access-control-allow-origin': '*' },

1 Answer
0

Hi there,

Thank you for posting the question and the detailed explanation. To answer your question and understand the use-case better, a screen-share session would be needed and will require details that are non-public information. Can you please open a support case with AWS using the following link and we will be happy to help you.

Thank you!

AWS
SUPPORT ENGINEER
answered 7 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions