AWS: How to trigger email notification on S3 events via Lambda function

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 ส.ค. 2024

ความคิดเห็น • 69

  • @fidgetspinner343
    @fidgetspinner343 5 ปีที่แล้ว +3

    Loving the AWS Lambda tutorials, more please!!

  • @vmalj89
    @vmalj89 3 ปีที่แล้ว +1

    This is quick and a great tutorial. Loved it. May be next time if you can show the JSON structure that you are parsing in the for loop, it will help us to understand better.

    • @SrceCde
      @SrceCde  3 ปีที่แล้ว

      Thanks, will do!

  • @himansusekharmishra5114
    @himansusekharmishra5114 2 ปีที่แล้ว

    Hi, Thank you for this beautiful video. I have setup everything to trigger lambda from s3 event unfortunately while updating/deleting any files the lambda function is not triggering. I have a given full access to lambda function.

  • @shamstabrez2986
    @shamstabrez2986 2 ปีที่แล้ว

    events kahan se aya records q h kuch smjh mein aya nhi r na hi apne smjhya ur aim should be while making this kind of videos to explain everything we learner r not in rush we have time soo next time when u make any videos plz elaborate everysteps else there will be only personn who understand ur content its only u

  • @ashishnigam1323
    @ashishnigam1323 5 ปีที่แล้ว +1

    Good playlist buddy, keep going

    • @SrceCde
      @SrceCde  5 ปีที่แล้ว

      I'm glad that you found it useful. Please like, share and subscribe :)

  • @teenakochu6450
    @teenakochu6450 3 ปีที่แล้ว

    Thank you soo much for this video..I was searching for this

    • @SrceCde
      @SrceCde  3 ปีที่แล้ว

      Most welcome 😊. Please like, share & subscribe. :)

  • @abhinavbaruah
    @abhinavbaruah 2 ปีที่แล้ว

    Can we check if a file in S3 bucket exists and send mail if the file does not exist

  • @nitish145145
    @nitish145145 4 ปีที่แล้ว

    Great tutorial man

  • @Lily-ed2sc
    @Lily-ed2sc 2 ปีที่แล้ว

    your video helps, thank you

    • @SrceCde
      @SrceCde  2 ปีที่แล้ว +1

      Glad to hear that! Please like, share & subscribe :)

  • @kajalkuchekar5293
    @kajalkuchekar5293 ปีที่แล้ว

    please provide the code
    as its giving error

  • @UUVtQD
    @UUVtQD 4 ปีที่แล้ว

    Great tutorial, thanks a lot!

    • @SrceCde
      @SrceCde  4 ปีที่แล้ว +1

      Thanks for stopping by Sergiy Kotenko. I am glad that you found the tutorial helpful. Please like, share & subscribe. :)

  • @globalizemeuk
    @globalizemeuk 3 ปีที่แล้ว

    Excellent work Sir, helped me out of a real pickle! Have liked and subscribed and will check out more of your videos. Lovely stuff. Do you do freelance work?

    • @SrceCde
      @SrceCde  3 ปีที่แล้ว +1

      Thanks for the sub! No, I am not doing freelancing yet. :)

  • @pravinkumbhar7464
    @pravinkumbhar7464 4 ปีที่แล้ว

    great tutorial

    • @SrceCde
      @SrceCde  4 ปีที่แล้ว

      Thanks for stopping by Pravin Kumbhar. I am glad that you found the tutorial helpful. Please like, share & subscribe. :)

  • @mansishere2212
    @mansishere2212 3 ปีที่แล้ว

    Thanks for this video
    I have created a function as mentioned in video and followed all steps
    I got logs without error on s3 event
    But, I didn't received any mail
    Is there any configurations that need to do?

  • @tuan.minh_vu
    @tuan.minh_vu 4 ปีที่แล้ว

    Is it possible to do the verify step automatically likes using I get request to call a lambda function?

  • @pramodthombare7304
    @pramodthombare7304 5 ปีที่แล้ว +1

    gettting syntax error for line---> message = {"Subject": {"Data": subject}, "Body": {"Html": {"Data": body}}}

  • @sambathnarayananparthasara8621
    @sambathnarayananparthasara8621 2 ปีที่แล้ว

    Good job. Thanks. Suppose some object is added to S3. I configure event notification as mentioned nicely by you. What code I have to write to send the added file as an attachment. Not only I get alert but also what caused that alert

    • @SrceCde
      @SrceCde  2 ปีที่แล้ว

      Thanks for stopping by Sambath Narayanan Parthasarathy! Here is the tutorial video on the same: th-cam.com/video/SNc9qjLrSmM/w-d-xo.html
      I hope this helps. Please like, share & subscribe :)

  • @glennadams7047
    @glennadams7047 4 ปีที่แล้ว

    Good one!

  • @KristianCevallos
    @KristianCevallos 4 ปีที่แล้ว

    Hello, can you help me with a question, a system places a file on the S3 upon user request, as I make the download to an EC2 automatic when uploading files to the S3.
    I was planning to use S3 events and an Api rest

  • @arvindrajendran9753
    @arvindrajendran9753 5 ปีที่แล้ว

    Great video!
    Thank you, Srce Cde.

    • @SrceCde
      @SrceCde  5 ปีที่แล้ว

      I'm glad that you found it useful. :)

    • @arvindrajendran9753
      @arvindrajendran9753 5 ปีที่แล้ว

      Hi @@SrceCde, I want to be notified only once when I upload multiple files at the same time. How do I get that in Lambda?
      Thanks much!

    • @SrceCde
      @SrceCde  5 ปีที่แล้ว +1

      One of the ways to achieve this is via SNS. Instead of setting a trigger on S3 event, you can set the lambda trigger via SNS Topic.
      Now, you need to add a script to call SNS Topic after the script/function that is responsible for uploading files. And with minor modification in Lambda function code, you can achieve this.
      Hope this helps and let me know if you require further help.

    • @arvindrajendran9753
      @arvindrajendran9753 5 ปีที่แล้ว

      @@SrceCde Thank you will work on it!

    • @arvindrajendran9753
      @arvindrajendran9753 5 ปีที่แล้ว

      I find it difficult. First should I set the lambda with SNS? Any related video would be much appreciatable.

  • @ericjohnston8403
    @ericjohnston8403 3 ปีที่แล้ว

    Please Help! I can't figure out why I am getting this error.
    'SourceIPAdress': KeyError
    Traceback (most recent call last):
    File "/var/task/lambda_function.py", line 8, in lambda_handler
    ip = i["requestParameters"]["SourceIPAdress"]
    KeyError: 'SourceIPAdress'

    • @SrceCde
      @SrceCde  3 ปีที่แล้ว

      Thanks for stopping by Skskepper feral. I think it is a spelling mistake. It should be 'sourceIPAddress' instead of 'SourceIPAdress'. I hope this helps. Please like, share & subscribe. :)

  • @RupeshKumar-cs6qb
    @RupeshKumar-cs6qb 4 ปีที่แล้ว +1

    can you please provide the lambda function code?

    • @SrceCde
      @SrceCde  4 ปีที่แล้ว

      Thanks for stopping by Rupesh Kumar. The code is posted on mt GitHub: github.com/srcecde/aws-tutorial-code/blob/master/lambda/lambda_s3_event_ses_email.py
      I hope this helps. Please like, share & subscribe. :)

    • @ambars5747
      @ambars5747 4 ปีที่แล้ว

      Link is giving a 404 on GitHub. Could you please fix? You could also choose to just share a public GitHub gist for this simple function.

    • @michaelbehrens5143
      @michaelbehrens5143 3 ปีที่แล้ว

      @@ambars5747 github.com/srcecde/aws-tutorial-code/blob/master/lambda/lambda_s3_event_ses_email.py

  • @SyedIbrahim007
    @SyedIbrahim007 3 ปีที่แล้ว

    Please reply can we has a setup where when a file is pushed into s3 can we get the same file via email??

    • @SrceCde
      @SrceCde  3 ปีที่แล้ว

      Thanks for stopping by Syed Ibrahim. I have already posted a tutorial on the same. Here is the link: th-cam.com/video/SNc9qjLrSmM/w-d-xo.html
      I hope this helps. Please like, share & subscribe. :)

  • @snarayanm4071
    @snarayanm4071 4 ปีที่แล้ว

    How to stop notifications when uploading multiple partitions of a file. I need only one email after loading all the partitions

    • @SrceCde
      @SrceCde  4 ปีที่แล้ว

      Thanks for stopping by snarayan M. In that case you need to edit your S3 trigger configuration within the lambda function. Within your S3 Trigger, go to "Event type" and set it to "Multipart upload completed". I hope this helps. Let me know if the issue persists. Please like, share & subscribe. :)

    • @snarayanm4071
      @snarayanm4071 4 ปีที่แล้ว +1

      @@SrceCde Thanks I will try

  • @shreerampattanayak4715
    @shreerampattanayak4715 3 ปีที่แล้ว

    Everything is working for me except e-mail notification. Please help

  • @KrishnaKumar-zl5pl
    @KrishnaKumar-zl5pl 5 ปีที่แล้ว

    when I do any event like upload or delete a email was triggered but problem is I have received 3 email for one event , don't know could please help me

    • @SrceCde
      @SrceCde  5 ปีที่แล้ว

      Thanks for stopping by.
      I suspect that lambda has an error or maybe it's getting a timeout. And it's the default behavior of lambda to invoke itself thrice on error. At a high level, I would suggest you look at logs if there is an error. Also, If you can increase the timeout of the lambda function and try.
      Hope this helps. Let me know if this does not solve the issue. Happy to help.

  • @SuperDilip21
    @SuperDilip21 4 ปีที่แล้ว

    Hi: Could you please share the lambda function to list out all files under sub-directory of S3 bucket as per date and send an email if anything is older than 10 days.

  • @yashassai7586
    @yashassai7586 4 ปีที่แล้ว

    how to send a file in S3 bucket through email ?

    • @SrceCde
      @SrceCde  4 ปีที่แล้ว +1

      Thanks for stopping by yashas sai. I have posted the tutorial on the same: th-cam.com/video/SNc9qjLrSmM/w-d-xo.html
      I hope this helps. Please like, share & subscribe. :)

    • @yashassai7586
      @yashassai7586 4 ปีที่แล้ว +1

      Thankyou

  • @oscarmybaby5658
    @oscarmybaby5658 4 ปีที่แล้ว

    Hi: can I do the same process on CloudWatch logs event also ....if yes please tell the way.
    Thanks in advance.

    • @SrceCde
      @SrceCde  4 ปีที่แล้ว +1

      Thanks for stopping by Rajesh Singh. If I have understood your question correctly then yes you can. All you need to go to CloudWatch Management Console, click on "Rules" under "Event" from left panel and click on "Create rule". Now, go ahead and configure the event source and your email lambda function as target. I hope this helps. Let me know in case you have any further queries. Please like share & subscribe. :)

  • @rohankalgutkar9631
    @rohankalgutkar9631 4 ปีที่แล้ว

    Hello sir in ses email verification only the sender email should be verified right or even the receiver email?

    • @SrceCde
      @SrceCde  4 ปีที่แล้ว

      Thanks for stopping by Lazybuoy. Each identity needs to be verified which you use in "From", "Source", "Sender". I hope this helps. Please like, share & subscribe. :)

  • @aritrabiswas4746
    @aritrabiswas4746 5 ปีที่แล้ว

    Hi: this is awesome, the same structure - is it possible to send an email with the uploaded file to be attached (on put event).

    • @SrceCde
      @SrceCde  5 ปีที่แล้ว

      Thanks for stopping by. Sorry for the late response.
      Here is the tutorial on the same: th-cam.com/video/SNc9qjLrSmM/w-d-xo.html
      Hope that helps.

    • @aritrabiswas4746
      @aritrabiswas4746 5 ปีที่แล้ว

      Srce Cde Many Many Thanks: help me a lot. (in my case attachment is in different formats, so I just pass a variable
      "attached_file_name = "{}".format(object)
      attachment.add_header("Content-Disposition", "attachment", filename=attached_file_name)" : it's working fine
      but when i am using 'Prefix' and upload file the file name will look like :
      "ses-attachment-dir/fossil.txt" here Prefix is :ses-attachment-dir/ , help if possiable.

    • @SrceCde
      @SrceCde  5 ปีที่แล้ว

      You can use split function to exract the file name. You can replace "attached_file_name = "{}".format(object) with "attached_file_name = "{}".format(object.split("/")[1])
      Hope that helps.

    • @aritrabiswas4746
      @aritrabiswas4746 5 ปีที่แล้ว +1

      Srce Cde thanks a ton ... really helpful.

  • @monikapatil5325
    @monikapatil5325 5 ปีที่แล้ว

    I got keyerror in records ... Plz tell me solution

    • @SrceCde
      @SrceCde  5 ปีที่แล้ว

      Thanks for stopping by,
      A full traceback will help to understand the error. One of the problems I suspect that you might be running the lambda function manually and not via S3 bucket file drop trigger.

  • @vinayakharade9283
    @vinayakharade9283 5 ปีที่แล้ว

    please create function in node.js language.

    • @SrceCde
      @SrceCde  5 ปีที่แล้ว +1

      Thanks for stopping by Vinaya.
      I have noted down your request. I will work on it ASAP.
      In the meantime, please like, share and subscribe. :)