I'm trying to automate the creation of a self terminating AWS EC2 instance using AWS LAMBDA. Self-Terminating AWS EC2 Instance? posted sometime back was helpful to do it via console but I was wondering if this is possible with AWS LAMBDA.
To give some additional context, I'm trying to create a workflow like this:
- Get user registration through a unique link sent to them (A simple static intranet website) 
- POST the form details to AWS LAMBDA function and create an instance from a snapshot which will automatically terminate in say 12 hours 
- Send the user an email with the connection information (Possibly attaching a RDP file) 
The issue I face now is with the second point. I also need to cap the registrations to 10 per day.
PS: Any recommendations or advice on this workflow will be helpful too. (I understand the security issues but this is for intranet and will never be visible to the public)
 
     
     
     
     
    