diff --git a/config/append.go b/config/append.go index bf13534e7..a421df4a0 100644 --- a/config/append.go +++ b/config/append.go @@ -35,6 +35,11 @@ func Append(c1, c2 *Config) (*Config, error) { c.Atlas = c2.Atlas } + c.Terraform = c1.Terraform + if c2.Terraform != nil { + c.Terraform = c2.Terraform + } + if len(c1.Modules) > 0 || len(c2.Modules) > 0 { c.Modules = make( []*Module, 0, len(c1.Modules)+len(c2.Modules)) diff --git a/config/append_test.go b/config/append_test.go index 8d6258ecd..aecb80e66 100644 --- a/config/append_test.go +++ b/config/append_test.go @@ -87,6 +87,37 @@ func TestAppend(t *testing.T) { false, }, + + // Terraform block + { + &Config{ + Terraform: &Terraform{ + RequiredVersion: "A", + }, + }, + &Config{}, + &Config{ + Terraform: &Terraform{ + RequiredVersion: "A", + }, + }, + false, + }, + + { + &Config{}, + &Config{ + Terraform: &Terraform{ + RequiredVersion: "A", + }, + }, + &Config{ + Terraform: &Terraform{ + RequiredVersion: "A", + }, + }, + false, + }, } for i, tc := range cases {