将数据附加到 S3 对象 [英] Append data to an S3 object
问题描述
假设我有一台机器,我希望能够写入存储在 S3 存储桶上的某个日志文件.
Let's say that I have a machine that I want to be able to write to a certain log file stored on an S3 bucket.
因此,机器需要具有写入该存储桶的能力,但是,我不希望它能够覆盖或删除该存储桶中的任何文件(包括我希望它写入的文件).
So, the machine needs to have writing abilities to that bucket, but, I don't want it to have the ability to overwrite or delete any files in that bucket (including the one I want it to write to).
所以基本上,我希望我的机器能够只将数据附加到该日志文件中,而不会覆盖它或下载它.
So basically, I want my machine to be able to only append data to that log file, without overriding it or downloading it.
有没有办法将我的 S3 配置为这样工作?也许我可以附加一些 IAM 政策,以便它可以像我想要的那样工作?
Is there a way to configure my S3 to work like that? Maybe there's some IAM policy I can attach to it so it will work like I want?
推荐答案
很遗憾,您不能.
S3 没有追加"操作.* 一旦一个对象被上传,就无法修改它;您唯一的选择是上传一个新对象来替换它,这不符合您的要求.
S3 doesn't have an "append" operation.* Once an object has been uploaded, there is no way to modify it in place; your only option is to upload a new object to replace it, which doesn't meet your requirements.
*:是的,我知道这篇文章已经有几年了.尽管如此,它仍然是准确的.
*: Yes, I know this post is a couple of years old. It's still accurate, though.
这篇关于将数据附加到 S3 对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!