0

I have this scenario:

StackA needs output from StackB So StackB will run before StackA when using terraspace up StackA all But I want to define different values for the variables in StackB, but inputing this in StackA.

Stack A

variable "endpoint" {
  description = "endpoint"
  type        = string
}

output.tf

variable "endpoint" {
  description = "endpoint"
  type        = string
  value       = this.endpoint
}

StackB

base.tfvars

endpoint = <%= output('stackA.endpoint', mock: 'endpoint_mock') %>

So, when I run StackA, I want to inject variable values to StackB in runtime. Maybe this is kind of confusing, so please fill free to ask anything!!

0 Answers0