Sha256: b9bd854a3195204a9b8adb0302ca560471728f28de3847e66b6a9216bbd98c04

Contents?: true

Size: 852 Bytes

Versions: 3

Compression:

Stored size: 852 Bytes

Contents

module Cfer::Core::Fn
  class << self
    def join(sep, args)
      {"Fn::Join" => [sep, args]}
    end

    def ref(r)
      {"Ref" => r}
    end

    def get_att(r, att)
      {"Fn::GetAtt" => [r, att]}
    end

    def find_in_map(map_name, key1, key2)
      {"Fn::FindInMap" => [map_name, key1, key2]}
    end

    def select(i, o)
      {"Fn::Select" => [i, o]}
    end

    def base64(v)
      {"Fn::Base64" => v}
    end

    def condition(cond)
      {"Condition" => cond}
    end

    def and(conds)
      {"Fn::And" => [conds]}
    end

    def equals(a, b)
      {"Fn::Equals" => [a, b]}
    end

    def if(cond, t, f)
      {"Fn::If" => [cond, t, f]}
    end

    def not(cond)
      {"Fn::Not" => cond}
    end

    def or(conds)
      {"Fn::Or" => conds}
    end

    def get_azs(region)
      {"Fn::GetAZs" => region}
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cfer-0.2.0 lib/cfer/core/fn.rb
cfer-0.1.3 lib/cfer/core/fn.rb
cfer-0.1.1 lib/cfer/core/fn.rb