Method: BigBang::KillCmd#kill_eip

Defined in:
lib/bigbang/kill.rb

#kill_eip(i, addresses) ⇒ Object



32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/bigbang/kill.rb', line 32

def kill_eip(i, addresses)
	addr = addresses.find { |a| a.publicIp == i.ipAddress }
		
	unless addr.nil?
		confirm("Would you like to release EIP address #{addr.publicIp} of instance #{i.instanceId}") do
			puts "disassociating address #{addr.publicIp}"
			provider.ec2.disassociate_address(:public_ip => addr.publicIp)
			
			puts "releasing address #{addr.publicIp}"
			provider.ec2.release_address(:public_ip => addr.publicIp)
		end
	end
end