使用 Amazon Web 界面,可以将 S3 对象从一个存储桶复制到另一个存储桶。
但是,粘贴的对象没有原始的元数据。如何同时粘贴元数据?
我猜 CLI 可以做到,但我不知道如何做到。
请注意,元数据必须与对象一起创建,以便在 S3 PUT 上触发的 lambda 函数中可用。
最佳答案
所以我想出了如何通过 CLI 做到这一点。
aws s3 cp s3://<source bucket>/<filename> s3://<destination bucket>
documentation状态--metadata-directive (string) Specifies whether the metadata is copied from the source object or replaced with metadata provided when copying S3 objects. ... Valid values are COPY and REPLACE. If this parameter is not specified, COPY will be used by default.
(我的重点。)
真的很容易。很奇怪,Web 界面不这样做。
关于amazon-web-services - AWS S3 复制/粘贴不复制元数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43219182/