如何配置AWS SQS,以在队列大小大于0时启动Spot EC2。

huangapple go评论63阅读模式
英文:

How can i configure aws sqs to launch a spot ec2 when the queue size is greater than 0

问题

我是新手AWS服务。我正在创建一个视频流平台,所以每当用户上传视频时,从S3事件向SQS添加一条消息,现在我需要在队列大小大于零时启动一个Spot EC2实例。有人可以帮我实现这个吗?

英文:

I am new to aws services . i am creating a video streaming platform so whenever a user uploads a video a message is added to sqs from s3 event now i have to launch a spot ec2 when the queue size is greater than zero . Can anyone help me for implementing this .

答案1

得分: 2

SQS不会启动EC2实例。SQS只是存储消息。您需要配置一个EC2自动扩展组来启动实例。自动扩展组将需要使用CloudWatch指标来确定何时启动实例。您可以为此提供来自您的SQS队列的指标,可能是ApproximateNumberOfMessagesVisible

英文:

SQS doesn't launch EC2 instances. SQS just stores messages. You need to configure an EC2 AutoScaling Group to launch the instances. The AutoScaling group will require a CloudWatch metric to use, to determine when it should launch the instances. You would provide a metric from your SQS queue for that, probably ApproximateNumberOfMessagesVisible.

huangapple
  • 本文由 发表于 2023年6月15日 01:07:56
  • 转载请务必保留本文链接:https://go.coder-hub.com/76476010.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定