aws

jcd 2025-07-09T20:18:42.456049Z

I would love to use the Cognitect aws-api to handle signing and sending HTTP REST requests to upload documents to an OpenSearch instance. The official opensearch package does not expose the Document upload endpoints. I believe what I need to do is define a proper service EDN that would define these operations, but I am having a little bit of trouble getting off the ground. Has anyone done this or something similar before?

scottbale 2025-07-09T20:40:05.010139Z

I'm not sure I understand. Are you wanting to do something apart from the operations of the official https://docs.opensearch.org/docs/latest/api-reference/?

jcd 2025-07-09T20:44:32.951089Z

I am trying to upload via the Document APIs. Our Opensearch instance is configured to require SigV4 signing. Maybe I am using the wrong opensearch package, but the Document APIs do not seem to be available ops.

scottbale 2025-07-09T20:53:13.237549Z

What cognitect artifacts (and versions) are you using? And what opensource operation(s) do you want to invoke? I'm looking to see if the latest version of com.cognitect.aws/opensearch has the latest operations.

jcd 2025-07-09T20:54:47.166179Z

I have these in my dep tree:

[com.cognitect.aws/opensearch "871.2.31.23"]
   [com.cognitect.aws/api "0.8.686"]
     [com.cognitect/http-client "1.0.125"]
   [com.cognitect.aws/endpoints "1.1.12.504"]
   [com.cognitect.aws/sqs "847.2.1398.0"]

scottbale 2025-07-09T20:58:37.365639Z

Hmm that version of com.cognitect.aws/endpoints is about two years old. The others look reasonably recent. https://github.com/cognitect-labs/aws-api/blob/main/latest-releases.edn

scottbale 2025-07-09T21:02:43.700579Z

You are using the latest version of com.cognitect.aws/opensearch, and it is up-to-date with the https://github.com/aws/aws-sdk-java-v2/blob/master/services/opensearch/src/main/resources/codegen-resources/service-2.json in the AWS Java SDK v2 repo.

jcd 2025-07-09T21:16:57.870969Z

I don't believe the operations outlined in the Java SDK descriptor cover the OpenSearch Document REST API. I was hoping to produce a custom service edn that would take a document or a series of documents, an index/domain, etc, and properly sign and dispatch them to the OpenSearch endpoints. If this is not a great idea, please let me know.

scottbale 2025-07-09T21:23:24.175509Z

> I don't believe the operations outlined in the Java SDK descriptor cover the OpenSearch Document REST API. Hmm, I see what you mean. > If this is not a great idea, please let me know. It might not be a great idea. Certainly it's not supported by aws-api. 🤔

jcd 2025-07-09T21:24:04.951389Z

Yea, I was going to manually do the signing and such... I just don't want to have to reinvent the wheel for when my creds need cycling, retrying requests, etc. (So was thinking of the custom service definition as an alternative.)

scottbale 2025-07-09T21:28:35.898709Z

I wish I had a happier answer. But yeah I think it would require a lot of hacking to get aws-api to invoke an operation at an endpoint that is not in one of the existing json service descriptors. I'm not sure it would work at all even with said hacking.

👍 1
jcd 2025-07-09T21:29:56.620429Z

All good. I'll either bite the bullet and implement the request signing with the Java SDK or use a better supported service to ingest via pipeline. I think Amazon does not want people ingesting via the Document APIs, and is trying to encourage pipeline ingestion.

jcd 2025-07-09T21:30:10.206209Z

Appreciate the help!

👍 1