This lambda function just stop and start ec2 instances on aws.
Use lambda-function.json for grant lambda access to exec stop, start and describe on ec2 instances.
Tag your instances with tag-key: Shutdown and value wih: True
schedule your functions in cloudwatch rules, example: 50 10 ? * MON-FRI * - This execution will take place at 10:50 on weekdays. with this method your resources will shutdown on weekend.