Open SathyaBhat opened 2 years ago
This issue has been synced to JIRA for planning.
JIRA ID: HPR-780
This issue still persists on Packer v1.10.1. For those who end up here searching for a fix the workaround:
"packer-ubuntu-aws-${regex_replace(timestamp(), "[^a-zA-Z0-9-]", "")}"
Overview of the Issue
The EBS builder plugin points to the template engine which seems to be a legacy json template per URL. To make matters worse, one of the functions mentioned there, and in the AMI name validation,
clean_resource_name
doesn't seem to be valid for HCL2 per this discuss post , and trying to use the same example mentioned in the template engine results infunction "clean_resource_name" not defined
error. This should be corrected, either by means of corrected doc link, or a reference to something else that can generate a unique ami_nameSample template:
Reproduction Steps
Steps to reproduce this issue
Try to run
packer build .
with the template mentioned above. This results in errorPlugin and Packer version
From
packer version
Simplified Packer Buildfile
See above
Operating system and Environment details
OS, Architecture, and any other information you can provide about the environment.
Log Fragments and crash.log files
MacBook Pro (16-inch, 2021) running Apple M1 and macOS 12.6 (21G115)
Include appropriate log fragments. If the log is longer than a few dozen lines, please include the URL to the gist of the log or use the Github detailed format instead of posting it directly in the issue.
Set the env var
PACKER_LOG=1
for maximum log detail. See above