Sha256: 7a1fc1870f4fd579250877804e01bbb60818df83b61ca6974f0b649d8d9414a9

Contents?: true

Size: 640 Bytes

Versions: 47

Compression:

Stored size: 640 Bytes

Contents

# ciinabox cfndsl helpers
def add_security_group_rules (access_list)
  rules = []
  access_list.each do |ip|
    rules << { IpProtocol: 'tcp', FromPort: '22', ToPort: '22', CidrIp: ip }
  end
end

def nat_scale_up_schedule(scale_up_schedule)
  expr = scale_up_schedule.split
  hour = expr[1].to_i
  minute = expr[0].to_i
  if minute < 10
    minute = 60 + minute - 10
    hour = hour - 1
  else
    minute = minute - 10
  end
  return "#{minute} #{hour} #{expr[2]} #{expr[3]} #{expr[4]}"
end

def lookup_service(name, services=[])
  services.each do |service|
    if service.has_key? name
      return service[name]
    end
  end
  nil
end

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
ciinabox-ecs-0.2.8 ext/helper.rb
ciinabox-ecs-0.2.7 ext/helper.rb
ciinabox-ecs-0.2.6 ext/helper.rb
ciinabox-ecs-0.2.4 ext/helper.rb
ciinabox-ecs-0.2.2 ext/helper.rb
ciinabox-ecs-0.2.1 ext/helper.rb
ciinabox-ecs-0.1.6 ext/helper.rb