boltops-tools / terraspace

Terraspace: The Terraform Framework
https://terraspace.cloud
Apache License 2.0
678 stars 46 forks source link

custom config.build.dependency_words ability #268

Closed tongueroo closed 2 years ago

tongueroo commented 2 years ago

Summary

Introduce config.build.dependency_words config ability.

Docs: https://terraspace.cloud/docs/dependencies/tfvars/considerations/#dependency-words

Context

https://community.boltops.com/t/bug-introduced-in-2-2-0/952

How to Test

Here's some example code that can be use to test it.

config/helpers/custom_helper.rb

module Terraspace::Project::CustomHelper
  def list
    [{
      'name' => '1',
      'value' => '1'
    }]
  end
end

app/stacks/child/tfvars/dev.tfvars

<% list.each do |item| -%>
length<%= item['name'] %> = <%= output("demo.length") %>
<% end -%>

To test:

terraspace build child

Should build the tfvars file successfully

$ cat .terraspace-cache/us-west-2/dev/stacks/child/1-dev.auto.tfvars
 length1 = 3

Version Changes

Patch