有没有办法在 S3 存储桶上上传新文件时触发 Postgres 函数?

Is there a way to trigger a Postgres function whenever a new file is uploaded on S3 bucket?

我在 Postgres 上有一个函数可以从我的 AWS-S3 存储桶导入数据。 有没有办法在新文件上传到存储桶时触发该功能?

p.s。我的 Postgres 数据库是 运行 on AWS RDS

是的,您可以创建 AWS lambda 函数并在 s3 存储桶中添加事件以在对象上传到 s3 存储桶时触发 lambda 函数,然后从 aws lambda 函数调用该 postgres 函数。

按照教程了解更多信息 https://www.tutorialspoint.com/aws_lambda/aws_lambda_using_lambda_function_with_amazon_s3.htm