UNPKG

10.9 kBMarkdownView Raw
1<a name="IntrinsicFunctions"></a>
2
3## IntrinsicFunctions
4Helpers that will create AWS Intrinsic Functions
5
6**Kind**: global namespace
7
8* [IntrinsicFunctions](#IntrinsicFunctions) : <code>object</code>
9 * [.fnAnd(...condition)](#IntrinsicFunctions.fnAnd) ⇒ <code>string</code>
10 * [.fnBase64(str, options)](#IntrinsicFunctions.fnBase64) ⇒ <code>function</code> \| <code>string</code>
11 * [.fnEquals(v1, v2)](#IntrinsicFunctions.fnEquals) ⇒ <code>function</code> \| <code>string</code>
12 * [.fnFindInMap(mapName, topLevelKey, secondLevelKey, options)](#IntrinsicFunctions.fnFindInMap) ⇒ <code>function</code> \| <code>string</code>
13 * [.fnGetArtifactAtt(artifactName, attributeName, options)](#IntrinsicFunctions.fnGetArtifactAtt) ⇒ <code>function</code> \| <code>string</code>
14 * [.fnGetAtt(logicalId, attributeName, options)](#IntrinsicFunctions.fnGetAtt) ⇒ <code>function</code> \| <code>string</code>
15 * [.fnGetAZs(region, options)](#IntrinsicFunctions.fnGetAZs) ⇒ <code>function</code> \| <code>string</code>
16 * [.fnGetParam(artifactName, JSONFileName, keyName, options)](#IntrinsicFunctions.fnGetParam) ⇒ <code>function</code> \| <code>string</code>
17 * [.fnIf(conditionName, trueValue, falseValue, options)](#IntrinsicFunctions.fnIf) ⇒ <code>function</code> \| <code>string</code>
18 * [.fnImportValue(sharedValue, options)](#IntrinsicFunctions.fnImportValue) ⇒ <code>function</code> \| <code>string</code>
19 * [.fnJoin(arr, options)](#IntrinsicFunctions.fnJoin) ⇒ <code>function</code> \| <code>string</code>
20 * [.fnNot(condition, options)](#IntrinsicFunctions.fnNot) ⇒ <code>function</code> \| <code>string</code>
21 * [.fnOr(...condition)](#IntrinsicFunctions.fnOr) ⇒ <code>function</code> \| <code>string</code>
22 * [.fnSelect(index, ...str, options)](#IntrinsicFunctions.fnSelect) ⇒ <code>function</code> \| <code>string</code>
23 * [.fnSplit(delimiter, str, options)](#IntrinsicFunctions.fnSplit) ⇒ <code>function</code> \| <code>string</code>
24 * [.fnSub(str, options)](#IntrinsicFunctions.fnSub) ⇒ <code>function</code> \| <code>string</code>
25 * [.ref(logicalId, options)](#IntrinsicFunctions.ref) ⇒ <code>function</code> \| <code>String</code>
26
27
28* * *
29
30<a name="IntrinsicFunctions.fnAnd"></a>
31
32### fnAnd(...condition)
33Fn::And definition
34
35**Kind**: static method of [<code>IntrinsicFunctions</code>](#IntrinsicFunctions)
36
37| Param | Type | Description |
38| --- | --- | --- |
39| ...condition | <code>string</code> | Any number of conditions |
40
41
42* * *
43
44<a name="IntrinsicFunctions.fnBase64"></a>
45
46### fnBase64(str, options)
47Fn::Base64 definition
48
49**Kind**: static method of [<code>IntrinsicFunctions</code>](#IntrinsicFunctions)
50
51| Param | Type | Description |
52| --- | --- | --- |
53| str | <code>string</code> | The string to evaluate |
54| options | <code>Object</code> | Passed in by Handlebars |
55
56
57* * *
58
59<a name="IntrinsicFunctions.fnEquals"></a>
60
61### fnEquals(v1, v2)
62Fn::Equals definition
63
64**Kind**: static method of [<code>IntrinsicFunctions</code>](#IntrinsicFunctions)
65
66| Param | Type | Description |
67| --- | --- | --- |
68| v1 | <code>string</code> | first value to compare |
69| v2 | <code>string</code> | second value to compare |
70
71
72* * *
73
74<a name="IntrinsicFunctions.fnFindInMap"></a>
75
76### fnFindInMap(mapName, topLevelKey, secondLevelKey, options)
77Fn::FindInMap definition
78
79**Kind**: static method of [<code>IntrinsicFunctions</code>](#IntrinsicFunctions)
80
81| Param | Type | Description |
82| --- | --- | --- |
83| mapName | <code>string</code> | logicalId of the map in the template |
84| topLevelKey | <code>string</code> | The top-level key name. Its value is a list of key-value pairs |
85| secondLevelKey | <code>string</code> | The second-level key name, which is set to one of the keys from the list assigned to TopLevelKey |
86| options | <code>Object</code> | options for creting the logicalId reference |
87
88
89* * *
90
91<a name="IntrinsicFunctions.fnGetArtifactAtt"></a>
92
93### fnGetArtifactAtt(artifactName, attributeName, options)
94Fn::GetArtifactAtt definition
95
96**Kind**: static method of [<code>IntrinsicFunctions</code>](#IntrinsicFunctions)
97
98| Param | Type | Description |
99| --- | --- | --- |
100| artifactName | <code>string</code> | The name of the input artifact. You must declare this artifact as input for the associated action. |
101| attributeName | <code>string</code> | The name of the artifact attribute whose value you want to retrieve. For details about each artifact attribute, see the following Attributes section. |
102| options | <code>Object</code> | options for creting the logicalId reference |
103
104
105* * *
106
107<a name="IntrinsicFunctions.fnGetAtt"></a>
108
109### fnGetAtt(logicalId, attributeName, options)
110Fn::GetAtt definition
111
112**Kind**: static method of [<code>IntrinsicFunctions</code>](#IntrinsicFunctions)
113
114| Param | Type | Description |
115| --- | --- | --- |
116| logicalId | <code>string</code> | resource that contains the attribute you want |
117| attributeName | <code>string</code> | name of the resource-specific attribute whose value you want |
118| options | <code>Object</code> | options for creting the logicalId reference |
119
120
121* * *
122
123<a name="IntrinsicFunctions.fnGetAZs"></a>
124
125### fnGetAZs(region, options)
126Fn::GetAZs definition
127
128**Kind**: static method of [<code>IntrinsicFunctions</code>](#IntrinsicFunctions)
129
130| Param | Type | Description |
131| --- | --- | --- |
132| region | <code>string</code> | name of the region |
133| options | <code>Object</code> | options passed by handlebars |
134
135
136* * *
137
138<a name="IntrinsicFunctions.fnGetParam"></a>
139
140### fnGetParam(artifactName, JSONFileName, keyName, options)
141Fn::GetParam definition
142
143**Kind**: static method of [<code>IntrinsicFunctions</code>](#IntrinsicFunctions)
144
145| Param | Type | Description |
146| --- | --- | --- |
147| artifactName | <code>string</code> | The name of the artifact, which must be included as an input artifact for the associated action |
148| JSONFileName | <code>string</code> | The name of a JSON file that is contained in the artifact |
149| keyName | <code>string</code> | The name of the key whose value you want to retrieve |
150| options | <code>Object</code> | options for creting the logicalId reference |
151
152
153* * *
154
155<a name="IntrinsicFunctions.fnIf"></a>
156
157### fnIf(conditionName, trueValue, falseValue, options)
158Fn::If definition
159
160**Kind**: static method of [<code>IntrinsicFunctions</code>](#IntrinsicFunctions)
161
162| Param | Type | Description |
163| --- | --- | --- |
164| conditionName | <code>string</code> | Name of the condition to reference |
165| trueValue | <code>string</code> | value to use if condition is true |
166| falseValue | <code>string</code> | value to use if condition is false |
167| options | <code>Object</code> | options passed by handlebars |
168
169
170* * *
171
172<a name="IntrinsicFunctions.fnImportValue"></a>
173
174### fnImportValue(sharedValue, options)
175Fn::ImportValue definition
176
177**Kind**: static method of [<code>IntrinsicFunctions</code>](#IntrinsicFunctions)
178
179| Param | Type | Description |
180| --- | --- | --- |
181| sharedValue | <code>string</code> | name of the shared value |
182| options | <code>Object</code> | options passed by handlebars |
183
184
185* * *
186
187<a name="IntrinsicFunctions.fnJoin"></a>
188
189### fnJoin(arr, options)
190Fn::Join definition
191
192**Kind**: static method of [<code>IntrinsicFunctions</code>](#IntrinsicFunctions)
193
194| Param | Type | Description |
195| --- | --- | --- |
196| arr | <code>array</code> \| <code>string</code> \| <code>string</code> | if one parameter, it will be used as the array. If multiple, they will be joined to form the array. |
197| options | <code>Object</code> | options passed by handlebars |
198
199**Example**
200```js
201{{fnJoin "," (ref "Parameter1") }}
202```
203**Example**
204```js
205{{fnJoin "," (fnGetAZs (ref "AWS::Region")) }}
206```
207**Example**
208```js
209{{fnJoin "," "one" (ref "Parameter") "three"}}
210```
211
212* * *
213
214<a name="IntrinsicFunctions.fnNot"></a>
215
216### fnNot(condition, options)
217Fn::Not definition
218
219**Kind**: static method of [<code>IntrinsicFunctions</code>](#IntrinsicFunctions)
220
221| Param | Type | Description |
222| --- | --- | --- |
223| condition | <code>string</code> | condition to evaluate |
224| options | <code>Object</code> | options passed by handlebars |
225
226**Example**
227```js
228{{fnNot "Condition1"}}
229```
230**Example**
231```js
232{{fnNot (fnEquals (ref "ParameterName") "value") }}
233```
234
235* * *
236
237<a name="IntrinsicFunctions.fnOr"></a>
238
239### fnOr(...condition)
240Fn::Or definition
241
242**Kind**: static method of [<code>IntrinsicFunctions</code>](#IntrinsicFunctions)
243
244| Param | Type | Description |
245| --- | --- | --- |
246| ...condition | <code>string</code> | One to many conditions |
247
248
249* * *
250
251<a name="IntrinsicFunctions.fnSelect"></a>
252
253### fnSelect(index, ...str, options)
254Fn::Select definition
255
256**Kind**: static method of [<code>IntrinsicFunctions</code>](#IntrinsicFunctions)
257
258| Param | Type | Description |
259| --- | --- | --- |
260| index | <code>Number</code> | array member to pick |
261| ...str | <code>string</code> | strings to select from |
262| options | <code>Object</code> | options passed by handlebars |
263
264**Example**
265```js
266{{fnSelect 0 (ref "ParameterList")}}
267```
268**Example**
269```js
270{{fnSelect 0 "value1" "value2"}}
271```
272
273* * *
274
275<a name="IntrinsicFunctions.fnSplit"></a>
276
277### fnSplit(delimiter, str, options)
278Fn::Split definition
279
280**Kind**: static method of [<code>IntrinsicFunctions</code>](#IntrinsicFunctions)
281
282| Param | Type | Description |
283| --- | --- | --- |
284| delimiter | <code>string</code> | A string value that determines where the source string is divided |
285| str | <code>string</code> | A string |
286| options | <code>Object</code> | options passed by handlebars |
287
288**Example**
289```js
290{{fnSplit ":" "split:me"}}
291```
292
293* * *
294
295<a name="IntrinsicFunctions.fnSub"></a>
296
297### fnSub(str, options)
298Fn::Sub definition
299
300**Kind**: static method of [<code>IntrinsicFunctions</code>](#IntrinsicFunctions)
301
302| Param | Type | Description |
303| --- | --- | --- |
304| str | <code>string</code> | String with replacement variables defined |
305| options | <code>Object</code> | options passed by handlebars |
306| options.hash | <code>Object</code> | all named parameters will be used for the variableMap |
307
308**Example**
309```js
310{{fnSub "The current region is ${AWS::Region"}}
311```
312**Example**
313```js
314{{fnSub "Use this URL ${Url}" Url=(partial "buildUrl") }}
315```
316
317* * *
318
319<a name="IntrinsicFunctions.ref"></a>
320
321### ref(logicalId, options)
322Ref definition
323
324**Kind**: static method of [<code>IntrinsicFunctions</code>](#IntrinsicFunctions)
325
326| Param | Type | Default | Description |
327| --- | --- | --- | --- |
328| logicalId | <code>string</code> | | The logicalId to reference |
329| options | <code>Object</code> | | passed by handlebars |
330| [options.hash] | <code>Object</code> | | Named parameters used for ref options |
331| [options.hash.scope] | <code>Boolean</code> | <code>true</code> | Whether to scope the logicalId or not |
332
333**Example**
334```js
335{{ref "Parameter1"}}
336```
337**Example**
338```js
339{{ref "Parameter2" scope=false}}
340```
341
342* * *
343