2

After setting the EventBridge, S3 put object event still cannot trigger the StepFuction.

However, I tried to change the event rule to EC2 status. It's working !!!

I also try to change the rule to S3 all event, but it still not working.

Amazon EventBridge:

Event pattern:

     { 
      "source": ["aws.s3"],
      "detail-type": ["AWS API Call via CloudTrail"],
      "detail": {
                 "eventSource": ["s3.amazonaws.com"],
                 "eventName": ["PutObject"],
                 "requestParameters": {
                 "bucketName": ["MY_BUCKETNAME"]
                 }
     }

Target(s):

  Type:Step Functions state machine
    ARN:arn:aws:states:us-east-1:xxxxxxx:stateMachine:MY_FUNCTION_NAME

Reference:https://docs.aws.amazon.com/step-functions/latest/dg/tutorial-cloudwatch-events-s3.html

shimo
  • 2,156
  • 4
  • 17
  • 21
Kcwan
  • 21
  • 1
  • 2
  • Did you enable CloudTrial for S3 events? Did you verify that the S3 events are detected by the CT? – Marcin Aug 03 '21 at 03:30
  • @Marcin Yes, I follow the reference and create the CloudTrial for S3 events. However, it still cannot trigger the stepfunction – Kcwan Aug 03 '21 at 06:59

1 Answers1

3

Your step function isn't being triggered because the PutObject events aren't being published to cloudtrail. S3 operations are classified as data events so you must enable Data events when creating your cloudTrail. The tutorial says next next and create which seems to suggest no additional options need to be selected. By default, Data Events on the next step (step 2 - Choose log events - as of this writing) is not checked. You have to check it and fill up the bottom part to specify if all buckets/events are to be logged.

Rafiq
  • 51
  • 2