- Newest
- Most votes
- Most comments
Hello.
Lambda can be executed when an object is created in S3 by using the settings described in the following document.
https://docs.aws.amazon.com/lambda/latest/dg/with-s3-example.html
It is also a good idea to tag processed objects.
Tag the object once processing is complete using "put_object_tagging" as described in the following documentation.
Since the tags are not set on objects for which processing has not been completed, it is recommended that a judgment be made as to whether the tags have been set or not, using if statements or other means.
Alternatively, moving the files to a different folder when the process is complete would be a good response.
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3/client/put_object_tagging.html
Relevant content
- asked 7 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
Thanks Riku. Appreciate your help. What about the dynamic date arguments in the s3 prefix ?
Lambda is executed when an object is created in the folder "s3://mybucket/hostData/yyyyy/mm/dd/hh/mm". When the Lambda is executed, the message is passed to the Lambda handler as an "event". The message contains S3 folder information. The sample code shows that the object key is obtained by "key = urllib.parse.unquote_plus(event['Records'][0]['s3']['object']['key'], encoding='utf-8')".
Thanks a lot Riku. I am able to invoke the API via Lambda.