I have versioning enabled in my bucket, and when I update only metadata of a s3 object using CopyObjectRequest S3 create me a new version of the file with the new metadata, but I don't want this. How can I just edit metadata without creating a new version and without disabling versioning ?
I am using S3 Java 2 sdk
CopyObjectRequest request = CopyObjectRequest.builder()
.sourceBucket("myBucketName")
.sourceKey("myObjectKey")
.destinationBucket("myBucketName")
.destinationKey("myObjectKey")
.metadata(newMetadata)
.metadataDirective(MetadataDirective.REPLACE)
.build();