Skip to content

A YAML way of undefining a value without removing the key #227

Closed

Description

@nitrocode

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

Activity

  1. aknysh commented on Nov 3, 2022

    @aknysh
    Member

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

  2. osterman commented on Nov 22, 2022

    @osterman
    Member

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

  3. osterman commented on Nov 23, 2022

    @osterman
    Member

    I think we could do something using !.

    E.g.

    some_input: !unset
  4. changed the title [-]A YAML way of defining a null value without removing the key[/-] [+]A YAML way of undefining a value without removing the key[/+] on Nov 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions