Skip to content

Instantly share code, notes, and snippets.

View alisade's full-sized avatar

Ali Ardestani alisade

  • Los Angeles, CA
View GitHub Profile
#!/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 :
@alisade
alisade / sns-to-slack.js
Created March 28, 2018 00:35 — forked from benyanke/sns-to-slack.js
AWS Lambda function for forwarding SNS notifications to Slack
// 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
@alisade
alisade / ec2_cloud.groovy
Last active March 29, 2018 00:01 — forked from halfb00t/ec2_cloud.groovy
Jenkins EC2 Plugin Configuration via Groovy
/*
* 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
@alisade
alisade / ec2_cloud.groovy
Created December 13, 2017 19:26 — forked from vrivellino/ec2_cloud.groovy
Jenkins EC2 Plugin Configuration via Groovy
/*
* 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