I’m looking at converting some packer JSON configuration files to HCL2. I have been playing with the packer hcl2_upgrade
command with release 1.7.2 and have had success building an image with a new configuration file.
packer is recommending that a string like "{{isotime \"2006-01-02\"}}"
be changed to make use of the timestamp and formatdate functions. I found the example on the timestamp page but it doesn’t seem to work for me the same way:
$ packer console
> timestamp() # this is the statement I entered
> timestamp() # this is the response
> "{{timestamp()}}"
???????: Interpolation error
template: root:1: unexpected "(" in operand
> "{{timestamp}}"
> "1618833849"
> exit
$
I’m not even sure if I should be using packer console
to play with expressions like this. Am I doing something wrong?