Skip to content

Instantly share code, notes, and snippets.

View infa-sasatapathy's full-sized avatar
🎯
Focusing

Saumik Satapathy infa-sasatapathy

🎯
Focusing
View GitHub Profile
@infa-sasatapathy
infa-sasatapathy / toggleAutoScalingGroup.md
Created June 5, 2020 12:48 — forked from veuncent/toggleAutoScalingGroup.md
AWS Auto Scaling Groups: scheduled start/stop

Tutorial: scheduled start/stop of EC2 instances managed by Auto Scaling Groups

If your EC2 instances in AWS are managed through Auto Scaling Groups, it is easy to schedule startup and shutdown of those instances, e.g. to save money.

This tutorial walks you through setting up an AWS Lambda function that is triggered by CloudWatch Events and automatically changes the min, max and desired instances in your Auto Scaling Group(s).

The idea is to toggle between 0 (stop) and a specifed min, max and desired amount of instances (start), so you only need a single Lambda function. The premise is that you do not touch these Auto Scaling Group settings manually, or you might make your EC2 instances nocturnal.

Create new Lambda function and Start Event

@infa-sasatapathy
infa-sasatapathy / jiraReminder.py
Created December 25, 2019 17:44 — forked from danielbloom/jiraReminder.py
generate html email content
def generate_email_html(tickets):
body_html = [
'The following tickets are open or in code review. Please ensure their status and remaining hours are up to date.',
'<br><br>',
'<table style="border-spacing: 10px">',
'<tr><td>Ticket Number</td><td>Status</td><td>Time Remaining</td><td>Description</td></tr>'
]
for ticket in tickets:
body_html.append('<tr>')