cfhighlander 0.4.0.alpha.1531788388 → 0.4.0.alpha.1531791475

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 +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e8e8316247f2be44ddfde98f0b9351e40f70f0de71c524dbb117ee9415f52ea1
4
- data.tar.gz: 0ded6c180e4c9c4d2d0c13d0cd01a7846d9689d47475707cfcb25bc1e9e733ee
3
+ metadata.gz: f23bce250ee476c3abf51e8fb906fad9c8bc6879c44407a60c3743e74958f861
4
+ data.tar.gz: 697281f867a0551f8275fd3f679d9b141d988cda2f35b5411df05ad0f8a1e035
5
5
  SHA512:
6
- metadata.gz: d4de59d1674875f67e77f8fc827c70e7d08d2716a2b279595184c65ce4b455a7b6b7412734b7d7dba1551f655c5985945948c83a6cec1756ea014684c8bdeb21
7
- data.tar.gz: aae4733933c3f855a0dde064805bc17cd490406058b67f82a93d789bcc9178a594bc034dcfeae414e971e1098c1c53f57a4c383fcc23ed99cc5611fdd98607c6
6
+ metadata.gz: 74aaa9b9514d93e33574cd2e2c1f1ca7bcbf334e0c7164916f8c73120f84c1fc5df86492b1b48c583cd94406415985aaae2d808effd6b62415284510467e52f8
7
+ data.tar.gz: 77f9f2780801de2f721c9699d9aa94d6d1d39612ebda33ba5dfa876c3459e778d83f866196ce133997733b2d173812630a8dec93c474de58867b9cbae4b0c9dd
@@ -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,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cfhighlander
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0.alpha.1531788388
4
+ version: 0.4.0.alpha.1531791475
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nikola Tosic