Trigger S3 create event

后端 未结 3 1583
半阙折子戏
半阙折子戏 2021-02-12 17:45

I use S3 Create events to trigger AWS-Lambdas. If my processing fails I want to do some magic and then trigger the \"event\" again to start my processing ones more. So far the o

3条回答
  •  野性不改
    2021-02-12 18:21

    I came across a similar situation today where I needed to re-trigger a Lamda function after the file was already in S3. A co-worker of mine came up with the following that worked for us:

    1. Install the AWS cli tool
    2. Execute something like so:

      aws lambda invoke
          --function-name 
          --payload '{
              "Records":[{
                  "s3":{
                      "bucket":{
                          "name":""
                      },
                      "object":{
                          "key": ""
                      }
                  }
              }]
          }' outfile
      

提交回复
热议问题