- 新しい順
- 投票が多い順
- コメントが多い順
Hello.
I think it is possible to start EC2 when a URL is accessed by using API Gateway and Lambda.
I think the code provided in the blog below will be helpful for starting EC2.
https://repost.aws/knowledge-center/start-stop-lambda-eventbridge
It is possible to automate the execution of ssm_document by creating an EventBridge and Lambda that react to EC2 launch events.
I think the settings in the following document will be helpful for EC2 startup detection.
https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-log-ec2-instance-state.html
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-instance-state-changes.html
Finally, I think it is possible to switch by creating a Lambda that rewrites the A record of "https://example.com" to the EC2 IP after ssm_document execution is complete.