Skip to content

Instantly share code, notes, and snippets.

opts := &glacier.SetVaultNotificationsInput{
VaultName: aws.String(d.Id()),
VaultNotificationConfig: &glacier.VaultNotificationConfig{
SNSTopic: aws.String(sns_topic),
Events: aws.StringSlice(events),
},
}
var https = require('https');
var util = require('util');
exports.handler = function(event, context) {
try {
var message = JSON.parse(event.Records[0].Sns.Message);
var eventType = message.Event;
var autoScaleGroupName = message.AutoScalingGroupName;
var description = message.Description;
# Run Elasticsearch as this user ID and group ID
#ES_USER=elasticsearch
{% if es_default_es_user is defined %}ES_USER={{ es_default_es_user }}{% endif %}
#ES_GROUP=elasticsearch
{% if es_default_es_group is defined %}ES_GROUP={{ es_default_es_group }}{% endif %}
# Heap Size (defaults to 256m min, 1g max)
#ES_HEAP_SIZE=2g
{% if es_default_es_heap_size is defined %}ES_HEAP_SIZE={{ es_default_es_heap_size }}{% endif %}
{
"variables": {
"ami_id": "",
"private_subnet_id": "",
"security_group_id": "",
"packer_build_number": "",
},
"description": "ElasticSearch Image",
"builders": [
{
user www-data;
worker_processes 4;
pid /run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
log.console = file
log.console.level = info
log.console.file = $(platform_log_dir)/console.log
log.error.file = $(platform_log_dir)/error.log
log.syslog = off
log.crash = on
log.crash.file = $(platform_log_dir)/crash.log
log.crash.maximum_message_size = 64KB
log.crash.size = 10MB
log.crash.rotation = $D0
variable "vpc_id" {}
variable "ingress_cidr_blocks" {}
variable "key_name" {}
variable "ami" {}
variable "instance_type" {}
variable "private_subnets" {}
variable "public_subnets" {}
variable "availability_zones" {}
variable "cluster_name" {}
resource "aws_security_group" "consul_elb" {
zookeeper-data-directory=/opt/zookeeper/snapshots
zookeeper-install-directory=/opt/zookeeper
zookeeper-log-directory=/opt/zookeeper/transactions
log-index-directory=/opt/zookeeper/transactions
cleanup-period-ms=300000
check-ms=30000
backup-period-ms=600000
client-port=2181
cleanup-max-files=20
backup-max-store-ms=21600000
@stack72
stack72 / raid_ephemeral.sh
Created February 8, 2016 18:14 — forked from joemiller/raid_ephemeral.sh
detect all ephemeral disks on EC2 then stripe together in a raid-0 vol mounted at /mnt
#!/bin/bash
#
# this script will attempt to detect any ephemeral drives on an EC2 node and create a RAID-0 stripe
# mounted at /mnt. It should be run early on the first boot of the system.
#
# Beware, This script is NOT fully idempotent.
#
METADATA_URL_BASE="http://169.254.169.254/2012-01-12"
apt-get install nginx