2개 답변
- 최신
- 최다 투표
- 가장 많은 댓글
0
S3 Event Notifications cannot trigger Fargate tasks.
Instead, an object creation event can be put to EventBridge, launching the Fargate task from EventBridge.
https://aws.amazon.com/jp/blogs/aws/new-use-amazon-s3-event-notifications-with-amazon-eventbridge/
https://docs.aws.amazon.com/AmazonS3/latest/userguide/EventBridge.html
답변함 2년 전
0
Unlike S3 and Lambda integration, you need to use CloudWatch EventRule to integrate S3 with Fargate.
- Create a CloudTrail with only S3 event selector
- Create an EventRule on the CloudTrail to trigger Fargate
- You can pass the bucket and object name to Fargate by environment variable via container override
관련 콘텐츠
- AWS 공식업데이트됨 일 년 전
@hayao-k : thanks . how to pass on the bucket/file information when we trigger the fargate task this way. i have tried s3 object notification with lambda and in lambda , i get the bucket and key info as such in my lambda handler code -> bucket = event['Records'][0]['s3']['bucket']['name']. how to get same information in my python fargate task code?
@clouduser See below for examples of Event message structures. https://docs.aws.amazon.com/AmazonS3/latest/userguide/ev-events.html#ev-events-list
Would it look something like this. bucket = event['detail']['bucket']['name'] key = event['detail']['object']['key']