Trigger glue workflow when specific file type is uploaded in the S3 bucket object

0

I am trying to create rule in eventbridge to trigger a workflow when a specific file format is upload in the desired object of s3 bucket.

{
  "source": ["aws.s3"],
  "detail-type": ["AWS API Call via CloudTrail"],
  "detail": {
    "eventSource": ["s3.amazonaws.com"],
    "eventName": ["PutObject"],
    "requestParameters": {
      "bucketName": ["my-bucket"],
      "key": [{
        "prefix": "folder1/folder2"
      }],
        "FileName": [ { "suffix": ".xlsx" } ]
    }
  }
}

I upload files say in s3://my-bucket/folder1/folder2/folder3/test.xlsx, glue workflow is not triggered. Can someone help me in this event pattern to trigger workflow for specific file type?

2개 답변
0

Have you also added a target to the rule - the above code defines what eventbridge should be looking for, not what to do with it.

There is a page in AWS documentation outlining the steps to add the target - https://docs.aws.amazon.com/glue/latest/dg/starting-workflow-eventbridge.html

profile picture
답변함 일 년 전
  • Thank you @simon hammer! Yes, I added a target in the workflow with event-bridge trigger.

0

Hi, if you look at the "suffix" example in https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-patterns.html it gives an example "FileName": [ { "suffix": ".png" } ] which checks if the field "FileName" in the event has the suffix ".png". I see you too have used "FileName" but does your event really have a field with this name? I haven't checked the S3 event definition but maybe you mean "key"?

전문가
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠