Is there a way to not change an S3 object's Last-Modified date when copying it to a new bucket?

0

I'm trying to copy existing S3 objects to another S3 bucket. As far as I know, there are two ways to do that at scale: S3 Batch Operations and Replication. According to AWS documentation, both solutions support copying object metadata in addition to the object itself.

However, when I tried copying the S3 objects using S3 Batch Operations, the Last-Modified metadata was updated to the timestamp when each object was copied. The objects themselves and the rest of their original metadata was copied over to the new S3 bucket without being changed.

Is there a way to copy an S3 object's original Last-Modified metadata when using S3 Batch Operations or Replication without it being changed?

AWS
질문됨 4년 전4283회 조회
2개 답변
0
수락된 답변

System-defined object metadata, which includes an S3 object's Last-Modified date, can be modified by Amazon S3 only.

To retain an S3 object's original Last-Modified date when it's copied, you can add user-defined metadata to the object. For more information, see Editing object metadata in the Amazon S3 console.

AWS
답변함 4년 전
0

In addition to the workaround, of using a new user-metadata field, you can also retain the last-modified date as system-defined object metadata when copying to another bucket via Replication. When objects are replicated from one bucket to anther, both source and destination have the same system-defined last-modified date.

Replicate objects while retaining metadata – You can use replication to make copies of your objects that retain all metadata, such as the original object creation times and version IDs. This capability is important if you must ensure that your replica is identical to the source object. https://docs.aws.amazon.com/AmazonS3/latest/userguide/replication.html#replication-scenario

This also applies to S3 Batch Replication which wasn't available when this question was first asked, but released in February 2022.

This is unique to S3 Replication, and not supported by other S3 Batch Operations, such as the Copy Object Operation.

profile pictureAWS
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠