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
{ | |
"version":"2.0", | |
"metadata":{ | |
"apiVersion":"2006-03-01", | |
"checksumFormat":"md5", | |
"endpointPrefix":"s3", | |
"globalEndpoint":"s3.amazonaws.com", | |
"protocol":"rest-xml", | |
"serviceAbbreviation":"Amazon S3", | |
"serviceFullName":"Amazon Simple Storage Service", |
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
require 'spec_helper' | |
describe autoscaling_group('my-auto-scaling-group') do | |
it { should exist } | |
its(:min_size) { should eq 1 } | |
its(:max_size) { should eq 3 } | |
it { should have_ec2('my-ec2') } | |
it { should have_elb('my-elb') } | |
end |
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
package 'nginx' do | |
action :install | |
end | |
service 'nginx' do | |
action [:enable, :start] | |
end |
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
#!/bin/env ruby | |
require "koala" | |
require "highline/import" | |
def prompt_app_info_and_validate(id = nil, secret = nil) | |
id ||= ask("App ID: ") { |q| q.echo = true } | |
secret ||= ask("App Secret: ") { |q| q.echo = "*" } | |
begin |
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 ruby | |
require "tmpdir" | |
COMMON_NAME = ARGV[0] | |
OUTDIR = File.expand_path(ARGV[1] || '.') | |
if COMMON_NAME.nil? || !File.directory?(OUTDIR) | |
puts "Usage: #{File.basename(__FILE__)} [COMMON_NAME] [OUTDIR]" | |
exit 1 | |
end |
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
require "aws-sdk" | |
REGION = ENV['REGION'] | |
ELB_NAME = ENV['ELB_NAME'] | |
IMAGE_NAME_PREFIX = ENV['IMAGE_NAME_PREFIX'] | |
ec2 = AWS::EC2.new(region: REGION) | |
elb = AWS::ELB.new(region: REGION).load_balancers[ELB_NAME] | |
instance = elb.instances.first |
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
require "aws-sdk" | |
REGION = ENV['REGION'] | |
elb = AWS::ELB.new(region: REGION) | |
ARGV.each do |elb_name| | |
next if !ARGV.empty? && !ARGV.include?(elb_name) | |
hosts = [] | |
elb.load_balancers[elb_name].instances.each do |i| | |
hosts << "#{i.tags["Name"]}.#{REGION}\t#{elb_name}" |
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
require "aws-sdk" | |
ACCOUNT_NUMBER = ENV['ACCOUNT_NUMBER'} | |
REGION_NAME = ENV['REGION_NAME'] | |
AMI_DESCRIPTION = ENV['AMI_DESCRIPTION_FILTER'] | |
ec2 = AWS::EC2.new(region: REGION_NAME) | |
images = ec2.images.filter('owner-id', ACCOUNT_NUMBER).filter('description', AMI_DESCRIPTION) | |
sorted = images.to_a.sort{|a, b| b.description <=> a.description } | |
sorted.each do |image| |
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
require "aws-sdk" | |
['us-east-1', 'ap-northeast-1'].each do |region| | |
AWS::ELB.new(region: region).load_balancers.each do |elb| | |
elb.client.describe_instance_health(load_balancer_name: elb.name)[:instance_states].each do |h| | |
puts "#{region}\t#{elb.name}\t#{h[:instance_id]}\t#{h[:state]}\t#{h[:description]}\t#{h[:reason_code]}" | |
end | |
end | |
end |
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
#!/bin/sh | |
[ -z "$JAVA_HOME" ] && export JAVA_HOME=/usr/lib/jvm/jre | |
[ -z "$EC2_HOME" ] && export EC2_HOME=/opt/aws/apitools/ec2 | |
[ -z "$AWS_PATH" ] && export AWS_PATH=/opt/aws && export PATH="${PATH}:${AWS_PATH}/bin" | |
AWS_REGION=`curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone | sed -e 's/[a-z]$//'` | |
INSTANCE_ID=`curl -s http://169.254.169.254/latest/meta-data/instance-id` | |
KERNEL_ID=`curl -s http://169.254.169.254/latest/meta-data/kernel-id` | |
OPTS="--aws-access-key ${AWS_ACCESS_KEY_ID} --aws-secret-key ${AWS_SECRET_ACCESS_KEY} --region ${AWS_REGION}" |
NewerOlder