cfhighlander 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/cfhighlander.dsl.base.rb +89 -0
  3. metadata +2 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 152c69286789dce8eda5ae3cee32f40be1db507e3bafee8daf3bf70283425ea9
4
- data.tar.gz: 8bd56c2f7bb9ec443de17abc8076df3e5890373139fd211679e2dc2d0f25d5dc
3
+ metadata.gz: 05f4776ad4b7fdda865a75512c7510d8afbc399af0d7bee1e057d2b4eba2fa70
4
+ data.tar.gz: 41768db26a4ddab7f0e4f8ef9f6f0eb7a1556ec17758d1b0c8e2cb764786da54
5
5
  SHA512:
6
- metadata.gz: 52068fd9dfb6aa59f506afc83f50298eccb6fd23a4be68a1862ae53a1515bf0c28abd881b5fb38aaea229eb5447bf12bf9159ab3763e4eb2eb53e3885c36cd50
7
- data.tar.gz: 34839cbc644eb091a0b1f8bda5f236ba0f388393852c62c6e20a9549e904b91ace3ba6b5c9a0ec6b019f16d55d0085d5612051a2c7d1195d08129394824d16aa
6
+ metadata.gz: 607cf05d6e3db3bfb3654724b1094955441fdc8645ddb0bbbfe7d0f564b49f80e1f3ea2e6148802448c32f20c9491899f931306c267326fc9eac5d2f684b139b
7
+ data.tar.gz: 078d9cfd9d16cd1db1deaa36d86ceacd08d412c99417b84ca1257ac91a270a43167abc94b4ec606b13b4fc46e9ad572ec4f5e3e18db6034fba1f202c8d8174ea
@@ -5,6 +5,7 @@ module Cfhighlander
5
5
 
6
6
  attr_accessor :config
7
7
 
8
+ # intrinsic functions
8
9
 
9
10
  def GetAtt(resource, property)
10
11
  return FnGetAtt(resource, property)
@@ -16,6 +17,94 @@ module Cfhighlander
16
17
  }
17
18
  end
18
19
 
20
+ def FnImportValue(value)
21
+ return {
22
+ 'Fn::ImportValue' => value
23
+ }
24
+ end
25
+
26
+ def FnSub(string, replacementMap = nil)
27
+ if replacementMap.nil?
28
+ return { 'Fn::Sub' => string }
29
+ else
30
+ return { 'Fn::Sub' => [string, replacementMap] }
31
+ end
32
+ end
33
+
34
+ def FnSplit(delimiter, source)
35
+ return { 'Fn::Split' => [delimiter, source] }
36
+ end
37
+
38
+ def FnSelect(index, list)
39
+ return { 'Fn::Select' => [index, list] }
40
+ end
41
+
42
+ def FnGetAZs(region = nil)
43
+ if region.nil?
44
+ region = AWSStackRegion()
45
+ end
46
+ return { 'Fn::GetAZs' => region }
47
+ end
48
+
49
+ def FnCidr(ip_block, count, sizeMask)
50
+ return { 'Fn::Cidr' => [ip_block, count, sizeMask] }
51
+ end
52
+
53
+ def FnBase64(value)
54
+ return { 'Fn::Base64' => value }
55
+ end
56
+
57
+ # pseudo reference
58
+ def AWSStackRegion
59
+ return Ref('AWS::Region')
60
+ end
61
+
62
+ def AWSStackName
63
+ return Ref('AWS::StackName')
64
+ end
65
+
66
+ def AWSAccountId
67
+ return Ref('AWS::AccountId')
68
+ end
69
+
70
+ def AWSURLSuffix
71
+ return Ref('AWS::URLSuffix')
72
+ end
73
+
74
+ def AWSPartition
75
+ return Ref('AWS::Partition')
76
+ end
77
+
78
+ def AWSNoValue
79
+ return Ref('AWS::NoValue')
80
+ end
81
+
82
+ def AWSNotificationARNs
83
+ return Ref('AWS::NotificationARNs')
84
+ end
85
+
86
+ # logic intrinsic functions
87
+ def FnIf(condition, true_branch, false_branch)
88
+ return { 'Fn::If' => [condition, true_branch, false_branch] }
89
+ end
90
+
91
+ def FnAnd(*args)
92
+ return { 'Fn::And' => args }
93
+ end
94
+
95
+ def FnEquals(val1, val2)
96
+ return { 'Fn::Equals' => [val1, val2] }
97
+ end
98
+
99
+ def FnNot(condition)
100
+ return { 'Fn::Not' => [condition] }
101
+ end
102
+
103
+ def FnOr(*args)
104
+ return { 'Fn::Or' => args }
105
+ end
106
+
107
+
19
108
  def Ref(resource)
20
109
  return {
21
110
  'Ref' => resource
metadata CHANGED
@@ -1,11 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cfhighlander
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nikola Tosic
8
8
  - Aaron Walker
9
+ - Angus Vine
9
10
  autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []