Class: CfnDsl::ResourceDefinition

Inherits:
JSONable
  • Object
show all
Defined in:
lib/cfndsl/resources.rb

Overview

Handles Resource objects

Constant Summary

Constants included from Functions

Functions::FN_SUB_SCANNER

Instance Method Summary collapse

Methods inherited from JSONable

#as_json, #declare, #external_parameters, external_parameters, #ref_children, #to_json

Methods included from Functions

#FnAnd, #FnBase64, #FnCidr, #FnEquals, #FnFindInMap, #FnGetAZs, #FnGetAtt, #FnIf, #FnImportValue, #FnJoin, #FnNot, #FnOr, #FnSelect, #FnSplit, #FnSub, #Ref

Methods included from RefCheck

#build_references, #ref_children

Instance Method Details

#add_tag(name, value, propagate = nil) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/cfndsl/resources.rb', line 11

def add_tag(name, value, propagate = nil)
  send(:Tag) do
    Key name
    Value value
    PropagateAtLaunch propagate unless propagate.nil?
  end
end

#all_refsObject



40
41
42
# File 'lib/cfndsl/resources.rb', line 40

def all_refs
  [@DependsOn].flatten.compact.map(&:to_s)
end

#condition_refsObject



36
37
38
# File 'lib/cfndsl/resources.rb', line 36

def condition_refs
  [@Condition].flatten.compact.map(&:to_s)
end

#DependsOn(value) ⇒ Object

DependsOn can be a single value or a list



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/cfndsl/resources.rb', line 20

def DependsOn(value)
  case @DependsOn
  when nil
    @DependsOn = value
  when Array
    @DependsOn << value
  else
    @DependsOn = [@DependsOn, value]
  end
  if @DependsOn.is_a?(Array)
    @DependsOn.flatten!
    @DependsOn.uniq!
  end
  @DependsOn
end