This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import boto3 | |
import json | |
import uuid | |
import sys | |
from time import sleep | |
import backoff | |
from botocore import exceptions | |
if len(sys.argv) < 2 : |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// By Ben Yanke | |
// Based on https://gist.github.com/benyanke/862e446e5a816551928d8acc2d98b752 | |
// Handles CloudWatch alerts via SNS as Slack Attachments, instead of plaintext. | |
console.log('Loading function'); | |
const https = require('https'); | |
const url = require('url'); | |
// to get the slack hook url, go into slack admin and create a new "Incoming Webhook" integration | |
const slack_url = 'https://hooks.slack.com/services/...'; // put your webhook URL here// Added by Ben Yanke |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Configure the Jenkins EC2 Plugin via Groovy Script | |
* EC2 Plugin URL: https://wiki.jenkins-ci.org/display/JENKINS/Amazon+EC2+Plugin | |
*/ | |
import com.amazonaws.services.ec2.AmazonEC2 | |
import com.amazonaws.services.ec2.AmazonEC2ClientBuilder | |
import com.amazonaws.services.ec2.model.CreateKeyPairRequest | |
import com.amazonaws.services.ec2.model.CreateKeyPairResult | |
import com.amazonaws.services.ec2.model.KeyPair | |
import com.amazonaws.services.ec2.model.DeleteKeyPairRequest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Configure the Jenkins EC2 Plugin via Groovy Script | |
* EC2 Plugin URL: https://wiki.jenkins-ci.org/display/JENKINS/Amazon+EC2+Plugin | |
*/ | |
import hudson.model.* | |
import jenkins.model.* | |
import hudson.plugins.ec2.* | |
import com.amazonaws.services.ec2.model.InstanceType | |