- Newest
- Most votes
- Most comments
Hello.
As you can see, Lambda can be used for such use cases.
For example, you can trigger a Lambda when an image is uploaded to S3.
https://docs.aws.amazon.com/lambda/latest/dg/with-s3-example.html
If you want to do it without using Lambda, I think it is better to use SQS CloudWatch metrics and configure it to start automatically with EC2 AutoScaling.
Trigger SQS and accumulate a queue when images are uploaded to S3.
I think if you set it to scale according to the number of queues, you will be able to start processing when necessary.
https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-using-sqs-queue.html
https://dev.to/aws-builders/auto-scale-ec2-using-sqs-306e
Hey, this works for starting and stopping the EC2 instances using Lambda function. https://repost.aws/knowledge-center/start-stop-lambda-eventbridge
In the lambda trigger section go with S3 trigger rather than eventbridge as per your requirement. https://docs.aws.amazon.com/lambda/latest/dg/with-s3-example.html
Thank you for the tip. I'll try it.
Relevant content
- asked 7 days ago
- asked 21 days ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
Thank you for the tip. I am thinking to use lambda function as I already took an online course to learn how to deploy web app with lambda. I am wondering how can I start and stop an EC2 instance with lambda when a new image is uploaded by user.