Skip to content

Instantly share code, notes, and snippets.

iamRoleStatements:
...
# Allow running AWS Fargate containers when AWS Lambda timeout cannot be bypassed.
- Effect: 'Allow'
Action:
- ecs:RunTask
Resource: '*'
- Effect: Allow
Action:
- iam:PassRole
SQSFailureQueue:
Type: AWS::SQS::Queue
Properties:
QueueName: sqs-failure-queue
MessageRetentionPeriod: '1209600'
VisibilityTimeout: '60'
functions:
primaryHandler:
handler: path/to/immortal-handler.handler
name: immortal-handler
deadLetter:
targetArn:
GetResourceArn: SQSFailureQueue
secondaryHandler:
handler: path/to/immortal-handlerDlq.handler
name: immortal-handlerDql
environment:
REGION: eu-west-1
# ECS task to execute handler without timeout limitations
RUNNER: runner
# Required for runTask API call, preliminary created on AWS.
SUBNET: subnet-xxxxxxxx
...
ello,
Thank you for activating Amazon Web Service's Auto Scaling service. We would like to help you get started. We have put together a few resources that we think will be useful to you as you familiarize yourself with the Auto Scaling service.
We have a selection of resources on our web page to help get you started including blogs, tutorials, and videos:
http://aws.amazon.com/autoscaling/getting-started/
Auto Scaling helps you to manage the lifecycle of your EC2 instances by automating launches, software configuration, and replacement of impaired instances. Check out this blog post to learn more:
http://aws.amazon.com/blogs/compute/fleet-management-made-easy-with-auto-scaling/
Hello,
Thank you for activating Amazon Web Service's Elastic Load Balancer (ELB) service. We would like to help you get started to make your experience with ELB better. We have put together a few documents, getting started videos and resources which we think will be useful as you familiarize yourself with this product.
Creating your first ELB:
A video introduction to ELB: https://www.youtube.com/watch?v=oEcEqN8PeeI&feature=youtu.be
Getting Started: http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/elb-getting-started.html
ELB Best Practices: http://aws.amazon.com/articles/1636185810492479
FAQ's: http://aws.amazon.com/ec2/faqs/#elastic-load-balancing
@kalinchernev
kalinchernev / splitcsv.sh
Created April 25, 2018 14:26
split csv file into several files by a given number of items, head row is preserved
#!/bin/sh
tail -n +2 activity.csv | split -l 8000 - split_
for file in split_*
do
head -n 1 activity.csv > tmp_file
cat $file >> tmp_file
mv -f tmp_file "$file.csv"
rm $file
done
@kalinchernev
kalinchernev / getDataFromIATI.js
Last active May 22, 2018 09:24
Download the script and run it with `node getDataFromIATI.js`
const http = require("http");
const fs = require("fs");
const path = require("path");
const url =
"http://datastore.iatistandard.org/api/1/access/activity.csv?reporting-org=XI-IATI-EC_NEAR|XI-IATI-EC_DEVCO|XI-IATI-EC_FPI|XI-IATI-EC_ECHO&stream=True";
http
.get(url, resp => {
let data = "";
// A chunk of data has been recieved.
@kalinchernev
kalinchernev / handler.js
Last active July 27, 2017 08:24
Example node.js lambda function to update pull request title and tags after greenkeeper bot. Written and formatted badly - mix of ES5 and ES6, etc. it was struggling finding issues reported by the platform ...
"use strict";
var crypto = require("crypto");
var GitHubApi = require("github");
var github = new GitHubApi();
var request = require("request");
function signRequestBody(key, body) {
return (
"sha1=" + crypto.createHmac("sha1", key).update(body, "utf-8").digest("hex")
@kalinchernev
kalinchernev / behat.yml
Created May 3, 2017 13:01
example behat config
default:
suites:
default:
contexts:
- FeatureContext
- Drupal\DrupalExtension\Context\DrushContext
- Drupal\DrupalExtension\Context\MessageContext
- Drupal\nexteuropa\Context\DrupalContext
- Drupal\nexteuropa\Context\MinkContext
filters: