简体   繁体   English

如何使用python访问S3存储桶中的新添加文件

[英]How to access newly added file in S3 bucket using python

I am new to aws I access files in S3 using python I need to access newly added files in the bucket. 我是AWS新手,我使用python访问S3中的文件,我需要访问存储桶中新添加的文件。 Instead of accessing every data present in the bucket. 而不是访问存储桶中存在的每个数据。 Can anyone help me to reslove this issue?. 谁能帮助我解决这个问题? Thank you 谢谢

Take a look at S3 event notifications . 看一下S3 事件通知 You can have all new files be sent to an SQS queue and have your python program read from the queue to get new files. 您可以将所有新文件发送到SQS队列,并从队列中读取python程序以获取新文件。 There is not a way to query S3 for new files. 无法查询S3中的新文件。 Or if you could create a lambda function to operate on new files as well depending on what you need to do with new files. 或者,是否可以创建lambda函数来对新文件进行操作,具体取决于您需要对新文件执行的操作。

You can create a lambda with your business logic in python and finally you create an event in s3: 您可以在python中使用业务逻辑创建一个lambda,最后在s3中创建一个事件:

  1. Enter S3 bucket 输入S3存储桶
  2. Select "Properties" tab 选择“属性”标签
  3. Advance settign section -> Events 提前定居部分->活动

在此处输入图片说明

  1. New Event: 新事件:

在此处输入图片说明

Important: You must have the lambda created. 重要提示:您必须创建lambda。

Diagram: 图解:

在此处输入图片说明

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

相关问题 如何解决从另一个帐户添加到 s3 存储桶的文件的 s3 访问被拒绝? - How to solve s3 access denied on file added to s3 bucket from another account? 如何使用s3存储桶URL安全访问应用程序中的文件 - How to securely access a file in the application using s3 bucket URL 有没有办法监控只读 s3 存储桶并复制新添加的数据? - Is there a way to monitor readonly s3 bucket and copy newly added data? 如何在不使用 Pandas 的情况下从 s3 存储桶获取 excel 文件并将文件再次上传到 s3 存储桶 - Python - How to get an excel file from s3 bucket and upload the file again to s3 bucket without using pandas - Python 如何将文件上传到 s3(使用 Python),其中 s3 存储桶名称的名称中有斜杠“/” - How to upload a file into s3 (using Python) where the s3 bucket name has a slash '/' in the name 使用 python 将文件上传到 s3 存储桶会导致访问被拒绝 - Upload files to s3 bucket using python gives Access Denied 如何从 Python 中的 S3 存储桶访问数据集? - How to access dataset from S3 bucket in Python? 如何使用这个奇怪的纯文本文件访问S3存储桶? - How to access S3 bucket with this strange plain text file? 如何使用 CDK Python 通过 lambda 访问跨区域 s3 存储桶 - How to access cross region s3 bucket by lambda using CDK Python 如何从Lambda函数访问S3存储桶中的文件 - How to access file in S3 bucket from lambda function
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM