This file contains hidden or 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
{ | |
"Volumes": [ | |
{ | |
"AvailabilityZone": "us-west-2a", | |
"Attachments": [ | |
{ | |
"AttachTime": "2013-09-17T00:55:03.000Z", | |
"InstanceId": "i-a071c394", | |
"VolumeId": "vol-e11a5288", | |
"State": "attached", |
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"os" | |
"github.com/Jeffail/gabs" | |
) |
This file contains hidden or 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
const COMMANDS = { | |
"1F": [3], | |
"1B": [5], | |
"1L": [11], | |
"1R": [13], | |
"1FR": [3, 13], | |
"1FL": [3, 11], | |
"1BR": [5, 13], | |
"1BL": [5, 11], | |
"2F": [18], |
This file contains hidden or 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
type AmazonResponse struct { | |
Reservations []Reservation `json:"Reservations"` | |
} | |
type Reservation struct { | |
Instances []Instace `json:"Instances"` | |
} | |
type Instance struct { | |
PublicIpAddres string `json:"PublicIpAddres"` |
This file contains hidden or 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/python3 | |
import pygame | |
import sys | |
class Game(): | |
def __init__(self): | |
self._running = True |
This file contains hidden or 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
""" | |
Get notification from ECS when a deployment is failing. Post to slack | |
This lambda function receives a notification from a cloudwatch log filter when | |
an ECS deployment fails, it creates a hash based on the cluster arn and then | |
task definition and saves the file in S3. | |
To make sure we don't get duplicate, if we already have a file in S3, we don't | |
resend the notification. |
This file contains hidden or 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
{ | |
"account": "{account-id}", | |
"detail": { | |
"clusterArn": "arn:aws:ecs:us-east-1:{account-id}:cluster/{cluster-id}", | |
"containerInstanceArn": "arn:aws:ecs:us-east-1:{account-id}:container-instance/0b1a4979-3846-4e3e-846f-b63a9ad545b0", | |
"containers": [ | |
{ | |
"containerArn": "arn:aws:ecs:us-east-1:{account-id}:container/4ce75a22-f1c9-4ac2-8607-a503e7682c1d", | |
"exitCode": 1, | |
"lastStatus": "STOPPED", |
This file contains hidden or 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
/* | |
Read more about event patterns here: | |
http://docs.aws.amazon.com/AmazonCloudWatch/latest/events/CloudWatchEventsandEventPatterns.html | |
*/ | |
data "template_file" "event_pattern" { | |
template = "${file("${path.module}/files/deploy-notification.json.tpl")}" | |
vars = { | |
cluster_arn = "${aws_ecs_cluster.ecs.id}" | |
} |
This file contains hidden or 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
{ | |
"source": [ | |
"aws.ecs" | |
], | |
"detail-type": [ | |
"ECS Task State Change" | |
], | |
"detail": { | |
"clusterArn": [ | |
"${cluster_arn}" |
This file contains hidden or 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
{"error_code":"bad_gateway","id":1491925505.798,"message":"We were not able to connect to the upstream server, please contact [email protected] with the details of the request you made"} |