Not empty array printed as empty
- Dominant language
- Go
- Stars
- 15.8k
- Forks
- 3.3k
- PR merge metrics
- PR metrics pending
Description
#### Overview of the Issue
```
build {
sources = ["source.amazon-ebs.nomad_ami"]
provisioner "shell-local" {
inline = [
"echo length: ${jsonencode(length( local.ami_regions ))}",
"echo AMI Regions: ${jsonencode(local.ami_regions)}",
]
}
```
Having this block I see output:
```
amazon-ebs.nomad_ami: length: 1
amazon-ebs.nomad_ami: AMI Regions: []
```
If ami_regions array is not empty it should be printed as [""]
#### Reproduction Steps
see above
### Packer version
v1.11.2
### Operating system and Environment details
```
Darwin Mac 24.6.0 Darwin Kernel Version 24.6.0: Mon Jul 14 11:28:30 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6030 arm64 arm Darwin
```
### Log Fragments and crash.log files
Contributor guide
Assessment
This issue has not been assessed yet.