AWS Neptune bulk load endpoint results in 403 every time

I'm trying to bulk load data by hitting the neptune bulk load endpoint:

  private void upload(String source) throws URISyntaxException, IOException {
    String jsonReq = createJson("s3://" + source);
    InputStream inputStream = new ByteArrayInputStream(jsonReq.getBytes(StandardCharsets.UTF_8));

    Request<Void> req = new DefaultRequest<>("neptune-db");
    req.setEndpoint(new URI("https", null, HOST, 8182, "/loader", null, null));

    AWS4Signer signer = new AWS4Signer();
    signer.setOverrideDate(new Date());
    signer.sign(req, getCreds());

    httpClient.requestExecutionBuilder().request(req).errorResponseHandler(new ErrorResponseHandler()).execute();

I keep getting 403. The same request works in AWScurl and postman. What could be missing in this case? I can see the tokens getting pulled for the signing.

Read more here:

Content Attribution

This content was originally published by John at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: