Method: Tunl::Base#authorize_security_group

Defined in:
lib/tunl.rb

#authorize_security_group(name) ⇒ Object



99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/tunl.rb', line 99

def authorize_security_group(name)
  [ 22, 80 ].each do |port|
    begin
      ec2.authorize_security_group_IP_ingress("tunl_#{name}", port, port)
    rescue Aws::AwsError => e
      if e.message =~ /already been authorized/
        # do nothing
      else
        raise e
      end
    end
  end
end