|
|
|
|
@ -53,13 +53,68 @@ While some configuration settings have local variables specific to only that
|
|
|
|
|
configuration, a set of functions are available globally for use in _any string_
|
|
|
|
|
in Packer templates. These are listed below for reference.
|
|
|
|
|
|
|
|
|
|
* `isotime` - UTC time in RFC-3339 format.
|
|
|
|
|
* `lower` - Lowercases the string.
|
|
|
|
|
* `pwd` - The working directory while executing Packer.
|
|
|
|
|
* `isotime [FORMAT]` - UTC time, which can be [formatted](http://golang.org/pkg/time/#example_Time_Format).
|
|
|
|
|
See more examples below.
|
|
|
|
|
* `timestamp` - The current Unix timestamp in UTC.
|
|
|
|
|
* `uuid` - Returns a random UUID.
|
|
|
|
|
* `upper` - Uppercases the string.
|
|
|
|
|
|
|
|
|
|
### isotime Format
|
|
|
|
|
|
|
|
|
|
Formatting for the function `isotime` uses the magic reference date
|
|
|
|
|
**Mon Jan 2 15:04:05 -0700 MST 2006**, which breaks down to the following:
|
|
|
|
|
|
|
|
|
|
<table border="1" cellpadding="5" width="100%">
|
|
|
|
|
<tr bgcolor="lightgray">
|
|
|
|
|
<td></td>
|
|
|
|
|
<td align="center"><strong>Day of Week</strong></td>
|
|
|
|
|
<td align="center"><strong>Month</strong></td>
|
|
|
|
|
<td align="center"><strong>Date</strong></td>
|
|
|
|
|
<td align="center"><strong>Hour</strong></td>
|
|
|
|
|
<td align="center"><strong>Minute</strong></td>
|
|
|
|
|
<td align="center"><strong>Second</strong></td>
|
|
|
|
|
<td align="center"><strong>Year</strong></td>
|
|
|
|
|
<td align="center"><strong>Timezone</strong></td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td><strong>Numeric</strong></td>
|
|
|
|
|
<td align="center">-</td>
|
|
|
|
|
<td align="center">01</td>
|
|
|
|
|
<td align="center">02</td>
|
|
|
|
|
<td align="center">03 (15)</td>
|
|
|
|
|
<td align="center">04</td>
|
|
|
|
|
<td align="center">05</td>
|
|
|
|
|
<td align="center">06</td>
|
|
|
|
|
<td align="center">-0700</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td><strong>Textual</strong></td>
|
|
|
|
|
<td align="center">Monday (Mon)</td>
|
|
|
|
|
<td align="center">January (Jan)</td>
|
|
|
|
|
<td align="center">-</td>
|
|
|
|
|
<td align="center">-</td>
|
|
|
|
|
<td align="center">-</td>
|
|
|
|
|
<td align="center">-</td>
|
|
|
|
|
<td align="center">-</td>
|
|
|
|
|
<td align="center">MST</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
_The values in parentheses are the abbreviated, or 24-hour clock values_
|
|
|
|
|
|
|
|
|
|
Here are some example formated time, using the above format options:
|
|
|
|
|
|
|
|
|
|
<pre>
|
|
|
|
|
isotime = June 7, 7:22:43pm 2014
|
|
|
|
|
|
|
|
|
|
{{isotime "2006-01-02"}} = 2014-06-07
|
|
|
|
|
{{isotime "Mon 1506"}} = Sat 1914
|
|
|
|
|
{{isotime "01-Jan-06 03\_04\_05"}} = 07-Jun-2014 07\_22\_43
|
|
|
|
|
{{isotime "Hour15Year200603"}} = Hour19Year201407
|
|
|
|
|
</pre>
|
|
|
|
|
|
|
|
|
|
## Amazon Specific Functions
|
|
|
|
|
|
|
|
|
|
Specific to Amazon builders:
|
|
|
|
|
|