Skip to content

Instantly share code, notes, and snippets.

View richid's full-sized avatar

Rich Schumacher richid

View GitHub Profile
@richid
richid / _spot_instance_termination_handler.py
Last active January 24, 2019 21:25
Lambda function to gracefully remove an EC2 instance from an ECS cluster based on a Spot Instance interruption notice, all managed by Terraform.
from dataclasses import dataclass
from typing import Optional
import boto3
@dataclass(frozen=True)
class EcsInstanceInfo:
ec2_id: str
ecs_instance_arn: str
ecs_cluster_arn: str
@richid
richid / Jenkinsfile
Last active February 24, 2023 15:07
Jenksfile declarative pipeline with parallel dynamic stages
def applications = env.APPLICATIONS.split(",").findAll { it }.collect { it.trim() }
def environment = env.ENVIRONMENT
def version = env.VERSION
def jobs = [:]
if (applications.size() < 1) {
error("ERROR: APPLICATIONS must be a comma-delimited list of applications to build")
}
for (int i = 0; i < applications.size(); i++) {

Keybase proof

I hereby claim:

  • I am richid on github.
  • I am richid (https://keybase.io/richid) on keybase.
  • I have a public key whose fingerprint is D7AB 6286 D0E9 702A 8479 3BD7 9427 3325 8796 6919

To claim this, I am signing this object: