Create Lambda function for Lightsail
Example of how to create a quick stop/start Lambda function for Lightsail in AWS
Add function name
Select runtime (in our case python)
Create the function
Add code to stop/start instance:
Code to STOP Lightsail Instance:
Code to START Lightsail Instance:
5. Go to Amazone EventBridge --> Events --> Rules --> Create Rule
6. Select Scheduled --> Next
7. Select CRON pattern --> Use 5 2 ? * 7 *
for Every Saturday at 2:05 GMT (Example) --> Next
8. On the Right side: Select tragets(s) --> AWS Service --> Lambda function --> Select Lambda Function Name
9. Click Next --> Review --> Next --> Finished
Resources:
Last updated