Append data to an S3 object

前端 未结 6 1015
长情又很酷
长情又很酷 2020-12-05 01:34

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 tha

6条回答
  •  情深已故
    2020-12-05 02:11

    As the accepted answer states, you can't. The best solution I'm aware of is to use:

    AWS Kinesis Firehose

    https://aws.amazon.com/kinesis/firehose/

    Their code sample looks complicated but yours can be really simple. You keep performing PUT (or BATCH PUT) operations onto a Kinesis Firehose delivery stream in your application (using the AWS SDK), and you configure the Kinesis Firehose delivery stream to send your streamed data to an AWS S3 bucket of your choice (in the AWS Kinesis Firehose console).

    It's still not as convenient as >> from the Linux command line, because once you've created a file on S3 you again have to deal with downloading, appending, and uploading the new file but you only have to do it once per batch of lines rather than for every line of data so you don't need to worry about huge charges because of the volume of append operations. Maybe it can be done but I can't see how to do it from the console.

提交回复
热议问题