atmos icon indicating copy to clipboard operation
atmos copied to clipboard

A YAML way of undefining a value without removing the key

Open nitrocode opened this issue 2 years ago • 3 comments

Have a question? Please checkout our Slack Community or visit our Slack Archive.

Slack Community

Describe the Feature

There isn't a way to null a value in YAML other than to remove the key by deleting the key or commenting it out.

I'd like to use some kind of null value like <NULL> in atmos YAML without having to remove the key

e.g.

components:
  terraform:
    ecr:
      vars:
        some_input: <NULL>

Expected Behavior

The some_input: <NULL> should omit some_input when the tfvars is generated

Use Case

See above

Describe Ideal Solution

See above

Alternatives Considered

Removing the key or commenting it out

Additional Context

N/A

nitrocode avatar Oct 24 '22 02:10 nitrocode

some_input: null not working? I think we used it all the time, and null will be set as TF variable values.

aknysh avatar Nov 03 '22 02:11 aknysh

I think @nitrocode means a way to not pass a variable, versus passing the variable as null.

osterman avatar Nov 22 '22 16:11 osterman

I think we could do something using !.

E.g.

some_input: !unset

osterman avatar Nov 23 '22 14:11 osterman