Skip to main content

AWS - Cloud Watcher Schedule for AWS lambda

Step 1:

Move to Cloud Watcher console of aws.
1) Click on Rules Menu.
2) Click on Schedule option once moved to rules menu
3) Give Crontab schedule expression, In my case, Instance should be stopped by 2AM everyday.
4) Click on 'Add Target' in the right side.
4a) Once dropdown appears, select Lambda Function. 
4b) Function dropdown, select your lambda function, i.e. ecStopStart
5) Finally click on, configure details.



6) Cron Expression hours and day will work upon the timezone. It is with GMT. I have updated it to +5hrs 30mins UTC.


7) In the configuration details page, provide name, description and enable the the configuration.


8) Thats it.


Source : aws-console ec2 instance stop & start with cloud watch

Comments

Popular posts from this blog

AWS - EC2 Instance Start / Stop using AWS Lambda Python

Steps to Setup Lambda to Start / Stop EC2 instances: 1) Create a Lambda Function with 'Author from scratch' and with Function name 'ecStartInstance' and Runtime 'Python 3.8' 2) Choose new role with basic Lambda permission 3) Create policy using IAM role 4) Click on JSON Editor option and update EC2 instance policy json and click on 'Review Policy' JSON: { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "logs:CreateLogGroup", "logs:CreateLogStream", "logs:PutLogEvents" ], "Resource": "arn:aws:logs:*:*:*" }, { "Effect": "Allow", "Action": [ "ec2:Start*", "ec2:Stop*" ], "Resource": "*" } ] } 5) Give name ...

Do & Don't - Contact Lens

Topics Why Contact Lens? Basics Routine Actions Do & Don't -  Contact Lens Why Contact Lens? This stops eye power increasing. Gives more self confidence. When you are using camera, you can use this. So you will be satisfied with those pictures you have taken. While bike driving in rain and any raining situations. While Going to 3D movie. Finally, you will know, how spider man felt when he no longer require glasses. Basics: Always keep a lens box filled with lens liquid in hand Keep Lens pair box or Lens box always clean. Since eye is more sensitive. You should not keep dust with it. My doctor suggestion is to have a tissue paper in hand and keep the lens box within that tissue paper. Routine Actions: Always change the lens liquid in 4 days. When you feel lens liquid in the lens box is having more dust in it. Change the liquid that time itself. While changing lens liquid make sure, you clean the lens box with tissue paper. Lens can be wear...

Build docker image with Flask & Python3 and Ubuntu 18.04

Setting Up Flask Assuming docker installed in your ubuntu 18.04 instance. Move into your project path. Example : /home/gisak/projects/python/logics/pic_holdr/pic_holdr/pic_flk_holdr Files present within project folder were below. Contents present within requirements.txt file : flask==1.1.1 Contents present within Dockerfile : FROM ubuntu:18.04 MAINTAINER GisakInc 'support@gisakinc.com' RUN apt-get update -y \ apt-get install -y python3-pip python3-dev COPY ./requirements.txt /app/requirements.txt WORKDIR /app RUN pip3 install -r requirements.txt COPY . /app ENTRYPOINT [ "/usr/bin/python3" ] CMD ["base.py"] Contents present within base.py : from flask import Flask app = Flask(__name__) @app.route('/') def hello_world(): return 'Hello, World!' if __name__ == '__main__': app.run(host='0.0.0.0', port=9302) Creating Virtual Environment with python3 : python3.6 -m virtualen...