- Newest
- Most votes
- Most comments
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.
Relevant content
- asked 2 years ago
- Accepted Answerasked 8 months ago
- Accepted Answerasked 7 months ago
- asked 7 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 7 months ago