Class: CloudFormer::Functions::FindInMap

Inherits:
CloudFormer::Function show all
Defined in:
lib/cloud_former/functions/find_in_map.rb

Instance Method Summary collapse

Constructor Details

#initialize(map_name, top_level_key, second_level_key) ⇒ FindInMap

Returns a new instance of FindInMap.



5
6
7
8
9
# File 'lib/cloud_former/functions/find_in_map.rb', line 5

def initialize(map_name, top_level_key, second_level_key)
  @map_name = map_name
  @top_level_key = top_level_key
  @second_level_key = second_level_key
end

Instance Method Details

#dump_jsonObject



11
12
13
14
15
16
17
18
19
# File 'lib/cloud_former/functions/find_in_map.rb', line 11

def dump_json
  {
    'Fn::FindInMap' => [
      @map_name,
      transform_key(@top_level_key),
      transform_key(@second_level_key),
    ],
  }
end