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.4.2 ext/helper.rb
ciinabox-ecs-0.4.1 ext/helper.rb
ciinabox-ecs-0.3.2 ext/helper.rb
ciinabox-ecs-0.3.2.alpha.1622701697 ext/helper.rb
ciinabox-ecs-0.3.1.alpha.1622698898 ext/helper.rb
ciinabox-ecs-0.3.1.alpha.1622695860 ext/helper.rb
ciinabox-ecs-0.3.1 ext/helper.rb
ciinabox-ecs-0.3.1.alpha.1617687041 ext/helper.rb
ciinabox-ecs-0.3.0.alpha.1617686815 ext/helper.rb
ciinabox-ecs-0.3.0 ext/helper.rb
ciinabox-ecs-0.3.0.alpha.1612412532 ext/helper.rb
ciinabox-ecs-0.3.0.alpha.1612411765 ext/helper.rb
ciinabox-ecs-0.3.0.alpha.1612323213 ext/helper.rb
ciinabox-ecs-0.2.17.alpha.1612322070 ext/helper.rb
ciinabox-ecs-0.2.17.alpha.1608078804 ext/helper.rb
ciinabox-ecs-0.2.17 ext/helper.rb
ciinabox-ecs-0.2.16 ext/helper.rb
ciinabox-ecs-0.2.15.alpha.1565746583 ext/helper.rb
ciinabox-ecs-0.2.15 ext/helper.rb
ciinabox-ecs-0.2.14.alpha.1565134498 ext/helper.rb