Send Email using SQS, Lambda and SES

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 ม.ค. 2025

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

  • @JosephSeeley-cb6pv
    @JosephSeeley-cb6pv 8 หลายเดือนก่อน +1

    Exactly what I needed Gaurav! Thanks so much for walking through this and providing sample code!!

  • @AndrewSu180
    @AndrewSu180 8 หลายเดือนก่อน +1

    Why not set it up to parse the to and from addresses from the MIME content itself?

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

    Great video.

  • @amitbajpai3431
    @amitbajpai3431 9 หลายเดือนก่อน +1

    Nice explanation

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

    Hey, this was very helpful. I was wondering if you could help me in identifying resources on how to send SQS msgs from code to SQS queue with all the dynamic parameters and not hardcoded.

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

      Yes, below is the code to use aws lambda to send messages to the sqs queue.
      import os
      import boto3
      def send_message_to_sqs(queue_url, message_body):
      sqs = boto3.client('sqs')
      response = sqs.send_message(
      QueueUrl=queue_url,
      MessageBody=message_body
      )
      return response
      def lambda_handler(event, context):
      try:
      queue_url = os.environ.get('SQS_QUEUE_URL')
      message_body = "Hello, SQS!"
      if queue_url:
      response = send_message_to_sqs(queue_url, message_body)
      return {
      'statusCode': 200,
      'body': f"Message sent successfully. Message ID: {response['MessageId']}"
      }
      else:
      return {
      'statusCode': 500,
      'body': "SQS_QUEUE_URL environment variable is not set."
      }
      except Exception as e:
      return {
      'statusCode': 500,
      'body': f"An error occurred: {str(e)}"
      }
      Instructions:
      Here's how you can set it up:
      Create a new AWS Lambda function using the AWS Management Console.
      Configure the function to use the appropriate runtime (Python).
      Set the necessary environment variables (SQS_QUEUE_URL) in the Lambda function's configuration.
      Paste the modified code into the Lambda function's code editor.
      Save and deploy the Lambda function.
      When the Lambda function is triggered, it will attempt to send a message to the specified SQS queue using the provided environment variables.
      Please note that you need to ensure that the IAM role associated with the Lambda function has the necessary permissions to send messages to the SQS queue and access any other AWS resources required by your use case.

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

      Thankyou so much. @@AWSTrainingByGauravAgrawal

  • @BipinSinghITSupport
    @BipinSinghITSupport 7 หลายเดือนก่อน

    this lambda code is not working.. Please help

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

    Hi Gaurav, As you mentioned, In Amazon SNS (Simple Notification Service/SES), the confirmation process for email subscriptions typically occurs only in sandbox and not in production environments. So if i deploy my code in producation environement there is no need of email subscription, as we can directly send an email to particular email?.
    2. How can i bypass email subscription process while i am implementing in my local?

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

      You cannot bypass email subscription in local and for production setup, subscription is not required

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

      @@AWSTrainingByGauravAgrawal Thank you Gaurav

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

      @@AWSTrainingByGauravAgrawal Hi Gaurav.. Though I am using the aws dev account of my organisation, it is still asking for verification

  • @AliAsgar-zy7wp
    @AliAsgar-zy7wp 8 หลายเดือนก่อน

    I dont know why i am not getting emails

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

    I didn't got the email

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

      Didn’t u got an email while setting up the email in SES ? Check your spam
      Folder also

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

      No I don't got I hav also check spam 😕​@@AWSTrainingByGauravAgrawal

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

      Please go through the video again then, mostly all of the associates have received the email.

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

      Yes vry helpful

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

      @@AWSTrainingByGauravAgrawal do u have any vdo of how to create an S3 bucket??