Remote Terraform State helper

This request comes from the need to separate small chunks of terrarofm configuration code to avoid terraform limit producing issue:

The "for_each" value depends on resource attributes that cannot be determined
until apply

I’m not sure if it is the right way, but for curiosity I like to know if terraspace can help as is or can implement a cross stacks/modules terraform state file contents temporary sharing (in memory) to avoid using cumbersome terraform_remote_state.

Example: having 2 stacks with totally S3 backend separated terraform state, if stack 2 need stack1 output to work, it is necessary to integrate using terraform_remote_state, e,.g:

data "terraform_remote_state" "stack1" {
  backend = "s3"
  config = {
    bucket  = stack1_rs_bucket
    region  = stack1_rs_region
    key     = stack1_rs_key
    profile = stack1_rs_profile
  }
}

As terraspace manage all stacks togheter, it probably can abstract terraform state management for stacks integration avoiding suboptimal terraform_remote_state mechanisms.

Solved using terraspace output helper

More details on these links:

Output Helper
Deploy Multiple Stacks (& output helper)
Dependencies Tfvars Considerations (& output helper)