packer-plugin-amazon icon indicating copy to clipboard operation
packer-plugin-amazon copied to clipboard

Setting null value on optional resources

Open mr-oz-09 opened this issue 2 years ago • 4 comments

When filing a bug, please include the following headings if possible. Any example text in this template can be deleted.

Overview of the Issue

I am trying to set null values on optional fields ( org_arns) and I am getting an error saying that null cannot be set for this value. I am trying to set this to null due to the fact when testing our branches we do not want to send the ami to the org rather to a single account for validation and testing. Once that is complete we would then send it to the org where every account would receive it.

Reproduction Steps

set value ami_org_arns in variables file to default = null

Plugin and Packer version

From packer version 1.2.6/1.2.7

Operating system and Environment details

Rhel8, win2019

Log Fragments and crash.log files

Error: null value is not allowed: [{{} ami_org_arns} {{} {{{{} 78}} 0xc000127bc0}}]

mr-oz-09 avatar Sep 27 '23 03:09 mr-oz-09

Will there be anyone reviewing this? This is becoming more of a pain to deal with which is making me reconsider using Packer for my Orgs AMI process.

mr-oz-09 avatar Dec 11 '23 17:12 mr-oz-09

Still running into this. https://developer.hashicorp.com/packer/docs/templates/hcl_templates/variables#a-variable-value-must-be-known .. this tells me that if the arg is optional, i should be able to set it as null. image

This shows as optional but I get the error above as It is not allowed!

mr-oz-09 avatar May 02 '24 21:05 mr-oz-09

also as a note i have updated to latest and greatest version of packer as well

mr-oz-09 avatar May 02 '24 21:05 mr-oz-09