Skip to content

Instantly share code, notes, and snippets.

@Aslan
Created March 24, 2011 19:13
Show Gist options
  • Save Aslan/885651 to your computer and use it in GitHub Desktop.
Save Aslan/885651 to your computer and use it in GitHub Desktop.
# this works:
ruby_block "register_with_elb" do
require 'AWS'
ec2 = AWS::ELB::Base.new(:access_key_id => "xxxxxx", :secret_access_key => "yyyy")
block do
ec2.register_instances_with_load_balancer(:load_balancer_name => "integration-svnetwork-app", :instances => ["#{@node[:ec2][:instance_id]}"] )
end
not_if registered_with_load_balancer?(:ec2 => ec2).to_s
end
# this doesn't:
ruby_block "register_with_elb" do
require 'AWS'
ec2 = AWS::ELB::Base.new(:access_key_id => "xxxxxx", :secret_access_key => "yyyy")
block do
ec2.register_instances_with_load_balancer(:load_balancer_name => "integration-svnetwork-app", :instances => ["#{@node[:ec2][:instance_id]}"] )
end
not_if registered_with_load_balancer?(:ec2 => ec2)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment