cloudposse / terraform-yaml-stack-config

Terraform module that loads an opinionated 'stack' configuration from local or remote YAML sources. It supports deep-merged variables, settings, ENV variables, backend config, and remote state outputs for Terraform and helmfile components.

Home Page:https://cloudposse.com/accelerate

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[remote-state] defaults not provided when stack is missing and ignore_errors is true

Nuru opened this issue · comments

commented

Describe the Bug

A clear and concise description of what the bug is.

Expected Behavior

A clear and concise description of what you expected to happen.

Steps to Reproduce

main.tf:

module "remote_state" {
  source  = "cloudposse/stack-config/yaml//modules/remote-state"
  version = "0.22.1"

  component = "missing"
  ignore_errors = true

  defaults = {
    example = "output"
  }
}

output "example" {
  value       = module.remote_state.outputs
}

Steps to reproduce the behavior:

  1. Using above main.tf, run terraform init && terraform apply -auto-approve
  2. Output should be
example = {
  "example" = "output"
}

Instead, no output is produced because module.remote_state.outputs is null.

Environment (please complete the following information):

Anything that will help us triage the bug will help. Here are some ideas:

  • Terraform version 1.1.6
  • cloudposse/utils v0.17.23