1 回答
- 最新
- 投票最多
- 评论最多
-1
Hi,
You will need 2 components to achieve your goal:
- CDK to create a trigger on DynamoDb starting a Lambda: full corresponding typescript code at https://dev.to/aws-builders/how-to-trigger-an-aws-lambda-from-a-dynamodb-stream-event-d8
- The Lambda starting and stopping the EC2 instance: you have security settings, Lambda code here: https://repost.aws/knowledge-center/start-stop-lambda-eventbridge
So, please, combine both to build you use case.
Best,
Didier
相关内容
- AWS 官方已更新 2 年前
- AWS 官方已更新 1 年前
Hi, thanks for the reply. From my understanding about the second step, it starts an existing instance, not creates new one? Because it needs the 'instance-id', which I don't have before instance being created?
Hi, I thought that you may want to keep your instance across runs to be faster on start instead of terminating it each time. But, you can replace the start with create (with ad hoc paremeters: instance type, etc.) and the stop with terminate. You will find some sample code on the web easily