Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improper stack config causes stack module to poorly exit terraform #25

Closed
Gowiem opened this issue Apr 20, 2021 · 3 comments
Closed

Improper stack config causes stack module to poorly exit terraform #25

Gowiem opened this issue Apr 20, 2021 · 3 comments
Labels
bug 🐛 An issue with the system

Comments

@Gowiem
Copy link
Member

Gowiem commented Apr 20, 2021

Describe the Bug

This stack configuration:

import:
  - catalog/globals

vars:
  environment: automation

components:
  terraform:
    # account-settings:

causes this error:

image

Expected Behavior

I expect to get a runtime error that is useful in debugging what happened without enabling TF_LOG=1

Steps to Reproduce

Steps to reproduce the behavior:

  1. Use the above stack configuration.
  2. Pass it to the spacelift module or however else you consume terraform-yaml-stack-config
  3. Try a plan
  4. 💥

Screenshots

Here is the full error that I found after enabling TF_LOG:

image

@Gowiem Gowiem added the bug 🐛 An issue with the system label Apr 20, 2021
@aknysh
Copy link
Member

aknysh commented Apr 23, 2021

@Gowiem thanks for reporting this.
It's a known issue/feature.
We use a Go lib mergo which does not like declared but empty maps.

To fix that right now, use

components:
  terraform: {}

All maps that are empty, must be declared as {}.

Having said that, we'll look at how to improve the error handling without crashing the utils provider and terraform.

@Gowiem
Copy link
Member Author

Gowiem commented Apr 24, 2021

@aknysh Sounds good as long as we know about 👍

@aknysh
Copy link
Member

aknysh commented Oct 29, 2021

I'll close this for now.
A lot of new features added in #39
We can reopen if the issue persists

@aknysh aknysh closed this as completed Oct 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An issue with the system
Projects
None yet
Development

No branches or pull requests

2 participants