module Stax::Sg

Public Class Methods

included(thor) click to toggle source
# File lib/stax/mixin/sg.rb, line 6
def self.included(thor)
  thor.desc(:sg, 'Security group subcommands')
  thor.subcommand(:sg, Cmd::Sg)
end

Public Instance Methods

get_my_ip() click to toggle source

look up my local public IP

# File lib/stax/mixin/sg.rb, line 12
def get_my_ip
  URI.parse('http://v4.ident.me/').read + '/32'
end
sg_authorize(id, cidr = get_my_ip, port = 22) click to toggle source
# File lib/stax/mixin/sg.rb, line 16
def sg_authorize(id, cidr = get_my_ip, port = 22)
  Aws::Sg.authorize(id, cidr, port)
end
sg_revoke(id, cidr = get_my_ip, port = 22) click to toggle source
# File lib/stax/mixin/sg.rb, line 20
def sg_revoke(id, cidr = get_my_ip, port = 22)
  Aws::Sg.revoke(id, cidr, port)
end