class UpdateElbForWebsockets::WebSocketElbHelpers
Public Class Methods
create_listener(elb, params)
click to toggle source
# File migrations/20130826150635_update_elb_for_websockets.rb, line 93 def self.create_listener(elb, params) elb.listeners.create(params) end
find_security_group_by_name(ec2, vpc_id, name)
click to toggle source
# File migrations/20130826150635_update_elb_for_websockets.rb, line 63 def self.find_security_group_by_name(ec2, vpc_id, name) vpc = Bosh::AwsCliPlugin::VPC.find(ec2, vpc_id) security_group = vpc.security_group_by_name(name) err("AWS reports that security group #{name} does not exist") unless security_group security_group end
find_server_certificate_from_listeners(elb, params)
click to toggle source
# File migrations/20130826150635_update_elb_for_websockets.rb, line 84 def self.find_server_certificate_from_listeners(elb, params) listener = elb.listeners.find {|l| l.port == params[:port] && l.protocol == params[:protocol] } err("Could not find listener with params '#{params.inspect}' on ELB '#{elb.name}'") unless listener err("Could not find server certificate for listener with params '#{params.inspect}' on ELB '#{elb.name}'") unless listener.server_certificate listener.server_certificate end
record_ingress(vpc_receipt, security_group_name, params)
click to toggle source
# File migrations/20130826150635_update_elb_for_websockets.rb, line 78 def self.record_ingress(vpc_receipt, security_group_name, params) receipt_security_groups = vpc_receipt['original_configuration']['vpc']['security_groups'] receipt_router_security_group = receipt_security_groups.find{ |g| g['name'] == security_group_name} receipt_router_security_group['ingress'] << params end