class Cfhighlander::Dsl::DslBase
Attributes
config[RW]
Public Class Methods
new(parent)
click to toggle source
# File lib/cfhighlander.dsl.base.rb, line 146 def initialize (parent) @config = parent.config unless parent.nil? end
Public Instance Methods
AWSAccountId()
click to toggle source
# File lib/cfhighlander.dsl.base.rb, line 70 def AWSAccountId return Ref('AWS::AccountId') end
AWSNoValue()
click to toggle source
# File lib/cfhighlander.dsl.base.rb, line 82 def AWSNoValue return Ref('AWS::NoValue') end
AWSNotificationARNs()
click to toggle source
# File lib/cfhighlander.dsl.base.rb, line 86 def AWSNotificationARNs return Ref('AWS::NotificationARNs') end
AWSPartition()
click to toggle source
# File lib/cfhighlander.dsl.base.rb, line 78 def AWSPartition return Ref('AWS::Partition') end
AWSStackName()
click to toggle source
# File lib/cfhighlander.dsl.base.rb, line 66 def AWSStackName return Ref('AWS::StackName') end
AWSStackRegion()
click to toggle source
pseudo reference
# File lib/cfhighlander.dsl.base.rb, line 62 def AWSStackRegion return Ref('AWS::Region') end
AWSURLSuffix()
click to toggle source
# File lib/cfhighlander.dsl.base.rb, line 74 def AWSURLSuffix return Ref('AWS::URLSuffix') end
FindInMap(map, key, attr)
click to toggle source
# File lib/cfhighlander.dsl.base.rb, line 122 def FindInMap(map, key, attr) return FnFindInMap(map, key, attr) end
FnAnd(*args)
click to toggle source
# File lib/cfhighlander.dsl.base.rb, line 95 def FnAnd(*args) return { 'Fn::And' => args } end
FnBase64(value)
click to toggle source
# File lib/cfhighlander.dsl.base.rb, line 57 def FnBase64(value) return { 'Fn::Base64' => value } end
FnCidr(ip_block, count, sizeMask)
click to toggle source
# File lib/cfhighlander.dsl.base.rb, line 53 def FnCidr(ip_block, count, sizeMask) return { 'Fn::Cidr' => [ip_block, count, sizeMask] } end
FnEquals(val1, val2)
click to toggle source
# File lib/cfhighlander.dsl.base.rb, line 99 def FnEquals(val1, val2) return { 'Fn::Equals' => [val1, val2] } end
FnFindInMap(map, key, attr)
click to toggle source
# File lib/cfhighlander.dsl.base.rb, line 118 def FnFindInMap(map, key, attr) return { 'Fn::FindInMap' => [map, key, attr] } end
FnGetAZs(region = nil)
click to toggle source
# File lib/cfhighlander.dsl.base.rb, line 46 def FnGetAZs(region = nil) if region.nil? region = AWSStackRegion() end return { 'Fn::GetAZs' => region } end
FnGetAtt(resource, property)
click to toggle source
# File lib/cfhighlander.dsl.base.rb, line 14 def FnGetAtt(resource, property) return { 'Fn::GetAtt' => [resource, property] } end
FnIf(condition, true_branch, false_branch)
click to toggle source
logic intrinsic functions
# File lib/cfhighlander.dsl.base.rb, line 91 def FnIf(condition, true_branch, false_branch) return { 'Fn::If' => [condition, true_branch, false_branch] } end
FnImportValue(value)
click to toggle source
# File lib/cfhighlander.dsl.base.rb, line 20 def FnImportValue(value) return { 'Fn::ImportValue' => value } end
FnJoin(glue, pieces)
click to toggle source
# File lib/cfhighlander.dsl.base.rb, line 38 def FnJoin(glue, pieces) return { 'Fn::Join' => [glue, pieces]} end
FnNot(condition)
click to toggle source
# File lib/cfhighlander.dsl.base.rb, line 103 def FnNot(condition) return { 'Fn::Not' => [condition] } end
FnOr(*args)
click to toggle source
# File lib/cfhighlander.dsl.base.rb, line 107 def FnOr(*args) return { 'Fn::Or' => args } end
FnSelect(index, list)
click to toggle source
# File lib/cfhighlander.dsl.base.rb, line 42 def FnSelect(index, list) return { 'Fn::Select' => [index, list] } end
FnSplit(delimiter, source)
click to toggle source
# File lib/cfhighlander.dsl.base.rb, line 34 def FnSplit(delimiter, source) return { 'Fn::Split' => [delimiter, source] } end
FnSub(string, replacementMap = nil)
click to toggle source
# File lib/cfhighlander.dsl.base.rb, line 26 def FnSub(string, replacementMap = nil) if replacementMap.nil? return { 'Fn::Sub' => string } else return { 'Fn::Sub' => [string, replacementMap] } end end
GetAtt(resource, property)
click to toggle source
intrinsic functions
# File lib/cfhighlander.dsl.base.rb, line 10 def GetAtt(resource, property) return FnGetAtt(resource, property) end
Ref(resource)
click to toggle source
# File lib/cfhighlander.dsl.base.rb, line 112 def Ref(resource) return { 'Ref' => resource } end
cfmap(map, key, attr)
click to toggle source
# File lib/cfhighlander.dsl.base.rb, line 141 def cfmap(map, key, attr) return FindInMap(map, key, attr) end
cfout(resource, output = nil)
click to toggle source
# File lib/cfhighlander.dsl.base.rb, line 126 def cfout(resource, output = nil) if output.nil? parts = resource.split('.') if parts.size() != 2 raise "cfout('#{resource}'): If cfout given single argument cfout('component.OutputName') syntax must be used" else resource = parts[0] output = parts[1] end end return GetAtt(resource, "Outputs.#{output}") end
method_missing(method, *args)
click to toggle source
# File lib/cfhighlander.dsl.base.rb, line 150 def method_missing(method, *args) if @config.nil? raise StandardError, "#{self} no config!" end # return @config["#{method}"] unless @config["#{method}"].nil? raise StandardError, "#{self} Unknown method or variable #{method} in Cfhighlander template" end