Skip to content

Instantly share code, notes, and snippets.

@Aslan
Forked from jtimberman/elb_register.rb
Created April 13, 2010 17:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Aslan/364882 to your computer and use it in GitHub Desktop.
Save Aslan/364882 to your computer and use it in GitHub Desktop.
# Completely untested.
gem_package "amazon-ec2"
aws = search("aws", "main")
Gem.clear_paths
ruby_block do "register_with_elb" do
do
require 'amazon-ec2'
AWS::Base.initialize(:access_key_id => aws['aws_access_key_id'], :secret_access_key => aws['aws_secret_access_key'])
AWS::ELB::Base.register_instances_with_load_balancer(:load_balancer_name => "name_of_load_balancer")
end
end
knife data bag show aws main
{
"id": "main",
"ec2_private_key": "private key as a string",
"ec2_cert": "certificate as a string",
"aws_account_id": "",
"aws_secret_access_key": "",
"aws_access_key_id": ""
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment