opensearch-project / opensearch-project/data-prepper

Support object checksums in the S3 sink

Open
#4,146 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Java
Stars
374
Forks
354
Avg merge
3d 18h
Merged PRs (30d)
8

Description

Is your feature request related to a problem? Please describe.

S3 supports object checksums to verify the content sent to S3. With this, S3 will reject files that do not match the checksum. This can prevent invalid objects. Additionally, S3 Object Lock requires checksums.

Describe the solution you'd like

Provide a configuration to specify the checksums for objects uploaded.

New configuration: checksum
Valid values: crc32, crc32c, sha1, sha256

  sink:
    - s3:
        bucket: mybucket
        checksum: crc32
        compression: gzip
        object_key:
          path_prefix: logs/%{yyyy}/%{MM}/%{dd}/%{HH}/
        codec:
          ndjson:

Describe alternatives you've considered (Optional)

Data Prepper could support MD5 as well. We'd need to determine if the MD5 should be another option entirely or an additional entry in the list. This probably depends on whether the settings are mutually exclusive. Perhaps you can have both? However, just adding the current checksum should be sufficient.

Additional context

Current error when writing to S3 with object lock:

data-prepper  | software.amazon.awssdk.services.s3.model.S3Exception: Content-MD5 OR x-amz-checksum- HTTP header is required for Put Object requests with Object Lock parameters (Service: S3, Status Code: 400, Request ID: XYZ, Extended Request ID: XYZ)

https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock-managing.html#object-lock-put-object

https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/s3-checksums.html

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the S3 sink implementation and its configuration parsing and upload path. Verify how the checksum setting maps to the AWS SDK request, then add coverage for the supported values and confirm that completed uploads include the selected checksum.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, java
Domain
cloud
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.