简体   繁体   English

如何使用 lambda javascript/node.js 将新的 s3 对象同步到其他 s3 帐户

[英]How to sync new s3 objects to other s3 account using lambda javascript/node.js

I'm using aws-sdk and lambda with javascript.我将 aws-sdk 和 lambda 与 javascript 一起使用。

using this listObjectV2 and copyObject, I'm able to copy the objects from the other account, but I think this s3.copyObject, copy ALL the objects including new objects.使用这个 listObjectV2 和 copyObject,我可以从另一个帐户复制对象,但我认为这个 s3.copyObject,复制所有对象,包括新对象。

I just want to copy/transfer file only for new and updated objects.我只想为新的和更新的对象复制/传输文件。 Its like the cli the aws sync.它就像 aws 同步的 cli。

If you need to copy just any ongoing changes, you can use S3 replication如果您只需要复制任何正在进行的更改,则可以使用S3 复制

Objects that existed before you set up replication aren't replicated automatically.设置复制之前存在的对象不会自动复制。 In other words, Amazon S3 doesn't replicate objects retroactively.换句话说,Amazon S3 不会追溯复制对象。

Here is an instruction how to setup the cross account replication 这是如何设置跨账户复制的说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM