Repository: chanzuckerberg/fogg
Pull request #474 (2020-05-18 16:43:14)

improve formatting of generated tf code
Collapse all vertical whitespaces (runs of \n) in generated code to reduce the number of whitespace-only diffs that fogg generates.

Post 0.12 the `terraform fmt` command [avoids managing vertical whitespace](https://github.com/hashicorp/terraform/issues/23223#issuecomment-547519852) (ie newlines). 

That decision combined with our use fo go templates, wherein is it at best annoying and at worse impossible to reliably manage vertical whitespace the way we want to means that we havegiven up on avoiding diffs with meaningless whitespace changes.

From here forward we will collapse all \n+ to \n in generated code. This will mostly only affect fogg.tf, which is exactly what we want.

### Test Plan
* [x] CI
* [ ] manually tested on shared-infra repo

### References
* https://github.com/hashicorp/terraform/issues/23223#issuecomment-547519852

codecov-io: # [Codecov](https://codecov.io/gh/chanzuckerberg/fogg/pull/474?src=pr&el=h1) Report
> Merging [#474](https://codecov.io/gh/chanzuckerberg/fogg/pull/474?src=pr&el=desc) into [master](https://codecov.io/gh/chanzuckerberg/fogg/commit/46ae83f781feffef09ebaed3411b95d28efbeafd&el=desc) will **increase** coverage by `0.09%`.
> The diff coverage is `83.33%`.

[![Impacted file tree graph](https://codecov.io/gh/chanzuckerberg/fogg/pull/474/graphs/tree.svg?width=650&height=150&src=pr&token=57DhtZ7g2A)](https://codecov.io/gh/chanzuckerberg/fogg/pull/474?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master     #474      +/-   ##
==========================================
+ Coverage   61.12%   61.22%   +0.09%     
==========================================
  Files          19       19              
  Lines        1955     1960       +5     
==========================================
+ Hits         1195     1200       +5     
  Misses        607      607              
  Partials      153      153              
```


| [Impacted Files](https://codecov.io/gh/chanzuckerberg/fogg/pull/474?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [apply/apply.go](https://codecov.io/gh/chanzuckerberg/fogg/pull/474/diff?src=pr&el=tree#diff-YXBwbHkvYXBwbHkuZ28=) | `64.02% <83.33%> (+0.65%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/chanzuckerberg/fogg/pull/474?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/chanzuckerberg/fogg/pull/474?src=pr&el=footer). Last update [46ae83f...d26ac6c](https://codecov.io/gh/chanzuckerberg/fogg/pull/474?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


Patch:
diff --git a/.reviewdog.yml b/.reviewdog.yml
index 4288de33..b10b1916 100644
--- a/.reviewdog.yml
+++ b/.reviewdog.yml
@@ -1,8 +1,8 @@
 runner:
   golangci:
-    cmd: ./bin/golangci-lint run --out-format=line-number
+    cmd: ./bin/golangci-lint run --out-format=line-number -v --timeout 5m
     errorformat:
       - '%E%f:%l:%c: %m'
       - '%E%f:%l: %m'
       - '%C%.%#'
-    level: warning
\ No newline at end of file
+    level: warning
diff --git a/.travis.yml b/.travis.yml
index 37cc7846..70967bc7 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -12,7 +12,7 @@ install:
   - mkdir bin # this is in theory supposed to exist already
   - curl -L -o $HOME/bin/buildevents https://github.com/honeycombio/buildevents/releases/latest/download/buildevents-linux-amd64
   - chmod 755 $HOME/bin/buildevents
-  - buildevents cmd $TRAVIS_BUILD_ID $STEP_SPAN_ID npm-install -- npm install -g snyk
+  # - buildevents cmd $TRAVIS_BUILD_ID $STEP_SPAN_ID npm-install -- npm install -g snyk
   - buildevents cmd $TRAVIS_BUILD_ID $STEP_SPAN_ID make-setup -- make setup
   - buildevents step $TRAVIS_BUILD_ID $STEP_SPAN_ID $STEP_START install
   - curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh| sh -s -- -b ~/bin
diff --git a/Makefile b/Makefile
index edc31659..a6dc24a7 100644
--- a/Makefile
+++ b/Makefile
@@ -24,7 +24,7 @@ lint: ## run the fast go linters
 .PHONY: lint
 
 lint-ci: ## run the fast go linters
-	./bin/reviewdog -conf .reviewdog.yml  -reporter=github-pr-review -tee
+	./bin/reviewdog -conf .reviewdog.yml  -reporter=github-pr-review -tee -level=info
 .PHONY: lint-ci
 
 lint-all: ## run the fast go linters
diff --git a/apply/apply.go b/apply/apply.go
index 4059fa50..d2070424 100644
--- a/apply/apply.go
+++ b/apply/apply.go
@@ -213,6 +213,14 @@ func applyTree(dest afero.Fs, source *packr.Box, common *packr.Box, targetBasePa
 			if e != nil {
 				return errs.WrapUser(e, "unable to apply template")
 			}
+
+			if targetExtension == ".tf" {
+				e = fmtHcl(dest, target, true)
+				if e != nil {
+					return errs.WrapUser(e, "unable to format HCL")
+				}
+			}
+
 		} else if extension == ".touch" {
 			e = touchFile(dest, target)
 			if e != nil {
@@ -251,21 +259,26 @@ func applyTree(dest afero.Fs, source *packr.Box, common *packr.Box, targetBasePa
 			logrus.Infof("%s copied", target)
 		}
 
-		if targetExtension == ".tf" {
-			e = fmtHcl(dest, target)
-			if e != nil {
-				return errs.WrapUser(e, "unable to format HCL")
-			}
-		}
 		return nil
 	})
 }
 
-func fmtHcl(fs afero.Fs, path string) error {
+// collapseLines will convert \n+ to \n to reduce spurious diffs in generated output
+// post 0.12 terraform fmt will not manage vertical whitespace
+// https://github.com/hashicorp/terraform/issues/23223#issuecomment-547519852
+func collapseLines(in []byte) []byte {
+	fmtRegex := regexp.MustCompile(`\n+`)
+	return fmtRegex.ReplaceAll(in, []byte("\n"))
+}
+
+func fmtHcl(fs afero.Fs, path string, collapse bool) error {
 	in, e := afero.ReadFile(fs, path)
 	if e != nil {
 		return errs.WrapUserf(e, "unable to read file %s", path)
 	}
+	if collapse {
+		in = collapseLines(in)
+	}
 	out := hclwrite.Format(in)
 	return afero.WriteReader(fs, path, bytes.NewReader(out))
 }
@@ -377,7 +390,7 @@ func applyModuleInvocation(fs afero.Fs, path, moduleAddress string, box packr.Bo
 	if e != nil {
 		return errs.WrapUser(e, "unable to apply template for main.tf")
 	}
-	e = fmtHcl(fs, filepath.Join(path, "main.tf"))
+	e = fmtHcl(fs, filepath.Join(path, "main.tf"), false)
 	if e != nil {
 		return errs.WrapUser(e, "unable to format main.tf")
 	}
@@ -393,7 +406,7 @@ func applyModuleInvocation(fs afero.Fs, path, moduleAddress string, box packr.Bo
 		return errs.WrapUser(e, "unable to apply template for outputs.tf")
 	}
 
-	e = fmtHcl(fs, filepath.Join(path, "outputs.tf"))
+	e = fmtHcl(fs, filepath.Join(path, "outputs.tf"), false)
 	if e != nil {
 		return errs.WrapUser(e, "unable to format outputs.tf")
 	}


Test patch:
diff --git a/apply/apply_test.go b/apply/apply_test.go
index c07fea9a..4d2cfd10 100644
--- a/apply/apply_test.go
+++ b/apply/apply_test.go
@@ -315,7 +315,7 @@ func TestFmtHcl(t *testing.T) {
 	in := strings.NewReader(before)
 	e := afero.WriteReader(fs, "foo.tf", in)
 	r.Nil(e)
-	e = fmtHcl(fs, "foo.tf")
+	e = fmtHcl(fs, "foo.tf", false)
 	r.Nil(e)
 	out, e := afero.ReadFile(fs, "foo.tf")
 	r.Nil(e)
diff --git a/apply/golden_file_test.go b/apply/golden_file_test.go
index ffeabcff..d3ad1a40 100644
--- a/apply/golden_file_test.go
+++ b/apply/golden_file_test.go
@@ -32,7 +32,6 @@ func TestIntegration(t *testing.T) {
 		{"v2_no_aws_provider_yaml"},
 		{"github_actions"},
 		{"circleci"},
-		{"component_kind"},
 		{"tfe_provider_yaml"},
 	}
 
diff --git a/testdata/bless_provider_yaml/terraform/accounts/foo/fogg.tf b/testdata/bless_provider_yaml/terraform/accounts/foo/fogg.tf
index 9a443ebc..8254c87f 100644
--- a/testdata/bless_provider_yaml/terraform/accounts/foo/fogg.tf
+++ b/testdata/bless_provider_yaml/terraform/accounts/foo/fogg.tf
@@ -1,51 +1,25 @@
 # Auto-generated by fogg. Do not edit
 # Make improvements in fogg, so that everyone can benefit.
 
-
-
-
-
-
-
-
 provider bless {
   version = "~>0.0.0"
   region  = "bar"
   profile = "foofoofoo"
 }
-
-
 provider bless {
   alias   = "a"
   version = "~>0.0.0"
   region  = "a"
   profile = "foofoofoo"
 }
-
 provider bless {
   alias   = "b"
   version = "~>0.0.0"
   region  = "b"
   profile = "foofoofoo"
 }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 terraform {
   required_version = "=1.1.1"
-
   backend s3 {
 
     bucket = "bucket"
@@ -56,23 +30,15 @@ terraform {
     profile = "foofoo"
 
   }
-
 }
-
 variable project {
   type    = string
   default = "foofoo"
 }
-
-
-
-
-
 variable owner {
   type    = string
   default = "foo@example.com"
 }
-
 # map of aws_accounts
 variable aws_accounts {
   type = map
@@ -82,12 +48,8 @@ variable aws_accounts {
 
   }
 }
-
-
-
 data terraform_remote_state global {
   backend = "s3"
-
   config = {
 
 
@@ -97,35 +59,23 @@ data terraform_remote_state global {
     region  = "region"
     profile = "foofoo"
 
-
   }
 }
-
-
-
-
-
-
 provider random {
   version = "~> 2.2"
 }
-
 provider template {
   version = "~> 2.1"
 }
-
 provider archive {
   version = "~> 1.3"
 }
-
 provider null {
   version = "~> 2.1"
 }
-
 provider local {
   version = "~> 1.4"
 }
-
 provider tls {
   version = "~> 2.1"
 }
diff --git a/testdata/bless_provider_yaml/terraform/envs/bar/bam/fogg.tf b/testdata/bless_provider_yaml/terraform/envs/bar/bam/fogg.tf
index 447241f9..b6912828 100644
--- a/testdata/bless_provider_yaml/terraform/envs/bar/bam/fogg.tf
+++ b/testdata/bless_provider_yaml/terraform/envs/bar/bam/fogg.tf
@@ -1,52 +1,26 @@
 # Auto-generated by fogg. Do not edit
 # Make improvements in fogg, so that everyone can benefit.
 
-
-
-
-
-
-
-
 provider bless {
   version = "~>0.0.0"
   region  = "bar"
   profile = "foofoofoo"
 }
-
-
 provider bless {
   alias   = "a"
   version = "~>0.0.0"
   region  = "a"
   profile = "foofoofoo"
 }
-
 provider bless {
   alias   = "b"
   version = "~>0.0.0"
   region  = "b"
   profile = "foofoofoo"
 }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 terraform {
   required_version = "~>1.1.1"
 
-
   backend s3 {
 
     bucket = "bucket"
@@ -57,33 +31,23 @@ terraform {
     profile = "foofoo"
 
   }
-
 }
-
 variable env {
   type    = string
   default = "bar"
 }
-
 variable project {
   type    = string
   default = "foofoo"
 }
-
-
-
 variable component {
   type    = string
   default = "bam"
 }
-
-
-
 variable owner {
   type    = string
   default = "foo@example.com"
 }
-
 variable tags {
   type = map(string)
   default = {
@@ -94,12 +58,8 @@ variable tags {
     managedBy = "terraform"
   }
 }
-
-
-
 data terraform_remote_state global {
   backend = "s3"
-
   config = {
 
 
@@ -109,20 +69,11 @@ data terraform_remote_state global {
     region  = "region"
     profile = "foofoo"
 
-
   }
 }
-
-
-
-
-
-
 # remote state for accounts
-
 data terraform_remote_state foo {
   backend = "s3"
-
   config = {
 
 
@@ -132,11 +83,8 @@ data terraform_remote_state foo {
     region  = "region"
     profile = "foofoo"
 
-
   }
 }
-
-
 # map of aws_accounts
 variable aws_accounts {
   type = map
@@ -146,27 +94,21 @@ variable aws_accounts {
 
   }
 }
-
 provider random {
   version = "~> 2.2"
 }
-
 provider template {
   version = "~> 2.1"
 }
-
 provider archive {
   version = "~> 1.3"
 }
-
 provider null {
   version = "~> 2.1"
 }
-
 provider local {
   version = "~> 1.4"
 }
-
 provider tls {
   version = "~> 2.1"
 }
diff --git a/testdata/bless_provider_yaml/terraform/global/fogg.tf b/testdata/bless_provider_yaml/terraform/global/fogg.tf
index 56a0884f..28000f22 100644
--- a/testdata/bless_provider_yaml/terraform/global/fogg.tf
+++ b/testdata/bless_provider_yaml/terraform/global/fogg.tf
@@ -1,47 +1,23 @@
 # Auto-generated by fogg. Do not edit
 # Make improvements in fogg, so that everyone can benefit.
 
-
-
-
-
-
-
-
 provider bless {
   version = "~>0.0.0"
   region  = "bar"
   profile = "foofoofoo"
 }
-
-
 provider bless {
   alias   = "a"
   version = "~>0.0.0"
   region  = "a"
   profile = "foofoofoo"
 }
-
 provider bless {
   alias   = "b"
   version = "~>0.0.0"
   region  = "b"
   profile = "foofoofoo"
 }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 terraform {
   required_version = "~>1.1.1"
 
@@ -56,31 +32,22 @@ terraform {
 
   }
 }
-
 variable env {
   type    = string
   default = ""
 }
-
 variable project {
   type    = string
   default = "foofoo"
 }
-
-
-
 variable component {
   type    = string
   default = "global"
 }
-
-
-
 variable owner {
   type    = string
   default = "foo@example.com"
 }
-
 variable tags {
   type = map(string)
   default = {
@@ -91,30 +58,21 @@ variable tags {
     managedBy = "terraform"
   }
 }
-
-
-
-
 provider random {
   version = "~> 2.2"
 }
-
 provider template {
   version = "~> 2.1"
 }
-
 provider archive {
   version = "~> 1.3"
 }
-
 provider null {
   version = "~> 2.1"
 }
-
 provider local {
   version = "~> 1.4"
 }
-
 provider tls {
   version = "~> 2.1"
 }
diff --git a/testdata/circleci/terraform/global/fogg.tf b/testdata/circleci/terraform/global/fogg.tf
index 29a7d5ca..7138209c 100644
--- a/testdata/circleci/terraform/global/fogg.tf
+++ b/testdata/circleci/terraform/global/fogg.tf
@@ -1,22 +1,5 @@
 # Auto-generated by fogg. Do not edit
 # Make improvements in fogg, so that everyone can benefit.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 terraform {
   required_version = "~>1.1.1"
 
@@ -31,31 +14,22 @@ terraform {
 
   }
 }
-
 variable env {
   type    = string
   default = ""
 }
-
 variable project {
   type    = string
   default = "foo"
 }
-
-
-
 variable component {
   type    = string
   default = "global"
 }
-
-
-
 variable owner {
   type    = string
   default = "foo@example.com"
 }
-
 variable tags {
   type = map(string)
   default = {
@@ -66,30 +40,21 @@ variable tags {
     managedBy = "terraform"
   }
 }
-
-
-
-
 provider random {
   version = "~> 2.2"
 }
-
 provider template {
   version = "~> 2.1"
 }
-
 provider archive {
   version = "~> 1.3"
 }
-
 provider null {
   version = "~> 2.1"
 }
-
 provider local {
   version = "~> 1.4"
 }
-
 provider tls {
   version = "~> 2.1"
 }
diff --git a/testdata/component_kind/.fogg-version b/testdata/component_kind/.fogg-version
deleted file mode 100644
index 2d5cfc01..00000000
--- a/testdata/component_kind/.fogg-version
+++ /dev/null
@@ -1,1 +0,0 @@
-undefined+undefined+dirty
\ No newline at end of file
diff --git a/testdata/component_kind/.gitattributes b/testdata/component_kind/.gitattributes
deleted file mode 100644
index ebf21819..00000000
--- a/testdata/component_kind/.gitattributes
+++ /dev/null
@@ -1,5 +0,0 @@
-fogg.tf linguist-generated
-Makefile linguist-generated
-.travis.yml linguist-generated
-.circleci/config.yml linguist-generated
-.terraformignore linguist-generated
diff --git a/testdata/component_kind/.gitignore b/testdata/component_kind/.gitignore
deleted file mode 100644
index 69565ae8..00000000
--- a/testdata/component_kind/.gitignore
+++ /dev/null
@@ -1,34 +0,0 @@
-# Auto-generated by fogg. Do not edit
-# Make improvements in fogg, so that everyone can benefit.
-
-# Compiled files
-*.tfstate
-*.tfstate.*.backup
-*.tfstate.backup
-*tfvars
-
-# Module directory
-.terraform/
-
-# Pycharm folder
-.idea
-
-# Editor Swap Files
-*.swp
-*.swo
-*.swn
-*.swm
-*.swl
-*.swk
-
-.fogg
-/terraform.d
-
-.DS_Store
-.vscode
-.envrc
-
-buildevents.plan
-check-plan.output
-
-venv
diff --git a/testdata/component_kind/.terraform.d/plugin-cache/.gitignore b/testdata/component_kind/.terraform.d/plugin-cache/.gitignore
deleted file mode 100644
index 504d4d91..00000000
--- a/testdata/component_kind/.terraform.d/plugin-cache/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-# Auto-generated by fogg. Do not edit
-# Make improvements in fogg, so that everyone can benefit.
-
-*
-!.gitignore
diff --git a/testdata/component_kind/.terraformignore b/testdata/component_kind/.terraformignore
deleted file mode 100644
index 92a763ce..00000000
--- a/testdata/component_kind/.terraformignore
+++ /dev/null
@@ -1,12 +0,0 @@
-
-# Auto-generated by fogg. Do not edit
-# Make improvements in fogg, so that everyone can benefit.
-
-
-.fogg/
-.git/
-.terraform.d/
-terraform/accounts/acct1/.terraform/plugins/
-terraform/envs/env1/foo/.terraform/plugins/
-terraform/global/.terraform/plugins/
-
diff --git a/testdata/component_kind/Makefile b/testdata/component_kind/Makefile
deleted file mode 100644
index bbf4c931..00000000
--- a/testdata/component_kind/Makefile
+++ /dev/null
@@ -1,146 +0,0 @@
-# Auto-generated by fogg. Do not edit
-# Make improvements in fogg, so that everyone can benefit.
-
-include scripts/common.mk
-
-ENVS=env1
-MODULES=
-ACCOUNTS=acct1
-
-all: check
-
-setup: ## set up working directory by installing dependencies
-	curl -s https://raw.githubusercontent.com/chanzuckerberg/fogg/master/download.sh | bash -s -- -b .fogg/bin vundefined+undefined+dirty
-	.fogg/bin/fogg setup
-.PHONY: setup
-
-lint: lint-terraform ## lint the code in this repo
-.PHONY: lint
-
-lint-terraform: lint-accounts lint-envs lint-modules ## lint the terraform code in this repo
-.PHONY: lint-terraform
-
-lint-accounts:  ## lint the terrarform code in terraform/accounts
-	@for account in $(ACCOUNTS); do \
-		$(MAKE) -C terraform/accounts/$$account lint || exit $$?; \
-	done
-.PHONY: lint-accounts
-
-lint-envs: ## lint the terraform code in terraform/envs
-	@for env in $(ENVS); do \
-		$(MAKE) -C terraform/envs/$$env lint || exit $$?; \
-	done; \
-	$(MAKE) -C terraform/global lint || exit $$?
-.PHONY: lint-envs
-
-lint-modules: ## lint the terraform code in terraform/modules
-	@for module in $(MODULES); do \
-		$(MAKE) -C terraform/modules/$$module lint || exit $$?; \
-	done
-.PHONY: lint-modules
-
-fmt: fmt-accounts fmt-envs fmt-global fmt-modules ## format code in this repo
-.PHONY: fmt
-
-fmt-accounts: ## format code in terraform/accounts
-	@for account in $(ACCOUNTS); do \
-		$(MAKE) -C terraform/accounts/$$account fmt || exit $$?; \
-	done
-.PHONY: fmt-accounts
-
-fmt-envs: ## format the code in teraform/envs
-	@for env in $(ENVS); do \
-		$(MAKE) -C terraform/envs/$$env fmt || exit $$?; \
-	done
-.PHONY: fmt-envs
-
-fmt-global: ## format the code in terraform/global
-	$(MAKE) -C terraform/global fmt || exit $$?
-.PHONY: fmt-global
-
-fmt-modules:  ## format the code in terraform/modules
-	@for module in $(MODULES); do \
-		$(MAKE) -C terraform/modules/$$module fmt || exit $$?; \
-	done
-.PHONY: fmt-modules
-
-docs: docs-envs docs-global docs-modules ## update docs
-.PHONY: docs
-
-docs-accounts: ## update docs in terraform/accounts
-	@for account in $(ACCOUNTS); do \
-		$(MAKE) -C terraform/accounts/$$account docs || exit $$?; \
-	done
-.PHONY: docs-accounts
-
-docs-envs: ## update the docs in terraform/envs
-	@for env in $(ENVS); do \
-		$(MAKE) -C terraform/envs/$$env docs || exit $$?; \
-	done
-.PHONY: docs-envs
-
-docs-global: ## update the docs in terraform/global
-	$(MAKE) -C terraform/global docs || exit $$?;
-.PHONY: docs-global
-
-docs-modules: ## update the docs in terraform/modules
-	@for module in $(MODULES); do \
-		$(MAKE) -C terraform/modules/$$module docs || exit $$?; \
-	done
-.PHONY: docs-modules
-
-test:
-.PHONY: test
-
-check: check-plan check-docs ## check all code in the repo
-.PHONY: check
-
-check-plan: check-plan-accounts check-plan-envs check-plan-global ## check terraform plans across all components
-.PHONY: check-plan
-
-check-plan-accounts: ## check terraform plans in terraform/accounts
-	@for account in $(ACCOUNTS); do \
-		$(MAKE) -C terraform/accounts/$$account check-plan || exit $$?; \
-	done
-.PHONY: check-plan-accounts
-
-check-plan-envs: ## check terraform plans in terraform/envs
-	@for env in $(ENVS); do \
-		$(MAKE) -C terraform/envs/$$env check-plan || exit $$?; \
-	done
-.PHONY: check-plan-envs
-
-check-plan-global: ## check terraform plans in terraform/global
-	$(MAKE) -C terraform/global check-plan || exit $$?
-.PHONY: check-plan-global
-
-check-docs: ## check terraform docs
-	@for mod in $(MODULES); do \
-		$(MAKE) -C terraform/modules/$$module check-docs || exit $$?; \
-	done
-.PHONY: check-docs
-
-clean: clean-accounts clean-envs clean-global ## clean the repo
-.PHONY: clean
-
-clean-accounts: ## clean in terraform/accounts
-	@for account in $(ACCOUNTS); do \
-		$(MAKE) -C terraform/accounts/$$account clean || exit $$?; \
-	done
-.PHONY: clean-accounts
-
-clean-envs: ## clean in terraform/envs
-	@for env in $(ENVS); do \
-		$(MAKE) -C terraform/envs/$$env clean || exit $$?; \
-	done
-.PHONY: clean-envs
-
-clean-global: ## clean in terraform/global
-	$(MAKE) -C terraform/global clean || exit $$?
-.PHONY: clean-global
-
-
-help: ## display help for this makefile
-	@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
-.PHONY: help
-
diff --git a/testdata/component_kind/README.md b/testdata/component_kind/README.md
deleted file mode 100644
index e69de29b..00000000
diff --git a/testdata/component_kind/scripts/common.mk b/testdata/component_kind/scripts/common.mk
deleted file mode 100644
index fd2985b6..00000000
--- a/testdata/component_kind/scripts/common.mk
+++ /dev/null
@@ -1,31 +0,0 @@
-# Auto-generated by fogg. Do not edit
-# Make improvements in fogg, so that everyone can benefit.
-
-SHELL=/bin/bash -o pipefail
-TF_VARS := $(patsubst %,-e%,$(filter TF_VAR_%,$(.VARIABLES)))
-REPO_ROOT := $(shell git rev-parse --show-toplevel)
-REPO_RELATIVE_PATH := $(shell git rev-parse --show-prefix)
-AUTO_APPROVE := false
-
-TFENV_DIR ?= $(REPO_ROOT)/.fogg/tfenv
-export PATH :=$(TFENV_DIR)/libexec:$(TFENV_DIR)/versions/$(TERRAFORM_VERSION)/:$(REPO_ROOT)/.fogg/bin:$(PATH)
-export TF_PLUGIN_CACHE_DIR=$(REPO_ROOT)/.terraform.d/plugin-cache
-export TF_IN_AUTOMATION=1
-terraform_command ?= $(TFENV_DIR)/versions/$(TERRAFORM_VERSION)/terraform
-
-ifeq ($(TF_BACKEND_KIND),remote)
-	REFRESH := true
-else
-	REFRESH := false
-endif
-
-
-tfenv: ## install the tfenv tool
-	@if [ ! -d ${TFENV_DIR} ]; then \
-		git clone -q https://github.com/chanzuckerberg/tfenv.git $(TFENV_DIR); \
-	fi
-.PHONY: tfenv
-
-terraform: tfenv ## ensure that the proper version of terraform is installed
-	@${TFENV_DIR}/bin/tfenv install $(TERRAFORM_VERSION)
-.PHONY: terraform
diff --git a/testdata/component_kind/scripts/component.mk b/testdata/component_kind/scripts/component.mk
deleted file mode 100644
index d4e05673..00000000
--- a/testdata/component_kind/scripts/component.mk
+++ /dev/null
@@ -1,132 +0,0 @@
-# Auto-generated by fogg. Do not edit
-# Make improvements in fogg, so that everyone can benefit.
-
-SELF_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
-CHECK_PLANFILE_PATH ?= check-plan.output
-
-include $(SELF_DIR)/common.mk
-
-all:
-.PHONY: all
-
-setup: ## set up local dependencies for this repo
-	$(MAKE) -C $(REPO_ROOT) setup
-.PHONY: setup
-
-check: lint check-plan ## run all checks for this component
-.PHONY: check
-
-fmt: terraform ## format code in this component
-	$(terraform_command) fmt $(TF_ARGS)
-.PHONY: fmt
-
-lint: lint-terraform-fmt lint-tflint ## run all linters for this component
-.PHONY: lint
-
-lint-tflint: ## run the tflint linter for this component
-	@printf "tflint: "
-ifeq ($(TFLINT_ENABLED),1)
-	@tflint || exit $$?;
-else
-	@echo "disabled"
-endif
-.PHONY: lint-tflint
-
-lint-terraform-fmt: terraform ## run `terraform fmt` in check mode
-	@printf "fmt check: "
-	@for f in $(TF); do \
-		printf . \
-		$(terraform_command) fmt $(TF_ARGS) --check=true --diff=true $$f || exit $$? ; \
-	done
-	@echo
-.PHONY: lint-terraform-fmt
-
-check-auth: check-auth-aws check-auth-heroku ## check that authentication is properly set up for this component
-.PHONY: check-auth
-
-check-auth-aws:
-	@for p in $(AWS_BACKEND_PROFILE) $(AWS_PROVIDER_PROFILE); do \
-		aws --profile $$p sts get-caller-identity > /dev/null || (echo "AWS AUTH error. This component is configured to use a profile named '$$p'. Please add one to your ~/.aws/config" && exit -1); \
-	done
-.PHONY: check-auth-aws
-
-check-auth-heroku:
-ifeq ($(HEROKU_PROVIDER),1)
-	@echo "Checking heroku auth..."
-	@if command heroku >/dev/null; then \
-		heroku auth:whoami || timeout 15 heroku auth:login || (echo "Not authenticated to heroku. For SSO accounts, run 'heroku login', for non-sso accounts set HEROKU_EMAIL and HEROKU_API_KEY" && exit -1); \
-	else \
-		echo "Heroku CLI not installed, can't check auth."; \
-	fi
-endif
-.PHONY: check-auth-heroku
-
-refresh:
-	@if [ "$(TF_BACKEND_KIND)" != "remote" ]; then \
-		$(terraform_command) refresh $(TF_ARGS); \
-		date +%s > .terraform/refreshed_at; \
-	else \
-		echo "remote backend does not support the refresh command, skipping"; \
-	fi
-.PHONY: refresh
-
-refresh-cached:
-	@last_refresh=`cat .terraform/refreshed_at 2>/dev/null || echo '0'`; \
-	current_time=`date +%s`; \
-	if (( current_time - last_refresh > 600 )); then \
-		echo "It has been awhile since the last refresh. It is time."; \
-		$(MAKE) refresh; \
-	else \
-		echo "Not time to refresh yet."; \
-	fi;
-.PHONY: refresh-cached
-
-plan: check-auth init fmt refresh-cached ## run a terraform plan
-	$(terraform_command) plan $(TF_ARGS) -refresh=$(REFRESH) -input=false
-.PHONY: plan
-
-apply: check-auth init refresh ## run a terraform apply
-	@$(terraform_command) apply $(TF_ARGS) -refresh=$(REFRESH) -auto-approve=$(AUTO_APPROVE)
-.PHONY: apply
-
-docs:
-	echo
-.PHONY: docs
-
-clean: ## clean modules and plugins for this component
-	-rm -rfv .terraform/modules
-	-rm -rfv .terraform/plugins
-.PHONY: clean
-
-test:
-.PHONY: test
-
-init: terraform check-auth ## run terraform init for this component
-	@$(terraform_command) init -input=false
-.PHONY: init
-
-check-plan: check-auth init refresh-cached ## run a terraform plan and check that it does not fail
-	@if [ "$(TF_BACKEND_KIND)" != "remote" ]; then \
-		$(terraform_command) plan $(TF_ARGS) -detailed-exitcode -lock=false -out=$(CHECK_PLANFILE_PATH) ; \
-		ERR=$$?; \
-		if [ -n "$(BUILDEVENT_FILE)" ]; then \
-			fogg exp entropy -f $(CHECK_PLANFILE_PATH) -o $(BUILDEVENT_FILE) ; \
-		fi; \
-		rm $(CHECK_PLANFILE_PATH) 2>/dev/null; \
-	else \
-		$(terraform_command) plan $(TF_ARGS) -detailed-exitcode -lock=false; \
-		ERR=$$?; \
-	fi; \
-	if [ $$ERR -eq 0 ] ; then \
-		echo "Success"; \
-	elif [ $$ERR -eq 1 ] ; then \
-		echo "Error in plan execution."; \
-		exit 1; \
-	elif [ $$ERR -eq 2 ] ; then \
-		echo "Diff";  \
-	fi;
-.PHONY: check-plan
-
-run: check-auth ## run an arbitrary terraform command, CMD. ex `make run CMD='show'`
-	@$(terraform_command) $(CMD)
-.PHONY: run
diff --git a/testdata/component_kind/scripts/failed_output_only b/testdata/component_kind/scripts/failed_output_only
deleted file mode 100644
index a21d3dab..00000000
--- a/testdata/component_kind/scripts/failed_output_only
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/sh
-
-t=`mktemp` && \
-exec $@  2>&1 > $t || \
-(
-    a=$?;
-    echo $a;
-    cat $t;
-    rm $t;
-    exit $a
-)
-
-
diff --git a/testdata/component_kind/scripts/module.mk b/testdata/component_kind/scripts/module.mk
deleted file mode 100644
index d8353c0d..00000000
--- a/testdata/component_kind/scripts/module.mk
+++ /dev/null
@@ -1,49 +0,0 @@
-# Auto-generated by fogg. Do not edit
-# Make improvements in fogg, so that everyone can benefit.
-
-SELF_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
-
-include $(SELF_DIR)/common.mk
-
-all: fmt lint doc
-.PHONY: all
-
-fmt: terraform ## run terraform fmt on this module
-	@printf "fmt: ";
-	@for f in $(TF); do printf .; $(terraform_command) fmt $(TF_ARGS) $$f; done
-	@echo
-.PHONY: fmt
-
-check: lint check-docs ## run all checks on this module
-.PHONY: check
-
-lint: lint-tf ## run all linters on this module
-.PHONY: lint
-
-lint-tf: terraform ## run terraform linters on this module
-	@printf "fmt: ";
-	@for f in $(TF); do \
-	  printf .; $(terraform_command) fmt $(TF_ARGS) --check=true --diff=true || exit $$? ; \
-	done
-	@echo
-.PHONY: lint-tf
-
-readme: ## update this module's README.md 
-	bash $(REPO_ROOT)/scripts/update-readme.sh update
-.PHONY: readme
-
-docs: readme ## update all docs for this module
-.PHONY: docs
-
-check-docs: ## check that this module's docs are up-to-date
-	@bash $(REPO_ROOT)/scripts/update-readme.sh check; \
-	if [ ! $$? -eq 0 ];  then \
-		echo "Docs are out of date, run \`make docs\`"; \
-	fi
-.PHONY: check-docs
-
-clean:
-.PHONY: clean
-
-test:
-.PHONY: test
diff --git a/testdata/component_kind/scripts/update-readme.sh b/testdata/component_kind/scripts/update-readme.sh
deleted file mode 100644
index abe8fb47..00000000
--- a/testdata/component_kind/scripts/update-readme.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/bash
-
-# Auto-generated by fogg. Do not edit
-# Make improvements in fogg, so that everyone can benefit.
-
-# I would have written this directly in the Makefile, but that was difficult.
-
-CMD="$1"
-
-TMP=`mktemp`
-TMP2=`mktemp`
-terraform-docs md . > "$TMP"
-sed '/^<!-- START -->$/,/<!-- END -->/{//!d;}' README.md | sed "/^<!-- START -->$/r $TMP" > $TMP2
-
-case "$CMD" in
-    update)
-        mv $TMP2 README.md
-    ;;
-    check)
-        diff $TMP2 README.md >/dev/null
-    ;;
-esac
-
-exit $?
diff --git a/testdata/component_kind/terraform/accounts/acct1/Makefile b/testdata/component_kind/terraform/accounts/acct1/Makefile
deleted file mode 100644
index dec02ad3..00000000
--- a/testdata/component_kind/terraform/accounts/acct1/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
-# Auto-generated by fogg. Do not edit
-# Make improvements in fogg, so that everyone can benefit.
-
-export TERRAFORM_VERSION := 1.1.1
-export TFLINT_ENABLED := 0
-export TF_PLUGIN_CACHE_DIR := ../../..//.terraform.d/plugin-cache
-export TF_BACKEND_KIND := remote
-
-
-
-
-include ../../..//scripts/component.mk
-
-
-help: ## display help for this makefile
-	@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
-.PHONY: help
-
diff --git a/testdata/component_kind/terraform/accounts/acct1/fogg.tf b/testdata/component_kind/terraform/accounts/acct1/fogg.tf
deleted file mode 100644
index faf875a3..00000000
--- a/testdata/component_kind/terraform/accounts/acct1/fogg.tf
+++ /dev/null
@@ -1,105 +0,0 @@
-# Auto-generated by fogg. Do not edit
-# Make improvements in fogg, so that everyone can benefit.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-terraform {
-  required_version = "=1.1.1"
-
-  backend remote {
-
-    hostname     = "tfe.example.com"
-    organization = "test-org"
-    workspaces {
-      name = "accounts-acct1"
-    }
-
-  }
-
-}
-
-variable project {
-  type    = string
-  default = "foo"
-}
-
-
-
-
-
-variable owner {
-  type    = string
-  default = "foo@example.com"
-}
-
-# map of aws_accounts
-variable aws_accounts {
-  type = map
-  default = {
-
-
-
-  }
-}
-
-
-
-data terraform_remote_state global {
-  backend = "remote"
-
-  config = {
-
-
-    hostname     = "tfe.example.com"
-    organization = "test-org"
-    workspaces = {
-      name = "global"
-    }
-
-
-  }
-}
-
-
-
-
-
-
-provider random {
-  version = "~> 2.2"
-}
-
-provider template {
-  version = "~> 2.1"
-}
-
-provider archive {
-  version = "~> 1.3"
-}
-
-provider null {
-  version = "~> 2.1"
-}
-
-provider local {
-  version = "~> 1.4"
-}
-
-provider tls {
-  version = "~> 2.1"
-}
diff --git a/testdata/component_kind/terraform/accounts/acct1/terraform.d b/testdata/component_kind/terraform/accounts/acct1/terraform.d
deleted file mode 120000
index 29617d28..00000000
--- a/testdata/component_kind/terraform/accounts/acct1/terraform.d
+++ /dev/null
@@ -1,1 +0,0 @@
-../../../terraform.d
\ No newline at end of file
diff --git a/testdata/component_kind/terraform/envs/env1/Makefile b/testdata/component_kind/terraform/envs/env1/Makefile
deleted file mode 100644
index 398224a7..00000000
--- a/testdata/component_kind/terraform/envs/env1/Makefile
+++ /dev/null
@@ -1,51 +0,0 @@
-# Auto-generated by fogg. Do not edit
-# Make improvements in fogg, so that everyone can benefit.
-
-COMPONENTS=bar foo
-
-all:
-.PHONY: all
-
-lint: ## lint all components in the env
-	@for c in $(COMPONENTS); do \
-		echo $$c; \
-		$(MAKE) -C $$c lint || exit $$? ; \
-	done
-.PHONY: lint
-
-fmt: ## format terraform code in all components in this env
-	@for c in $(COMPONENTS); do \
-		echo $$c; \
-		$(MAKE) -C $$c fmt || exit $$? ; \
-	done
-.PHONY: fmt
-
-check-plan: ## check all plans in this environment
-	@for c in $(COMPONENTS); do \
-		echo $$c; \
-		$(MAKE) -C $$c check-plan || exit $$? ; \
-	done
-.PHONY: check-plan
-
-docs: ## generate docs for all components in this env
-	@for c in $(COMPONENTS); do \
-		echo $$c; \
-		$(MAKE) -C $$c docs || exit $$? ; \
-	done
-.PHONY: docs
-
-clean: ## clean all components in this env
-	@for c in $(COMPONENTS); do \
-		echo $$c; \
-		$(MAKE) -C $$c clean || exit $$? ; \
-	done
-.PHONY: clean
-
-test:
-.PHONY: test
-
-
-help: ## display help for this makefile
-	@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
-.PHONY: help
-
diff --git a/testdata/component_kind/terraform/envs/env1/README.md b/testdata/component_kind/terraform/envs/env1/README.md
deleted file mode 100644
index e69de29b..00000000
diff --git a/testdata/component_kind/terraform/envs/env1/bar/apply.go b/testdata/component_kind/terraform/envs/env1/bar/apply.go
deleted file mode 100644
index 4059fa50..00000000
--- a/testdata/component_kind/terraform/envs/env1/bar/apply.go
+++ /dev/null
@@ -1,465 +0,0 @@
-package apply
-
-import (
-	"bytes"
-	"fmt"
-	"io"
-	"io/ioutil"
-	"net/url"
-	"os"
-	"path/filepath"
-	"regexp"
-	"sort"
-	"strings"
-
-	v2 "github.com/chanzuckerberg/fogg/config/v2"
-	"github.com/chanzuckerberg/fogg/errs"
-	"github.com/chanzuckerberg/fogg/plan"
-	"github.com/chanzuckerberg/fogg/templates"
-	"github.com/chanzuckerberg/fogg/util"
-	"github.com/gobuffalo/packr"
-	getter "github.com/hashicorp/go-getter"
-	"github.com/hashicorp/hcl2/hclwrite"
-	"github.com/sirupsen/logrus"
-	"github.com/spf13/afero"
-)
-
-const rootPath = "terraform"
-
-// Apply will run a plan and apply all the changes to the current repo.
-func Apply(fs afero.Fs, conf *v2.Config, tmp *templates.T, upgrade bool) error {
-	if !upgrade {
-		toolVersion, err := util.VersionString()
-		if err != nil {
-			return err
-		}
-		versionChange, repoVersion, _ := checkToolVersions(fs, toolVersion)
-		if versionChange {
-			return errs.NewUserf("fogg version (%s) is different than version currently used to manage repo (%s). To upgrade add --upgrade.", toolVersion, repoVersion)
-		}
-	}
-	p, err := plan.Eval(conf)
-	if err != nil {
-		return errs.WrapUser(err, "unable to evaluate plan")
-	}
-
-	e := applyRepo(fs, p, &tmp.Repo, &tmp.Common)
-	if e != nil {
-		return errs.WrapUser(e, "unable to apply repo")
-	}
-
-	if p.TravisCI.Enabled {
-		e = applyTree(fs, &tmp.TravisCI, &tmp.Common, "", p.TravisCI)
-		if e != nil {
-			return errs.WrapUser(e, "unable to apply travis ci")
-		}
-	}
-
-	if p.CircleCI.Enabled {
-		e = applyTree(fs, &tmp.CircleCI, &tmp.Common, "", p.CircleCI)
-		if e != nil {
-			return errs.WrapUser(e, "unable to apply CircleCI")
-		}
-	}
-
-	if p.GitHubActionsCI.Enabled {
-		e = applyTree(fs, &tmp.GitHubActionsCI, &tmp.Common, ".github", p.GitHubActionsCI)
-		if e != nil {
-			return errs.WrapUser(e, "unable to apply GitHub Actions CI")
-		}
-	}
-
-	e = applyAccounts(fs, p, &tmp.Account, &tmp.Common)
-	if e != nil {
-		return errs.WrapUser(e, "unable to apply accounts")
-	}
-
-	e = applyEnvs(fs, p, &tmp.Env, tmp.Components, &tmp.Common)
-	if e != nil {
-		return errs.WrapUser(e, "unable to apply envs")
-	}
-
-	e = applyGlobal(fs, p.Global, &tmp.Global, &tmp.Common)
-	if e != nil {
-		return errs.WrapUser(e, "unable to apply global")
-	}
-
-	e = applyModules(fs, p.Modules, &tmp.Module, &tmp.Common)
-	return errs.WrapUser(e, "unable to apply modules")
-}
-
-func checkToolVersions(fs afero.Fs, current string) (bool, string, error) {
-	f, e := fs.Open(".fogg-version")
-	if e != nil {
-		return false, "", errs.WrapUser(e, "unable to open .fogg-version file")
-	}
-	reader := io.ReadCloser(f)
-	defer reader.Close()
-
-	b, e := ioutil.ReadAll(reader)
-	if e != nil {
-		return false, "", errs.WrapUser(e, "unable to read .fogg-version file")
-	}
-	repoVersion := strings.TrimSpace(string(b))
-	changed, e := versionIsChanged(repoVersion, current)
-	return changed, repoVersion, e
-}
-
-func versionIsChanged(repo string, tool string) (bool, error) {
-	repoVersion, repoSha, repoDirty := util.ParseVersion(repo)
-	toolVersion, toolSha, toolDirty := util.ParseVersion(tool)
-
-	if repoDirty || toolDirty {
-		return true, nil
-	}
-
-	if (repoSha != "" || toolSha != "") && repoSha != toolSha {
-		return true, nil
-	}
-
-	return toolVersion.NE(repoVersion), nil
-}
-
-func applyRepo(fs afero.Fs, p *plan.Plan, repoTemplates, commonTemplates *packr.Box) error {
-	return applyTree(fs, repoTemplates, commonTemplates, "", p)
-}
-
-func applyGlobal(fs afero.Fs, p plan.Component, repoBox, commonBox *packr.Box) error {
-	logrus.Debug("applying global")
-	path := fmt.Sprintf("%s/global", rootPath)
-	e := fs.MkdirAll(path, 0755)
-	if e != nil {
-		return errs.WrapUserf(e, "unable to make directory %s", path)
-	}
-	return applyTree(fs, repoBox, commonBox, path, p)
-}
-
-func applyAccounts(fs afero.Fs, p *plan.Plan, accountBox, commonBox *packr.Box) (e error) {
-	for account, accountPlan := range p.Accounts {
-		path := fmt.Sprintf("%s/accounts/%s", rootPath, account)
-		e = fs.MkdirAll(path, 0755)
-		if e != nil {
-			return errs.WrapUser(e, "unable to make directories for accounts")
-		}
-		e = applyTree(fs, accountBox, commonBox, path, accountPlan)
-		if e != nil {
-			return errs.WrapUser(e, "unable to apply templates to account")
-		}
-	}
-	return nil
-}
-
-func applyModules(fs afero.Fs, p map[string]plan.Module, moduleBox, commonBox *packr.Box) (e error) {
-	for module, modulePlan := range p {
-		path := fmt.Sprintf("%s/modules/%s", rootPath, module)
-		e = fs.MkdirAll(path, 0755)
-		if e != nil {
-			return errs.WrapUserf(e, "unable to make path %s", path)
-		}
-		e = applyTree(fs, moduleBox, commonBox, path, modulePlan)
-		if e != nil {
-			return errs.WrapUser(e, "unable to apply tree")
-		}
-	}
-	return nil
-}
-
-func applyEnvs(fs afero.Fs, p *plan.Plan, envBox *packr.Box, componentBoxes map[v2.ComponentKind]packr.Box, commonBox *packr.Box) (e error) {
-	logrus.Debug("applying envs")
-	for env, envPlan := range p.Envs {
-		logrus.Debugf("applying %s", env)
-		path := fmt.Sprintf("%s/envs/%s", rootPath, env)
-		e = fs.MkdirAll(path, 0755)
-		if e != nil {
-			return errs.WrapUserf(e, "unable to make directory %s", path)
-		}
-		e := applyTree(fs, envBox, commonBox, path, envPlan)
-		if e != nil {
-			return errs.WrapUser(e, "unable to apply templates to env")
-		}
-		for component, componentPlan := range envPlan.Components {
-			path = fmt.Sprintf("%s/envs/%s/%s", rootPath, env, component)
-			e = fs.MkdirAll(path, 0755)
-			if e != nil {
-				return errs.WrapUser(e, "unable to make directories for component")
-			}
-			componentBox := componentBoxes[componentPlan.Kind.GetOrDefault()]
-			e := applyTree(fs, &componentBox, commonBox, path, componentPlan)
-			if e != nil {
-				return errs.WrapUser(e, "unable to apply templates for component")
-			}
-
-			if componentPlan.ModuleSource != nil {
-				e := applyModuleInvocation(fs, path, *componentPlan.ModuleSource, templates.Templates.ModuleInvocation, commonBox)
-				if e != nil {
-					return errs.WrapUser(e, "unable to apply module invocation")
-				}
-			}
-
-		}
-	}
-	return nil
-}
-
-func applyTree(dest afero.Fs, source *packr.Box, common *packr.Box, targetBasePath string, subst interface{}) (e error) {
-	return source.Walk(func(path string, sourceFile packr.File) error {
-
-		extension := filepath.Ext(path)
-		target := getTargetPath(targetBasePath, path)
-		targetExtension := filepath.Ext(target)
-
-		if extension == ".tmpl" {
-			e = applyTemplate(sourceFile, common, dest, target, subst)
-			if e != nil {
-				return errs.WrapUser(e, "unable to apply template")
-			}
-		} else if extension == ".touch" {
-			e = touchFile(dest, target)
-			if e != nil {
-				return errs.WrapUserf(e, "unable to touch file %s", target)
-			}
-		} else if extension == ".create" {
-			e = createFile(dest, target, sourceFile)
-			if e != nil {
-				return errs.WrapUserf(e, "unable to create file %s", target)
-			}
-		} else if extension == ".rm" {
-			e = os.Remove(target)
-			if e != nil && !os.IsNotExist(e) {
-				return errs.WrapUserf(e, "unable to remove %s", target)
-			}
-			logrus.Infof("%s removed", target)
-		} else if extension == ".ln" {
-
-			linkTargetBytes, err := ioutil.ReadAll(sourceFile)
-			if err != nil {
-				return errs.WrapUserf(err, "could not read source file %#v", sourceFile)
-			}
-
-			linkTarget := string(linkTargetBytes)
-
-			err = linkFile(dest, target, linkTarget)
-
-			if err != nil {
-				return errs.WrapInternal(err, "can't symlink file")
-			}
-		} else {
-			e = afero.WriteReader(dest, target, sourceFile)
-			if e != nil {
-				return errs.WrapUser(e, "unable to copy file")
-			}
-			logrus.Infof("%s copied", target)
-		}
-
-		if targetExtension == ".tf" {
-			e = fmtHcl(dest, target)
-			if e != nil {
-				return errs.WrapUser(e, "unable to format HCL")
-			}
-		}
-		return nil
-	})
-}
-
-func fmtHcl(fs afero.Fs, path string) error {
-	in, e := afero.ReadFile(fs, path)
-	if e != nil {
-		return errs.WrapUserf(e, "unable to read file %s", path)
-	}
-	out := hclwrite.Format(in)
-	return afero.WriteReader(fs, path, bytes.NewReader(out))
-}
-
-func touchFile(dest afero.Fs, path string) error {
-	dir, _ := filepath.Split(path)
-	ospath := filepath.FromSlash(dir)
-	err := dest.MkdirAll(ospath, 0755)
-	if err != nil {
-		return errs.WrapUserf(err, "couldn't create %s directory", dir)
-	}
-
-	_, err = dest.Stat(path)
-	if err != nil { // TODO we might not want to do this for all errors
-		logrus.Infof("%s touched", path)
-		_, err = dest.Create(path)
-		if err != nil {
-			return errs.WrapUser(err, "unable to touch file")
-		}
-	} else {
-		logrus.Infof("%s skipped touch", path)
-	}
-	return nil
-}
-
-func createFile(dest afero.Fs, path string, sourceFile io.Reader) error {
-	_, err := dest.Stat(path)
-	if err != nil { // TODO we might not want to do this for all errors
-		logrus.Infof("%s created", path)
-		err = afero.WriteReader(dest, path, sourceFile)
-		if err != nil {
-			return errs.WrapUser(err, "unable to create file")
-		}
-	} else {
-		logrus.Infof("%s skipped", path)
-	}
-	return nil
-}
-
-func removeExtension(path string) string {
-	return strings.TrimSuffix(path, filepath.Ext(path))
-}
-
-func applyTemplate(sourceFile io.Reader, commonTemplates *packr.Box, dest afero.Fs, path string, overrides interface{}) error {
-	dir, _ := filepath.Split(path)
-	ospath := filepath.FromSlash(dir)
-	err := dest.MkdirAll(ospath, 0775)
-	if err != nil {
-		return errs.WrapUserf(err, "couldn't create %s directory", dir)
-	}
-
-	logrus.Infof("%s templated", path)
-	writer, err := dest.OpenFile(path, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0644)
-	if err != nil {
-		return errs.WrapUser(err, "unable to open file")
-	}
-	t, e := util.OpenTemplate(path, sourceFile, commonTemplates)
-	if e != nil {
-		return e
-	}
-	return t.Execute(writer, overrides)
-}
-
-// This should really be part of the plan stage, not apply. But going to
-// leave it here for now and re-think it when we make this mechanism
-// general purpose.
-type moduleData struct {
-	ModuleName   string
-	ModuleSource string
-	Variables    []string
-	Outputs      []string
-}
-
-func applyModuleInvocation(fs afero.Fs, path, moduleAddress string, box packr.Box, commonBox *packr.Box) error {
-	e := fs.MkdirAll(path, 0755)
-	if e != nil {
-		return errs.WrapUserf(e, "couldn't create %s directory", path)
-	}
-
-	moduleConfig, e := util.DownloadAndParseModule(fs, moduleAddress)
-	if e != nil {
-		return errs.WrapUser(e, "could not download or parse module")
-	}
-
-	// This should really be part of the plan stage, not apply. But going to
-	// leave it here for now and re-think it when we make this mechanism
-	// general purpose.
-	variables := make([]string, 0)
-	for _, v := range moduleConfig.Variables {
-		variables = append(variables, v.Name)
-	}
-	sort.Strings(variables)
-	outputs := make([]string, 0)
-	for _, o := range moduleConfig.Outputs {
-		outputs = append(outputs, o.Name)
-	}
-	sort.Strings(outputs)
-	moduleName := filepath.Base(moduleAddress)
-	re := regexp.MustCompile(`\?ref=.*`)
-	moduleName = re.ReplaceAllString(moduleName, "")
-
-	moduleAddressForSource, _ := calculateModuleAddressForSource(path, moduleAddress)
-	// MAIN
-	f, e := box.Open("main.tf.tmpl")
-	if e != nil {
-		return errs.WrapUser(e, "could not open template file")
-	}
-	e = applyTemplate(f, commonBox, fs, filepath.Join(path, "main.tf"), &moduleData{moduleName, moduleAddressForSource, variables, outputs})
-	if e != nil {
-		return errs.WrapUser(e, "unable to apply template for main.tf")
-	}
-	e = fmtHcl(fs, filepath.Join(path, "main.tf"))
-	if e != nil {
-		return errs.WrapUser(e, "unable to format main.tf")
-	}
-
-	// OUTPUTS
-	f, e = box.Open("outputs.tf.tmpl")
-	if e != nil {
-		return errs.WrapUser(e, "could not open template file")
-	}
-
-	e = applyTemplate(f, commonBox, fs, filepath.Join(path, "outputs.tf"), &moduleData{moduleName, moduleAddressForSource, variables, outputs})
-	if e != nil {
-		return errs.WrapUser(e, "unable to apply template for outputs.tf")
-	}
-
-	e = fmtHcl(fs, filepath.Join(path, "outputs.tf"))
-	if e != nil {
-		return errs.WrapUser(e, "unable to format outputs.tf")
-	}
-
-	return nil
-}
-
-func calculateModuleAddressForSource(path, moduleAddress string) (string, error) {
-	// For cases where the module is a local path, we need to calculate the
-	// relative path from the component to the module.
-	// The module_source path in the fogg.yml is relative to the repo root.
-	var moduleAddressForSource string
-	// getter will kinda normalize the module address, but it will actually be
-	// wrong for local file paths, so we need to calculate that ourselves below
-	s, e := getter.Detect(moduleAddress, path, getter.Detectors)
-	if e != nil {
-		return "", e
-	}
-	u, e := url.Parse(s)
-	if e != nil || u.Scheme == "file" {
-		// This indicates that we have a local path to the module.
-		// It is possible that this test is unreliable.
-		moduleAddressForSource, e = filepath.Rel(path, moduleAddress)
-		if e != nil {
-			return "", e
-		}
-	} else {
-		moduleAddressForSource = moduleAddress
-	}
-	return moduleAddressForSource, nil
-}
-func getTargetPath(basePath, path string) string {
-	target := filepath.Join(basePath, path)
-	extension := filepath.Ext(path)
-
-	if extension == ".tmpl" || extension == ".touch" || extension == ".create" || extension == ".rm" || extension == ".ln" {
-		target = removeExtension(target)
-	}
-
-	return target
-}
-
-func linkFile(fs afero.Fs, name, target string) error {
-	logrus.Debugf("linking %s to %s", name, target)
-	linker, ok := fs.(afero.Symlinker)
-
-	if !ok {
-		return errs.NewInternal("can't cast to afero.SymLinker")
-	}
-
-	relativePath, err := filepathRel(name, target)
-	logrus.Debugf("relative link %s err %#v", relativePath, err)
-	if err != nil {
-		return err
-	}
-
-	logrus.Debugf("removing link at %s", name)
-	err = fs.Remove(name)
-	logrus.Debugf("error removing file %s (probably ok): %s", name, err)
-
-	_, err = linker.SymlinkIfPossible(relativePath, name)
-	return err
-}
-
-func filepathRel(path, name string) (string, error) {
-	dirs := strings.Count(path, "/")
-	fullPath := fmt.Sprintf("%s/%s", strings.Repeat("../", dirs), name)
-	return filepath.Clean(fullPath), nil
-}
diff --git a/testdata/component_kind/terraform/envs/env1/bar/apply_test.go b/testdata/component_kind/terraform/envs/env1/bar/apply_test.go
deleted file mode 100644
index c07fea9a..00000000
--- a/testdata/component_kind/terraform/envs/env1/bar/apply_test.go
+++ /dev/null
@@ -1,448 +0,0 @@
-package apply
-
-import (
-	"io/ioutil"
-	"math/rand"
-	"os"
-	"path/filepath"
-	"strings"
-	"testing"
-
-	v2 "github.com/chanzuckerberg/fogg/config/v2"
-	"github.com/chanzuckerberg/fogg/templates"
-	"github.com/chanzuckerberg/fogg/util"
-	"github.com/sirupsen/logrus"
-	"github.com/spf13/afero"
-	"github.com/stretchr/testify/require"
-	"gopkg.in/yaml.v3"
-)
-
-func init() {
-	logrus.SetLevel(logrus.DebugLevel)
-	formatter := &logrus.TextFormatter{
-		DisableTimestamp: true,
-	}
-	logrus.SetFormatter(formatter)
-}
-
-func randomString(n int) string {
-	var letter = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789")
-
-	b := make([]rune, n)
-	for i := range b {
-		b[i] = letter[rand.Intn(len(letter))]
-	}
-	return string(b)
-}
-
-func getNonExistentDirectoryName() string {
-	nonexistentDir := "noexist-" + randomString(20)
-	for {
-		_, err := os.Stat(nonexistentDir)
-		if os.IsNotExist(err) {
-			return nonexistentDir
-		}
-		nonexistentDir = "noexist-" + randomString(20)
-	}
-}
-
-func TestRemoveExtension(t *testing.T) {
-	r := require.New(t)
-	x := removeExtension("foo")
-	r.Equal("foo", x)
-
-	x = removeExtension("foo.txt")
-	r.Equal("foo", x)
-
-	x = removeExtension("foo.txt.asdf")
-	r.Equal("foo.txt", x)
-
-	x = removeExtension("foo/bar.txt")
-	r.Equal("foo/bar", x)
-}
-
-func TestApplyTemplateBasic(t *testing.T) {
-	r := require.New(t)
-	sourceFile := strings.NewReader("foo")
-	dest, d, err := util.TestFs()
-	r.NoError(err)
-	defer os.Remove(d)
-
-	path := "bar"
-	overrides := struct{ Foo string }{"foo"}
-
-	e := applyTemplate(sourceFile, &templates.Templates.Common, dest, path, overrides)
-	r.Nil(e)
-	f, e := dest.Open("bar")
-	r.Nil(e)
-	i, e := ioutil.ReadAll(f)
-	r.Nil(e)
-	r.Equal("foo", string(i))
-}
-
-func TestApplyTemplateBasicNewDirectory(t *testing.T) {
-	r := require.New(t)
-	sourceFile := strings.NewReader("foo")
-
-	dest, d, err := util.TestFs()
-	r.NoError(err)
-	defer os.RemoveAll(d)
-
-	nonexistentDir := getNonExistentDirectoryName()
-	defer dest.RemoveAll(nonexistentDir) //nolint
-	path := filepath.Join(nonexistentDir, "bar")
-	overrides := struct{ Foo string }{"foo"}
-
-	e := applyTemplate(sourceFile, &templates.Templates.Common, dest, path, overrides)
-	r.Nil(e)
-	f, e := dest.Open(path)
-	r.Nil(e)
-	i, e := ioutil.ReadAll(f)
-	r.Nil(e)
-	r.Equal("foo", string(i))
-}
-
-func TestApplyTemplate(t *testing.T) {
-	r := require.New(t)
-	sourceFile := strings.NewReader("Hello {{.Name}}")
-	dest, d, err := util.TestFs()
-	r.NoError(err)
-	defer os.RemoveAll(d)
-
-	path := "hello"
-	overrides := struct{ Name string }{"World"}
-
-	e := applyTemplate(sourceFile, &templates.Templates.Common, dest, path, overrides)
-	r.Nil(e)
-	f, e := dest.Open("hello")
-	r.Nil(e)
-	i, e := ioutil.ReadAll(f)
-	r.Nil(e)
-	r.Equal("Hello World", string(i))
-}
-
-func TestTouchFile(t *testing.T) {
-	r := require.New(t)
-	fs, d, err := util.TestFs()
-	r.NoError(err)
-	defer os.RemoveAll(d)
-
-	e := touchFile(fs, "foo")
-	r.Nil(e)
-	i, e := readFile(fs, "foo")
-	r.Nil(e)
-	r.Equal("", i)
-
-	fs, d2, err := util.TestFs()
-	r.NoError(err)
-	defer os.RemoveAll(d2)
-
-	err = writeFile(fs, "asdf", "jkl")
-	r.NoError(err)
-
-	i, e = readFile(fs, "asdf")
-	r.Nil(e)
-	r.Equal("jkl", i)
-
-	e = touchFile(fs, "asdf")
-	r.Nil(e)
-	i, e = readFile(fs, "asdf")
-	r.Nil(e)
-	r.Equal("jkl", i)
-}
-
-func TestTouchFileNonExistentDirectory(t *testing.T) {
-	r := require.New(t)
-	dest, d, err := util.TestFs()
-	r.NoError(err)
-	defer os.RemoveAll(d)
-
-	nonexistentDir := getNonExistentDirectoryName()
-	defer dest.RemoveAll(nonexistentDir) //nolint
-	e := touchFile(dest, filepath.Join(nonexistentDir, "foo"))
-	r.Nil(e)
-	i, e := readFile(dest, filepath.Join(nonexistentDir, "foo"))
-	r.Nil(e)
-	r.Equal("", i)
-	r.Nil(e)
-}
-
-func TestCreateFile(t *testing.T) {
-	r := require.New(t)
-	fs, d, err := util.TestFs()
-	r.NoError(err)
-	defer os.RemoveAll(d)
-
-	// create new file
-
-	e := createFile(fs, "foo", strings.NewReader("bar"))
-	r.Nil(e)
-
-	i, e := readFile(fs, "foo")
-	r.Nil(e)
-	r.Equal("bar", i)
-
-	// not overwrite existing file
-
-	fs, d2, err := util.TestFs()
-	r.NoError(err)
-	defer os.RemoveAll(d2)
-
-	e = createFile(fs, "foo", strings.NewReader("bar"))
-	r.Nil(e)
-
-	i, e = readFile(fs, "foo")
-	r.Nil(e)
-	r.Equal("bar", i)
-
-	e = createFile(fs, "foo", strings.NewReader("BAM"))
-	r.Nil(e)
-
-	i, e = readFile(fs, "foo")
-	r.Nil(e)
-	r.Equal("bar", i)
-}
-
-func TestCreateFileNonExistentDirectory(t *testing.T) {
-	r := require.New(t)
-	// create new file in nonexistent directory
-	dest, _, e := util.TestFs()
-	r.NoError(e)
-
-	e = createFile(dest, "newdir/foo", strings.NewReader("bar"))
-	r.NoError(e)
-
-	i, e := readFile(dest, "newdir/foo")
-	r.NoError(e)
-	r.Equal("bar", i)
-}
-
-func TestApplySmokeTest(t *testing.T) {
-	r := require.New(t)
-	fs, _, err := util.TestFs()
-	r.NoError(err)
-
-	yml := `
-defaults:
-  owner: foo
-  project: bar
-  terraform_version: 0
-  backend:
-    bucket: baz
-    region: qux
-    profile: quux
-version: 2
-`
-	b, e := yaml.Marshal(yml)
-	r.NoError(e)
-	e = afero.WriteFile(fs, "fogg.yml", b, 0644)
-	r.NoError(e)
-	c, e := v2.ReadConfig(fs, []byte(yml), "fogg.yml")
-	r.NoError(e)
-
-	w, e := c.Validate()
-	r.NoError(e)
-	r.Len(w, 0)
-
-	e = Apply(fs, c, templates.Templates, false)
-	r.NoError(e)
-}
-
-func TestApplyModuleInvocation(t *testing.T) {
-	r := require.New(t)
-	testFs, d, err := util.TestFs()
-	r.NoError(err)
-	defer os.RemoveAll(d)
-	pwdFs, err := util.PwdFs()
-	r.NoError(err)
-
-	fs := afero.NewCopyOnWriteFs(pwdFs, testFs)
-
-	e := applyModuleInvocation(fs, "mymodule", "test-module", templates.Templates.ModuleInvocation, &templates.Templates.Common)
-	r.NoError(e)
-
-	s, e := fs.Stat("mymodule")
-	r.Nil(e)
-	r.True(s.IsDir())
-
-	_, e = fs.Stat("mymodule/main.tf")
-	r.Nil(e)
-	i, e := afero.ReadFile(fs, "mymodule/main.tf")
-	r.Nil(e)
-	expected := "# Auto-generated by fogg. Do not edit\n# Make improvements in fogg, so that everyone can benefit.\n\nmodule test-module {\n  source = \"../test-module\"\n  bar    = local.bar\n  foo    = local.foo\n\n}\n"
-	r.Equal(expected, string(i))
-
-	_, e = fs.Stat("mymodule/outputs.tf")
-	r.Nil(e)
-	i, e = afero.ReadFile(fs, "mymodule/outputs.tf")
-	r.Nil(e)
-	expected = "# Auto-generated by fogg. Do not edit\n# Make improvements in fogg, so that everyone can benefit.\n\noutput bar {\n  value = module.test-module.bar\n}\n\noutput foo {\n  value = module.test-module.foo\n}\n\n\n"
-	r.Equal(expected, string(i))
-}
-func TestGetTargetPath(t *testing.T) {
-	data := []struct {
-		base   string
-		source string
-		output string
-	}{
-		{"", "foo.tmpl", "foo"},
-		{"", "foo.tf.tmpl", "foo.tf"},
-		{"", "fogg.tf", "fogg.tf"},
-		{"", "fogg.tf.tmpl", "fogg.tf"},
-		{"foo", "foo.tmpl", "foo/foo"},
-		{"foo", "foo.tf.tmpl", "foo/foo.tf"},
-		{"foo", "fogg.tf", "foo/fogg.tf"},
-		{"foo", "fogg.tf.tmpl", "foo/fogg.tf"},
-	}
-	for _, test := range data {
-		t.Run(test.source, func(t *testing.T) {
-			r := require.New(t)
-			out := getTargetPath(test.base, test.source)
-			r.Equal(test.output, out)
-		})
-	}
-}
-
-func TestFmtHcl(t *testing.T) {
-	r := require.New(t)
-
-	before := `foo { bar     = "bam"}`
-	after := `foo { bar = "bam" }`
-	fs, d, err := util.TestFs()
-	r.NoError(err)
-	defer os.RemoveAll(d)
-
-	in := strings.NewReader(before)
-	e := afero.WriteReader(fs, "foo.tf", in)
-	r.Nil(e)
-	e = fmtHcl(fs, "foo.tf")
-	r.Nil(e)
-	out, e := afero.ReadFile(fs, "foo.tf")
-	r.Nil(e)
-	r.NotNil(out)
-	s := string(out)
-	r.Equal(after, s)
-}
-
-func TestCalculateLocalPath(t *testing.T) {
-	data := []struct {
-		path          string
-		moduleAddress string
-		expected      string
-	}{
-		{"foo/bar", "bam/baz", "../../bam/baz"},
-		{
-			"foo/bar",
-			"github.com/terraform-aws-modules/terraform-aws-vpc?ref=v1.30.0",
-			"github.com/terraform-aws-modules/terraform-aws-vpc?ref=v1.30.0",
-		},
-		{"foo/bar", "github.com/asdf/jkl", "github.com/asdf/jkl"},
-		// TODO modules from the registry don't work because it is
-		// ambigious with file paths need to figure out how terraform
-		// does this internally
-		// {"foo/bar", "from/the/registry", "from/the/registry"},
-	}
-
-	for _, test := range data {
-		t.Run("", func(t *testing.T) {
-			r := require.New(t)
-			p, e := calculateModuleAddressForSource(test.path, test.moduleAddress)
-			r.Nil(e)
-			r.Equal(test.expected, p)
-		})
-	}
-}
-
-var versionTests = []struct {
-	current string
-	tool    string
-	result  bool
-}{
-	{"0.0.0", "0.1.0", true},
-	{"0.1.0", "0.0.0", true},
-	{"0.1.0", "0.1.0", false},
-	{"0.1.0", "0.1.0-abcdef", true},
-	{"0.1.0", "0.1.0-abcdef-dirty", true},
-	{"0.1.0-abcdef-dirty", "0.1.0", true},
-	{"0.1.0-abc", "0.1.0-def", true},
-	{"0.1.0-abc", "0.1.0-abc", false},
-	{"\t\n 0.2.0 \n\t", "0.2.0", false},
-}
-
-func TestCheckToolVersions(t *testing.T) {
-	for _, tc := range versionTests {
-		t.Run("", func(t *testing.T) {
-			r := require.New(t)
-			fs, d, err := util.TestFs()
-			r.NoError(err)
-			defer os.RemoveAll(d)
-
-			err = writeFile(fs, ".fogg-version", tc.current)
-			r.NoError(err)
-
-			v, _, e := checkToolVersions(fs, tc.tool)
-			r.NoError(e)
-			r.Equal(tc.result, v)
-		})
-	}
-}
-
-func TestVersionIsChanged(t *testing.T) {
-	r := require.New(t)
-
-	for _, test := range versionTests {
-		t.Run("", func(t *testing.T) {
-			b, e := versionIsChanged(test.current, test.tool)
-			r.NoError(e)
-			r.Equal(test.result, b)
-		})
-	}
-}
-
-func readFile(fs afero.Fs, path string) (string, error) {
-	f, e := fs.Open(path)
-	if e != nil {
-		return "", e
-	}
-	r, e := ioutil.ReadAll(f)
-	if e != nil {
-		return "", e
-	}
-	return string(r), nil
-}
-
-func writeFile(fs afero.Fs, path string, contents string) error {
-	f, e := fs.OpenFile(path, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0755)
-	if e != nil {
-		return e
-	}
-	_, e = f.WriteString(contents)
-	return e
-}
-
-func Test_filepathRel(t *testing.T) {
-	type args struct {
-		name string
-		path string
-	}
-	tests := []struct {
-		name    string
-		args    args
-		want    string
-		wantErr bool
-	}{
-		{"terraform.d", args{"terraform/accounts/idseq/terraform.d", "terraform.d"}, "../../../terraform.d", false},
-	}
-	for _, tt := range tests {
-		t.Run(tt.name, func(t *testing.T) {
-			got, err := filepathRel(tt.args.name, tt.args.path)
-			if (err != nil) != tt.wantErr {
-				t.Errorf("filepathRel() error = %v, wantErr %v", err, tt.wantErr)
-				return
-			}
-			if got != tt.want {
-				t.Errorf("filepathRel() = %v, want %v", got, tt.want)
-			}
-		})
-	}
-}
diff --git a/testdata/component_kind/terraform/envs/env1/bar/golden_file_test.go b/testdata/component_kind/terraform/envs/env1/bar/golden_file_test.go
deleted file mode 100644
index ffeabcff..00000000
--- a/testdata/component_kind/terraform/envs/env1/bar/golden_file_test.go
+++ /dev/null
@@ -1,128 +0,0 @@
-package apply_test
-
-import (
-	"flag"
-	"fmt"
-	"os"
-	"path/filepath"
-	"testing"
-
-	"github.com/chanzuckerberg/fogg/apply"
-	"github.com/chanzuckerberg/fogg/config"
-	"github.com/chanzuckerberg/fogg/templates"
-	"github.com/chanzuckerberg/fogg/util"
-	"github.com/sirupsen/logrus"
-	"github.com/spf13/afero"
-	"github.com/stretchr/testify/require"
-)
-
-var updateGoldenFiles = flag.Bool("update", false, "when set, rewrite the golden files")
-
-func TestIntegration(t *testing.T) {
-
-	var testCases = []struct {
-		fileName string
-	}{
-		{"okta_provider_yaml"},
-		{"github_provider_yaml"},
-		{"bless_provider_yaml"},
-		{"snowflake_provider_yaml"},
-		{"v2_full_yaml"},
-		{"v2_minimal_valid_yaml"},
-		{"v2_no_aws_provider_yaml"},
-		{"github_actions"},
-		{"circleci"},
-		{"component_kind"},
-		{"tfe_provider_yaml"},
-	}
-
-	for _, tc := range testCases {
-		t.Run(tc.fileName, func(t *testing.T) {
-			r := require.New(t)
-
-			testdataFs := afero.NewBasePathFs(afero.NewOsFs(), filepath.Join(util.ProjectRoot(), "testdata", tc.fileName))
-
-			if *updateGoldenFiles {
-				// delete all files except fogg.yml
-				e := afero.Walk(testdataFs, ".", func(path string, info os.FileInfo, err error) error {
-					if !info.IsDir() && !(path == "fogg.yml") {
-						return testdataFs.Remove(path)
-					}
-					return nil
-				})
-				r.NoError(e)
-
-				conf, e := config.FindAndReadConfig(testdataFs, "fogg.yml")
-				r.NoError(e)
-				fmt.Printf("conf %#v\n", conf)
-				fmt.Println("READ CONFIG")
-
-				w, e := conf.Validate()
-				r.NoError(e)
-				r.Len(w, 0)
-
-				e = apply.Apply(testdataFs, conf, templates.Templates, true)
-				r.NoError(e)
-			} else {
-				fileName := "fogg.yml"
-				fs, _, e := util.TestFs()
-				r.NoError(e)
-
-				// copy fogg.yml into the tmp test dir (so that it doesn't show up as a diff)
-				configContents, e := afero.ReadFile(testdataFs, fileName)
-				if os.IsNotExist(e) { //If the error is related to the file being non-existent
-					fileName = "fogg.yml"
-					configContents, e = afero.ReadFile(testdataFs, fileName)
-				}
-				r.NoError(e)
-
-				configMode, e := testdataFs.Stat(fileName)
-				r.NoError(e)
-				r.NoError(afero.WriteFile(fs, fileName, configContents, configMode.Mode()))
-
-				conf, e := config.FindAndReadConfig(fs, fileName)
-				r.NoError(e)
-				fmt.Printf("conf %#v\n", conf)
-
-				w, e := conf.Validate()
-				r.NoError(e)
-				r.Len(w, 0)
-
-				e = apply.Apply(fs, conf, templates.Templates, true)
-				r.NoError(e)
-
-				r.NoError(afero.Walk(testdataFs, ".", func(path string, info os.FileInfo, err error) error {
-					logrus.Debug("================================================")
-					logrus.Debug(path)
-					if !info.Mode().IsRegular() {
-						logrus.Debug("dir or link")
-					} else {
-						i1, e1 := testdataFs.Stat(path)
-						r.NotNil(i1)
-						r.NoError(e1)
-
-						i2, e2 := fs.Stat(path)
-						r.NoError(e2)
-						r.NotNil(i2)
-
-						logrus.Debugf("i1 size: %d ii2 size %d", i1.Size(), i2.Size())
-						r.Equalf(i1.Size(), i2.Size(), "file size: %s", path)
-						// This (below) doesn't currently work for files created on a mac then tested on linux. :shrug:
-						// r.Equalf(i1.Mode(), i2.Mode(), "file mode: %s, %o vs %o", path, i1.Mode(), i2.Mode())
-
-						f1, e3 := afero.ReadFile(testdataFs, path)
-						r.NoError(e3)
-						f2, e4 := afero.ReadFile(fs, path)
-						r.NoError(e4)
-
-						logrus.Debugf("f1:\n%s\n\n---- ", f1)
-						logrus.Debugf("f2:\n%s\n\n---- ", f2)
-
-						r.Equal(f1, f2, path)
-					}
-					return nil
-				}))
-			}
-		})
-	}
-}
diff --git a/testdata/component_kind/terraform/envs/env1/bar/test-module/outputs.tf b/testdata/component_kind/terraform/envs/env1/bar/test-module/outputs.tf
deleted file mode 100644
index b1630f39..00000000
--- a/testdata/component_kind/terraform/envs/env1/bar/test-module/outputs.tf
+++ /dev/null
@@ -1,7 +0,0 @@
-output "foo" {
-  value = "${var.foo}"
-}
-
-output "bar" {
-  value = "${var.bar}"
-}
diff --git a/testdata/component_kind/terraform/envs/env1/bar/test-module/variables.tf b/testdata/component_kind/terraform/envs/env1/bar/test-module/variables.tf
deleted file mode 100644
index 6d8ae6a0..00000000
--- a/testdata/component_kind/terraform/envs/env1/bar/test-module/variables.tf
+++ /dev/null
@@ -1,2 +0,0 @@
-variable "foo" {}
-variable "bar" {}
diff --git a/testdata/component_kind/terraform/envs/env1/foo/Makefile b/testdata/component_kind/terraform/envs/env1/foo/Makefile
deleted file mode 100644
index 034378c4..00000000
--- a/testdata/component_kind/terraform/envs/env1/foo/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
-# Auto-generated by fogg. Do not edit
-# Make improvements in fogg, so that everyone can benefit.
-
-export TERRAFORM_VERSION := 1.1.1
-export TFLINT_ENABLED := 0
-export TF_PLUGIN_CACHE_DIR := ../../../..//.terraform.d/plugin-cache
-export TF_BACKEND_KIND := remote
-
-
-
-
-include ../../../..//scripts/component.mk
-
-
-help: ## display help for this makefile
-	@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
-.PHONY: help
-
diff --git a/testdata/component_kind/terraform/envs/env1/foo/README.md b/testdata/component_kind/terraform/envs/env1/foo/README.md
deleted file mode 100644
index e69de29b..00000000
diff --git a/testdata/component_kind/terraform/envs/env1/foo/fogg.tf b/testdata/component_kind/terraform/envs/env1/foo/fogg.tf
deleted file mode 100644
index e9b8e998..00000000
--- a/testdata/component_kind/terraform/envs/env1/foo/fogg.tf
+++ /dev/null
@@ -1,146 +0,0 @@
-# Auto-generated by fogg. Do not edit
-# Make improvements in fogg, so that everyone can benefit.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-terraform {
-  required_version = "~>1.1.1"
-
-
-  backend remote {
-
-    hostname     = "tfe.example.com"
-    organization = "test-org"
-    workspaces {
-      name = "env1-foo"
-    }
-
-  }
-
-}
-
-variable env {
-  type    = string
-  default = "env1"
-}
-
-variable project {
-  type    = string
-  default = "foo"
-}
-
-
-
-variable component {
-  type    = string
-  default = "foo"
-}
-
-
-
-variable owner {
-  type    = string
-  default = "foo@example.com"
-}
-
-variable tags {
-  type = map(string)
-  default = {
-    project   = "foo"
-    env       = "env1"
-    service   = "foo"
-    owner     = "foo@example.com"
-    managedBy = "terraform"
-  }
-}
-
-
-
-data terraform_remote_state global {
-  backend = "remote"
-
-  config = {
-
-
-    hostname     = "tfe.example.com"
-    organization = "test-org"
-    workspaces = {
-      name = "global"
-    }
-
-
-  }
-}
-
-
-
-
-
-
-# remote state for accounts
-
-data terraform_remote_state acct1 {
-  backend = "remote"
-
-  config = {
-
-
-    hostname     = "tfe.example.com"
-    organization = "test-org"
-    workspaces = {
-      name = "accounts-acct1"
-    }
-
-
-  }
-}
-
-
-# map of aws_accounts
-variable aws_accounts {
-  type = map
-  default = {
-
-
-
-  }
-}
-
-provider random {
-  version = "~> 2.2"
-}
-
-provider template {
-  version = "~> 2.1"
-}
-
-provider archive {
-  version = "~> 1.3"
-}
-
-provider null {
-  version = "~> 2.1"
-}
-
-provider local {
-  version = "~> 1.4"
-}
-
-provider tls {
-  version = "~> 2.1"
-}
diff --git a/testdata/component_kind/terraform/envs/env1/foo/main.tf b/testdata/component_kind/terraform/envs/env1/foo/main.tf
deleted file mode 100644
index e69de29b..00000000
diff --git a/testdata/component_kind/terraform/envs/env1/foo/outputs.tf b/testdata/component_kind/terraform/envs/env1/foo/outputs.tf
deleted file mode 100644
index e69de29b..00000000
diff --git a/testdata/component_kind/terraform/envs/env1/foo/terraform.d b/testdata/component_kind/terraform/envs/env1/foo/terraform.d
deleted file mode 120000
index b482d75b..00000000
--- a/testdata/component_kind/terraform/envs/env1/foo/terraform.d
+++ /dev/null
@@ -1,1 +0,0 @@
-../../../../terraform.d
\ No newline at end of file
diff --git a/testdata/component_kind/terraform/envs/env1/foo/variables.tf b/testdata/component_kind/terraform/envs/env1/foo/variables.tf
deleted file mode 100644
index e69de29b..00000000
diff --git a/testdata/component_kind/terraform/global/Makefile b/testdata/component_kind/terraform/global/Makefile
deleted file mode 100644
index 310136b2..00000000
--- a/testdata/component_kind/terraform/global/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
-# Auto-generated by fogg. Do not edit
-# Make improvements in fogg, so that everyone can benefit.
-
-export TERRAFORM_VERSION := 1.1.1
-export TFLINT_ENABLED := 0
-export TF_PLUGIN_CACHE_DIR := ../..//.terraform.d/plugin-cache
-export TF_BACKEND_KIND := remote
-
-
-
-
-include ../..//scripts/component.mk
-
-
-help: ## display help for this makefile
-	@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
-.PHONY: help
-
diff --git a/testdata/component_kind/terraform/global/README.md b/testdata/component_kind/terraform/global/README.md
deleted file mode 100644
index e69de29b..00000000
diff --git a/testdata/component_kind/terraform/global/fogg.tf b/testdata/component_kind/terraform/global/fogg.tf
deleted file mode 100644
index 25180f5c..00000000
--- a/testdata/component_kind/terraform/global/fogg.tf
+++ /dev/null
@@ -1,94 +0,0 @@
-# Auto-generated by fogg. Do not edit
-# Make improvements in fogg, so that everyone can benefit.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-terraform {
-  required_version = "~>1.1.1"
-
-  backend remote {
-
-    hostname     = "tfe.example.com"
-    organization = "test-org"
-    workspaces {
-      name = "global"
-    }
-
-  }
-}
-
-variable env {
-  type    = string
-  default = ""
-}
-
-variable project {
-  type    = string
-  default = "foo"
-}
-
-
-
-variable component {
-  type    = string
-  default = "global"
-}
-
-
-
-variable owner {
-  type    = string
-  default = "foo@example.com"
-}
-
-variable tags {
-  type = map(string)
-  default = {
-    project   = "foo"
-    env       = ""
-    service   = "global"
-    owner     = "foo@example.com"
-    managedBy = "terraform"
-  }
-}
-
-
-
-
-provider random {
-  version = "~> 2.2"
-}
-
-provider template {
-  version = "~> 2.1"
-}
-
-provider archive {
-  version = "~> 1.3"
-}
-
-provider null {
-  version = "~> 2.1"
-}
-
-provider local {
-  version = "~> 1.4"
-}
-
-provider tls {
-  version = "~> 2.1"
-}
diff --git a/testdata/component_kind/terraform/global/main.tf b/testdata/component_kind/terraform/global/main.tf
deleted file mode 100644
index e69de29b..00000000
diff --git a/testdata/component_kind/terraform/global/outputs.tf b/testdata/component_kind/terraform/global/outputs.tf
deleted file mode 100644
index e69de29b..00000000
diff --git a/testdata/component_kind/terraform/global/terraform.d b/testdata/component_kind/terraform/global/terraform.d
deleted file mode 120000
index a1f7d0d3..00000000
--- a/testdata/component_kind/terraform/global/terraform.d
+++ /dev/null
@@ -1,1 +0,0 @@
-../../terraform.d
\ No newline at end of file
diff --git a/testdata/component_kind/terraform/global/variables.tf b/testdata/component_kind/terraform/global/variables.tf
deleted file mode 100644
index e69de29b..00000000
diff --git a/testdata/github_actions/terraform/global/fogg.tf b/testdata/github_actions/terraform/global/fogg.tf
index 29a7d5ca..7138209c 100644
--- a/testdata/github_actions/terraform/global/fogg.tf
+++ b/testdata/github_actions/terraform/global/fogg.tf
@@ -1,22 +1,5 @@
 # Auto-generated by fogg. Do not edit
 # Make improvements in fogg, so that everyone can benefit.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 terraform {
   required_version = "~>1.1.1"
 
@@ -31,31 +14,22 @@ terraform {
 
   }
 }
-
 variable env {
   type    = string
   default = ""
 }
-
 variable project {
   type    = string
   default = "foo"
 }
-
-
-
 variable component {
   type    = string
   default = "global"
 }
-
-
-
 variable owner {
   type    = string
   default = "foo@example.com"
 }
-
 variable tags {
   type = map(string)
   default = {
@@ -66,30 +40,21 @@ variable tags {
     managedBy = "terraform"
   }
 }
-
-
-
-
 provider random {
   version = "~> 2.2"
 }
-
 provider template {
   version = "~> 2.1"
 }
-
 provider archive {
   version = "~> 1.3"
 }
-
 provider null {
   version = "~> 2.1"
 }
-
 provider local {
   version = "~> 1.4"
 }
-
 provider tls {
   version = "~> 2.1"
 }
diff --git a/testdata/github_provider_yaml/terraform/accounts/foo/fogg.tf b/testdata/github_provider_yaml/terraform/accounts/foo/fogg.tf
index 3498f636..09af0def 100644
--- a/testdata/github_provider_yaml/terraform/accounts/foo/fogg.tf
+++ b/testdata/github_provider_yaml/terraform/accounts/foo/fogg.tf
@@ -1,35 +1,12 @@
 # Auto-generated by fogg. Do not edit
 # Make improvements in fogg, so that everyone can benefit.
 
-
-
-
-
-
-
-
-
-
-
-
 provider github {
   organization = "foo"
   base_url     = "https://example.com/"
 }
-
-
-
-
-
-
-
-
-
-
-
 terraform {
   required_version = "=1.1.1"
-
   backend s3 {
 
     bucket = "bucket"
@@ -40,23 +17,15 @@ terraform {
     profile = "foo"
 
   }
-
 }
-
 variable project {
   type    = string
   default = "foo"
 }
-
-
-
-
-
 variable owner {
   type    = string
   default = "foo@example.com"
 }
-
 # map of aws_accounts
 variable aws_accounts {
   type = map
@@ -66,12 +35,8 @@ variable aws_accounts {
 
   }
 }
-
-
-
 data terraform_remote_state global {
   backend = "s3"
-
   config = {
 
 
@@ -81,35 +46,23 @@ data terraform_remote_state global {
     region  = "region"
     profile = "foo"
 
-
   }
 }
-
-
-
-
-
-
 provider random {
   version = "~> 2.2"
 }
-
 provider template {
   version = "~> 2.1"
 }
-
 provider archive {
   version = "~> 1.3"
 }
-
 provider null {
   version = "~> 2.1"
 }
-
 provider local {
   version = "~> 1.4"
 }
-
 provider tls {
   version = "~> 2.1"
 }
diff --git a/testdata/github_provider_yaml/terraform/envs/bar/bam/fogg.tf b/testdata/github_provider_yaml/terraform/envs/bar/bam/fogg.tf
index 9b1a06ef..ae6c15a9 100644
--- a/testdata/github_provider_yaml/terraform/envs/bar/bam/fogg.tf
+++ b/testdata/github_provider_yaml/terraform/envs/bar/bam/fogg.tf
@@ -1,36 +1,13 @@
 # Auto-generated by fogg. Do not edit
 # Make improvements in fogg, so that everyone can benefit.
 
-
-
-
-
-
-
-
-
-
-
-
 provider github {
   organization = "foo"
   base_url     = "https://example.com/"
 }
-
-
-
-
-
-
-
-
-
-
-
 terraform {
   required_version = "~>1.1.1"
 
-
   backend s3 {
 
     bucket = "bucket"
@@ -41,33 +18,23 @@ terraform {
     profile = "foo"
 
   }
-
 }
-
 variable env {
   type    = string
   default = "bar"
 }
-
 variable project {
   type    = string
   default = "foo"
 }
-
-
-
 variable component {
   type    = string
   default = "bam"
 }
-
-
-
 variable owner {
   type    = string
   default = "foo@example.com"
 }
-
 variable tags {
   type = map(string)
   default = {
@@ -78,12 +45,8 @@ variable tags {
     managedBy = "terraform"
   }
 }
-
-
-
 data terraform_remote_state global {
   backend = "s3"
-
   config = {
 
 
@@ -93,20 +56,11 @@ data terraform_remote_state global {
     region  = "region"
     profile = "foo"
 
-
   }
 }
-
-
-
-
-
-
 # remote state for accounts
-
 data terraform_remote_state foo {
   backend = "s3"
-
   config = {
 
 
@@ -116,11 +70,8 @@ data terraform_remote_state foo {
     region  = "region"
     profile = "foo"
 
-
   }
 }
-
-
 # map of aws_accounts
 variable aws_accounts {
   type = map
@@ -130,27 +81,21 @@ variable aws_accounts {
 
   }
 }
-
 provider random {
   version = "~> 2.2"
 }
-
 provider template {
   version = "~> 2.1"
 }
-
 provider archive {
   version = "~> 1.3"
 }
-
 provider null {
   version = "~> 2.1"
 }
-
 provider local {
   version = "~> 1.4"
 }
-
 provider tls {
   version = "~> 2.1"
 }
diff --git a/testdata/github_provider_yaml/terraform/global/fogg.tf b/testdata/github_provider_yaml/terraform/global/fogg.tf
index 19f7f872..c08e586a 100644
--- a/testdata/github_provider_yaml/terraform/global/fogg.tf
+++ b/testdata/github_provider_yaml/terraform/global/fogg.tf
@@ -1,31 +1,10 @@
 # Auto-generated by fogg. Do not edit
 # Make improvements in fogg, so that everyone can benefit.
 
-
-
-
-
-
-
-
-
-
-
-
 provider github {
   organization = "foo"
   base_url     = "https://example.com/"
 }
-
-
-
-
-
-
-
-
-
-
 terraform {
   required_version = "~>1.1.1"
 
@@ -40,31 +19,22 @@ terraform {
 
   }
 }
-
 variable env {
   type    = string
   default = ""
 }
-
 variable project {
   type    = string
   default = "foo"
 }
-
-
-
 variable component {
   type    = string
   default = "global"
 }
-
-
-
 variable owner {
   type    = string
   default = "foo@example.com"
 }
-
 variable tags {
   type = map(string)
   default = {
@@ -75,30 +45,21 @@ variable tags {
     managedBy = "terraform"
   }
 }
-
-
-
-
 provider random {
   version = "~> 2.2"
 }
-
 provider template {
   version = "~> 2.1"
 }
-
 provider archive {
   version = "~> 1.3"
 }
-
 provider null {
   version = "~> 2.1"
 }
-
 provider local {
   version = "~> 1.4"
 }
-
 provider tls {
   version = "~> 2.1"
 }
diff --git a/testdata/okta_provider_yaml/terraform/accounts/foo/fogg.tf b/testdata/okta_provider_yaml/terraform/accounts/foo/fogg.tf
index 53b75c0b..91d7a92e 100644
--- a/testdata/okta_provider_yaml/terraform/accounts/foo/fogg.tf
+++ b/testdata/okta_provider_yaml/terraform/accounts/foo/fogg.tf
@@ -1,35 +1,13 @@
 # Auto-generated by fogg. Do not edit
 # Make improvements in fogg, so that everyone can benefit.
 
-
-
-
-
-
-
-
-
-
 // https://github.com/articulate/terraform-provider-okta
 provider okta {
   version  = "~>aversion"
   org_name = "orgname"
 }
-
-
-
-
-
-
-
-
-
-
-
-
 terraform {
   required_version = "=1.1.1"
-
   backend s3 {
 
     bucket = "bucket"
@@ -40,23 +18,15 @@ terraform {
     profile = "foofoo"
 
   }
-
 }
-
 variable project {
   type    = string
   default = "foofoo"
 }
-
-
-
-
-
 variable owner {
   type    = string
   default = "foo@example.com"
 }
-
 # map of aws_accounts
 variable aws_accounts {
   type = map
@@ -66,12 +36,8 @@ variable aws_accounts {
 
   }
 }
-
-
-
 data terraform_remote_state global {
   backend = "s3"
-
   config = {
 
 
@@ -81,35 +47,23 @@ data terraform_remote_state global {
     region  = "region"
     profile = "foofoo"
 
-
   }
 }
-
-
-
-
-
-
 provider random {
   version = "~> 2.2"
 }
-
 provider template {
   version = "~> 2.1"
 }
-
 provider archive {
   version = "~> 1.3"
 }
-
 provider null {
   version = "~> 2.1"
 }
-
 provider local {
   version = "~> 1.4"
 }
-
 provider tls {
   version = "~> 2.1"
 }
diff --git a/testdata/okta_provider_yaml/terraform/envs/bar/bam/fogg.tf b/testdata/okta_provider_yaml/terraform/envs/bar/bam/fogg.tf
index c6ea99d8..d506787f 100644
--- a/testdata/okta_provider_yaml/terraform/envs/bar/bam/fogg.tf
+++ b/testdata/okta_provider_yaml/terraform/envs/bar/bam/fogg.tf
@@ -1,36 +1,14 @@
 # Auto-generated by fogg. Do not edit
 # Make improvements in fogg, so that everyone can benefit.
 
-
-
-
-
-
-
-
-
-
 // https://github.com/articulate/terraform-provider-okta
 provider okta {
   version  = "~>aversion"
   org_name = "orgname"
 }
-
-
-
-
-
-
-
-
-
-
-
-
 terraform {
   required_version = "~>1.1.1"
 
-
   backend s3 {
 
     bucket = "bucket"
@@ -41,33 +19,23 @@ terraform {
     profile = "foofoo"
 
   }
-
 }
-
 variable env {
   type    = string
   default = "bar"
 }
-
 variable project {
   type    = string
   default = "foofoo"
 }
-
-
-
 variable component {
   type    = string
   default = "bam"
 }
-
-
-
 variable owner {
   type    = string
   default = "foo@example.com"
 }
-
 variable tags {
   type = map(string)
   default = {
@@ -78,12 +46,8 @@ variable tags {
     managedBy = "terraform"
   }
 }
-
-
-
 data terraform_remote_state global {
   backend = "s3"
-
   config = {
 
 
@@ -93,20 +57,11 @@ data terraform_remote_state global {
     region  = "region"
     profile = "foofoo"
 
-
   }
 }
-
-
-
-
-
-
 # remote state for accounts
-
 data terraform_remote_state foo {
   backend = "s3"
-
   config = {
 
 
@@ -116,11 +71,8 @@ data terraform_remote_state foo {
     region  = "region"
     profile = "foofoo"
 
-
   }
 }
-
-
 # map of aws_accounts
 variable aws_accounts {
   type = map
@@ -130,27 +82,21 @@ variable aws_accounts {
 
   }
 }
-
 provider random {
   version = "~> 2.2"
 }
-
 provider template {
   version = "~> 2.1"
 }
-
 provider archive {
   version = "~> 1.3"
 }
-
 provider null {
   version = "~> 2.1"
 }
-
 provider local {
   version = "~> 1.4"
 }
-
 provider tls {
   version = "~> 2.1"
 }
diff --git a/testdata/okta_provider_yaml/terraform/global/fogg.tf b/testdata/okta_provider_yaml/terraform/global/fogg.tf
index 94c6041e..860fdb8f 100644
--- a/testdata/okta_provider_yaml/terraform/global/fogg.tf
+++ b/testdata/okta_provider_yaml/terraform/global/fogg.tf
@@ -1,31 +1,11 @@
 # Auto-generated by fogg. Do not edit
 # Make improvements in fogg, so that everyone can benefit.
 
-
-
-
-
-
-
-
-
-
 // https://github.com/articulate/terraform-provider-okta
 provider okta {
   version  = "~>aversion"
   org_name = "orgname"
 }
-
-
-
-
-
-
-
-
-
-
-
 terraform {
   required_version = "~>1.1.1"
 
@@ -40,31 +20,22 @@ terraform {
 
   }
 }
-
 variable env {
   type    = string
   default = ""
 }
-
 variable project {
   type    = string
   default = "foofoo"
 }
-
-
-
 variable component {
   type    = string
   default = "global"
 }
-
-
-
 variable owner {
   type    = string
   default = "foo@example.com"
 }
-
 variable tags {
   type = map(string)
   default = {
@@ -75,30 +46,21 @@ variable tags {
     managedBy = "terraform"
   }
 }
-
-
-
-
 provider random {
   version = "~> 2.2"
 }
-
 provider template {
   version = "~> 2.1"
 }
-
 provider archive {
   version = "~> 1.3"
 }
-
 provider null {
   version = "~> 2.1"
 }
-
 provider local {
   version = "~> 1.4"
 }
-
 provider tls {
   version = "~> 2.1"
 }
diff --git a/testdata/snowflake_provider_yaml/terraform/accounts/foo/fogg.tf b/testdata/snowflake_provider_yaml/terraform/accounts/foo/fogg.tf
index ffe245af..1b045a02 100644
--- a/testdata/snowflake_provider_yaml/terraform/accounts/foo/fogg.tf
+++ b/testdata/snowflake_provider_yaml/terraform/accounts/foo/fogg.tf
@@ -1,36 +1,13 @@
 # Auto-generated by fogg. Do not edit
 # Make improvements in fogg, so that everyone can benefit.
 
-
-
-
-
-
 provider snowflake {
   account = "foo"
   role    = "bar"
   region  = "us-west-2"
 }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 terraform {
   required_version = "=1.1.1"
-
   backend s3 {
 
     bucket = "bucket"
@@ -41,23 +18,15 @@ terraform {
     profile = "foo"
 
   }
-
 }
-
 variable project {
   type    = string
   default = "foo"
 }
-
-
-
-
-
 variable owner {
   type    = string
   default = "foo@example.com"
 }
-
 # map of aws_accounts
 variable aws_accounts {
   type = map
@@ -67,12 +36,8 @@ variable aws_accounts {
 
   }
 }
-
-
-
 data terraform_remote_state global {
   backend = "s3"
-
   config = {
 
 
@@ -82,35 +47,23 @@ data terraform_remote_state global {
     region  = "region"
     profile = "foo"
 
-
   }
 }
-
-
-
-
-
-
 provider random {
   version = "~> 2.2"
 }
-
 provider template {
   version = "~> 2.1"
 }
-
 provider archive {
   version = "~> 1.3"
 }
-
 provider null {
   version = "~> 2.1"
 }
-
 provider local {
   version = "~> 1.4"
 }
-
 provider tls {
   version = "~> 2.1"
 }
diff --git a/testdata/snowflake_provider_yaml/terraform/envs/bar/bam/fogg.tf b/testdata/snowflake_provider_yaml/terraform/envs/bar/bam/fogg.tf
index 8deba5ca..536e92a8 100644
--- a/testdata/snowflake_provider_yaml/terraform/envs/bar/bam/fogg.tf
+++ b/testdata/snowflake_provider_yaml/terraform/envs/bar/bam/fogg.tf
@@ -1,37 +1,14 @@
 # Auto-generated by fogg. Do not edit
 # Make improvements in fogg, so that everyone can benefit.
 
-
-
-
-
-
 provider snowflake {
   account = "foo"
   role    = "bar"
   region  = "us-west-2"
 }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 terraform {
   required_version = "~>1.1.1"
 
-
   backend s3 {
 
     bucket = "bucket"
@@ -42,33 +19,23 @@ terraform {
     profile = "foo"
 
   }
-
 }
-
 variable env {
   type    = string
   default = "bar"
 }
-
 variable project {
   type    = string
   default = "foo"
 }
-
-
-
 variable component {
   type    = string
   default = "bam"
 }
-
-
-
 variable owner {
   type    = string
   default = "foo@example.com"
 }
-
 variable tags {
   type = map(string)
   default = {
@@ -79,12 +46,8 @@ variable tags {
     managedBy = "terraform"
   }
 }
-
-
-
 data terraform_remote_state global {
   backend = "s3"
-
   config = {
 
 
@@ -94,20 +57,11 @@ data terraform_remote_state global {
     region  = "region"
     profile = "foo"
 
-
   }
 }
-
-
-
-
-
-
 # remote state for accounts
-
 data terraform_remote_state foo {
   backend = "s3"
-
   config = {
 
 
@@ -117,11 +71,8 @@ data terraform_remote_state foo {
     region  = "region"
     profile = "foo"
 
-
   }
 }
-
-
 # map of aws_accounts
 variable aws_accounts {
   type = map
@@ -131,27 +82,21 @@ variable aws_accounts {
 
   }
 }
-
 provider random {
   version = "~> 2.2"
 }
-
 provider template {
   version = "~> 2.1"
 }
-
 provider archive {
   version = "~> 1.3"
 }
-
 provider null {
   version = "~> 2.1"
 }
-
 provider local {
   version = "~> 1.4"
 }
-
 provider tls {
   version = "~> 2.1"
 }
diff --git a/testdata/snowflake_provider_yaml/terraform/global/fogg.tf b/testdata/snowflake_provider_yaml/terraform/global/fogg.tf
index 2e6e8c26..ca299e0f 100644
--- a/testdata/snowflake_provider_yaml/terraform/global/fogg.tf
+++ b/testdata/snowflake_provider_yaml/terraform/global/fogg.tf
@@ -1,32 +1,11 @@
 # Auto-generated by fogg. Do not edit
 # Make improvements in fogg, so that everyone can benefit.
 
-
-
-
-
-
 provider snowflake {
   account = "foo"
   role    = "bar"
   region  = "us-west-2"
 }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 terraform {
   required_version = "~>1.1.1"
 
@@ -41,31 +20,22 @@ terraform {
 
   }
 }
-
 variable env {
   type    = string
   default = ""
 }
-
 variable project {
   type    = string
   default = "foo"
 }
-
-
-
 variable component {
   type    = string
   default = "global"
 }
-
-
-
 variable owner {
   type    = string
   default = "foo@example.com"
 }
-
 variable tags {
   type = map(string)
   default = {
@@ -76,30 +46,21 @@ variable tags {
     managedBy = "terraform"
   }
 }
-
-
-
-
 provider random {
   version = "~> 2.2"
 }
-
 provider template {
   version = "~> 2.1"
 }
-
 provider archive {
   version = "~> 1.3"
 }
-
 provider null {
   version = "~> 2.1"
 }
-
 provider local {
   version = "~> 1.4"
 }
-
 provider tls {
   version = "~> 2.1"
 }
diff --git a/testdata/tfe_provider_yaml/terraform/accounts/foo/fogg.tf b/testdata/tfe_provider_yaml/terraform/accounts/foo/fogg.tf
index 4733bfa4..c5a72ab9 100644
--- a/testdata/tfe_provider_yaml/terraform/accounts/foo/fogg.tf
+++ b/testdata/tfe_provider_yaml/terraform/accounts/foo/fogg.tf
@@ -1,32 +1,11 @@
 # Auto-generated by fogg. Do not edit
 # Make improvements in fogg, so that everyone can benefit.
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 provider tfe {
   version = "~>2.2.2"
 }
-
-
-
-
 terraform {
   required_version = "=1.1.1"
-
   backend s3 {
 
     bucket = "bucket"
@@ -37,23 +16,15 @@ terraform {
     profile = "foo"
 
   }
-
 }
-
 variable project {
   type    = string
   default = "foo"
 }
-
-
-
-
-
 variable owner {
   type    = string
   default = "foo@example.com"
 }
-
 # map of aws_accounts
 variable aws_accounts {
   type = map
@@ -63,12 +34,8 @@ variable aws_accounts {
 
   }
 }
-
-
-
 data terraform_remote_state global {
   backend = "s3"
-
   config = {
 
 
@@ -78,35 +45,23 @@ data terraform_remote_state global {
     region  = "region"
     profile = "foo"
 
-
   }
 }
-
-
-
-
-
-
 provider random {
   version = "~> 2.2"
 }
-
 provider template {
   version = "~> 2.1"
 }
-
 provider archive {
   version = "~> 1.3"
 }
-
 provider null {
   version = "~> 2.1"
 }
-
 provider local {
   version = "~> 1.4"
 }
-
 provider tls {
   version = "~> 2.1"
 }
diff --git a/testdata/tfe_provider_yaml/terraform/envs/bar/bam/fogg.tf b/testdata/tfe_provider_yaml/terraform/envs/bar/bam/fogg.tf
index 4620b16c..7f5193ef 100644
--- a/testdata/tfe_provider_yaml/terraform/envs/bar/bam/fogg.tf
+++ b/testdata/tfe_provider_yaml/terraform/envs/bar/bam/fogg.tf
@@ -1,27 +1,8 @@
 # Auto-generated by fogg. Do not edit
 # Make improvements in fogg, so that everyone can benefit.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 terraform {
   required_version = "~>1.1.1"
 
-
   backend s3 {
 
     bucket = "bucket"
@@ -32,33 +13,23 @@ terraform {
     profile = "foo"
 
   }
-
 }
-
 variable env {
   type    = string
   default = "bar"
 }
-
 variable project {
   type    = string
   default = "foo"
 }
-
-
-
 variable component {
   type    = string
   default = "bam"
 }
-
-
-
 variable owner {
   type    = string
   default = "foo@example.com"
 }
-
 variable tags {
   type = map(string)
   default = {
@@ -69,12 +40,8 @@ variable tags {
     managedBy = "terraform"
   }
 }
-
-
-
 data terraform_remote_state global {
   backend = "s3"
-
   config = {
 
 
@@ -84,20 +51,11 @@ data terraform_remote_state global {
     region  = "region"
     profile = "foo"
 
-
   }
 }
-
-
-
-
-
-
 # remote state for accounts
-
 data terraform_remote_state foo {
   backend = "s3"
-
   config = {
 
 
@@ -107,11 +65,8 @@ data terraform_remote_state foo {
     region  = "region"
     profile = "foo"
 
-
   }
 }
-
-
 # map of aws_accounts
 variable aws_accounts {
   type = map
@@ -121,27 +76,21 @@ variable aws_accounts {
 
   }
 }
-
 provider random {
   version = "~> 2.2"
 }
-
 provider template {
   version = "~> 2.1"
 }
-
 provider archive {
   version = "~> 1.3"
 }
-
 provider null {
   version = "~> 2.1"
 }
-
 provider local {
   version = "~> 1.4"
 }
-
 provider tls {
   version = "~> 2.1"
 }
diff --git a/testdata/tfe_provider_yaml/terraform/global/fogg.tf b/testdata/tfe_provider_yaml/terraform/global/fogg.tf
index 70558efd..f9d49a61 100644
--- a/testdata/tfe_provider_yaml/terraform/global/fogg.tf
+++ b/testdata/tfe_provider_yaml/terraform/global/fogg.tf
@@ -1,28 +1,9 @@
 # Auto-generated by fogg. Do not edit
 # Make improvements in fogg, so that everyone can benefit.
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 provider tfe {
   version = "~>1.1.1"
 }
-
-
-
 terraform {
   required_version = "~>1.1.1"
 
@@ -37,31 +18,22 @@ terraform {
 
   }
 }
-
 variable env {
   type    = string
   default = ""
 }
-
 variable project {
   type    = string
   default = "foo"
 }
-
-
-
 variable component {
   type    = string
   default = "global"
 }
-
-
-
 variable owner {
   type    = string
   default = "foo@example.com"
 }
-
 variable tags {
   type = map(string)
   default = {
@@ -72,30 +44,21 @@ variable tags {
     managedBy = "terraform"
   }
 }
-
-
-
-
 provider random {
   version = "~> 2.2"
 }
-
 provider template {
   version = "~> 2.1"
 }
-
 provider archive {
   version = "~> 1.3"
 }
-
 provider null {
   version = "~> 2.1"
 }
-
 provider local {
   version = "~> 1.4"
 }
-
 provider tls {
   version = "~> 2.1"
 }
diff --git a/testdata/v2_full_yaml/terraform/accounts/bar/fogg.tf b/testdata/v2_full_yaml/terraform/accounts/bar/fogg.tf
index dd63ad9e..9d1ca902 100644
--- a/testdata/v2_full_yaml/terraform/accounts/bar/fogg.tf
+++ b/testdata/v2_full_yaml/terraform/accounts/bar/fogg.tf
@@ -1,8 +1,5 @@
 # Auto-generated by fogg. Do not edit
 # Make improvements in fogg, so that everyone can benefit.
-
-
-
 provider aws {
 
   version = "~> 0.12.0"
@@ -15,7 +12,6 @@ provider aws {
 
   allowed_account_ids = [456]
 }
-
 # Aliased Providers (for doing things in every region).
 
 
@@ -33,7 +29,6 @@ provider aws {
 }
 
 
-
 provider aws {
   alias   = "us-east-2"
   version = "~> 0.12.0"
@@ -47,27 +42,8 @@ provider aws {
   allowed_account_ids = [456]
 }
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 terraform {
   required_version = "=0.100.0"
-
   backend s3 {
 
     bucket = "buck"
@@ -78,28 +54,19 @@ terraform {
     profile = "profile"
 
   }
-
 }
-
 variable project {
   type    = string
   default = "proj"
 }
-
-
 variable region {
   type    = string
   default = "us-west-2"
 }
-
-
-
-
 variable owner {
   type    = string
   default = "foo@example.com"
 }
-
 # map of aws_accounts
 variable aws_accounts {
   type = map
@@ -115,17 +82,12 @@ variable aws_accounts {
 
   }
 }
-
-
 variable foo {
   type    = string
   default = "bar1"
 }
-
-
 data terraform_remote_state global {
   backend = "s3"
-
   config = {
 
 
@@ -135,18 +97,10 @@ data terraform_remote_state global {
     region  = "us-west-2"
     profile = "profile"
 
-
   }
 }
-
-
-
-
-
-
 data terraform_remote_state foo {
   backend = "s3"
-
   config = {
 
 
@@ -156,32 +110,23 @@ data terraform_remote_state foo {
     region  = "us-west-2"
     profile = "profile"
 
-
   }
 }
-
-
-
 provider random {
   version = "~> 2.2"
 }
-
 provider template {
   version = "~> 2.1"
 }
-
 provider archive {
   version = "~> 1.3"
 }
-
 provider null {
   version = "~> 2.1"
 }
-
 provider local {
   version = "~> 1.4"
 }
-
 provider tls {
   version = "~> 2.1"
 }
diff --git a/testdata/v2_full_yaml/terraform/accounts/foo/fogg.tf b/testdata/v2_full_yaml/terraform/accounts/foo/fogg.tf
index 9a8b718d..2b914eba 100644
--- a/testdata/v2_full_yaml/terraform/accounts/foo/fogg.tf
+++ b/testdata/v2_full_yaml/terraform/accounts/foo/fogg.tf
@@ -1,8 +1,5 @@
 # Auto-generated by fogg. Do not edit
 # Make improvements in fogg, so that everyone can benefit.
-
-
-
 provider aws {
 
   version = "~> 0.12.0"
@@ -11,29 +8,10 @@ provider aws {
 
   allowed_account_ids = [123]
 }
-
 # Aliased Providers (for doing things in every region).
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 terraform {
   required_version = "=0.100.0"
-
   backend s3 {
 
     bucket = "buck"
@@ -44,33 +22,23 @@ terraform {
     profile = "profile"
 
   }
-
 }
-
 variable project {
   type    = string
   default = "proj"
 }
-
-
 variable region {
   type    = string
   default = "us-west-2"
 }
-
-
-
 variable aws_profile {
   type    = string
   default = "profile"
 }
-
-
 variable owner {
   type    = string
   default = "foo@example.com"
 }
-
 # map of aws_accounts
 variable aws_accounts {
   type = map
@@ -86,17 +54,12 @@ variable aws_accounts {
 
   }
 }
-
-
 variable foo {
   type    = string
   default = "bar1"
 }
-
-
 data terraform_remote_state global {
   backend = "s3"
-
   config = {
 
 
@@ -106,16 +69,10 @@ data terraform_remote_state global {
     region  = "us-west-2"
     profile = "profile"
 
-
   }
 }
-
-
-
-
 data terraform_remote_state bar {
   backend = "s3"
-
   config = {
 
 
@@ -125,34 +82,23 @@ data terraform_remote_state bar {
     region  = "us-west-2"
     profile = "profile"
 
-
   }
 }
-
-
-
-
-
 provider random {
   version = "~> 2.2"
 }
-
 provider template {
   version = "~> 2.1"
 }
-
 provider archive {
   version = "~> 1.3"
 }
-
 provider null {
   version = "~> 2.1"
 }
-
 provider local {
   version = "~> 1.4"
 }
-
 provider tls {
   version = "~> 2.1"
 }
diff --git a/testdata/v2_full_yaml/terraform/envs/prod/datadog/fogg.tf b/testdata/v2_full_yaml/terraform/envs/prod/datadog/fogg.tf
index c35f7967..57f98cfe 100644
--- a/testdata/v2_full_yaml/terraform/envs/prod/datadog/fogg.tf
+++ b/testdata/v2_full_yaml/terraform/envs/prod/datadog/fogg.tf
@@ -1,8 +1,5 @@
 # Auto-generated by fogg. Do not edit
 # Make improvements in fogg, so that everyone can benefit.
-
-
-
 provider aws {
 
   version = "~> 0.12.0"
@@ -11,36 +8,14 @@ provider aws {
 
   allowed_account_ids = [456]
 }
-
 # Aliased Providers (for doing things in every region).
 
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 provider datadog {
 }
-
-
-
-
-
-
 terraform {
   required_version = "~>0.100.0"
 
-
   backend s3 {
 
     bucket = "buck"
@@ -51,43 +26,31 @@ terraform {
     profile = "profile"
 
   }
-
 }
-
 variable env {
   type    = string
   default = "prod"
 }
-
 variable project {
   type    = string
   default = "proj"
 }
-
-
 variable region {
   type    = string
   default = "us-west-2"
 }
-
-
 variable component {
   type    = string
   default = "datadog"
 }
-
-
 variable aws_profile {
   type    = string
   default = "profile"
 }
-
-
 variable owner {
   type    = string
   default = "foo@example.com"
 }
-
 variable tags {
   type = map(string)
   default = {
@@ -98,17 +61,12 @@ variable tags {
     managedBy = "terraform"
   }
 }
-
-
 variable foo {
   type    = string
   default = "bar1"
 }
-
-
 data terraform_remote_state global {
   backend = "s3"
-
   config = {
 
 
@@ -118,18 +76,10 @@ data terraform_remote_state global {
     region  = "us-west-2"
     profile = "profile"
 
-
   }
 }
-
-
-
-
-
-
 data terraform_remote_state hero {
   backend = "s3"
-
   config = {
 
 
@@ -139,17 +89,11 @@ data terraform_remote_state hero {
     region  = "us-west-2"
     profile = "profile"
 
-
   }
 }
-
-
-
 # remote state for accounts
-
 data terraform_remote_state bar {
   backend = "s3"
-
   config = {
 
 
@@ -159,13 +103,10 @@ data terraform_remote_state bar {
     region  = "us-west-2"
     profile = "profile"
 
-
   }
 }
-
 data terraform_remote_state foo {
   backend = "s3"
-
   config = {
 
 
@@ -175,11 +116,8 @@ data terraform_remote_state foo {
     region  = "us-west-2"
     profile = "profile"
 
-
   }
 }
-
-
 # map of aws_accounts
 variable aws_accounts {
   type = map
@@ -195,27 +133,21 @@ variable aws_accounts {
 
   }
 }
-
 provider random {
   version = "~> 2.2"
 }
-
 provider template {
   version = "~> 2.1"
 }
-
 provider archive {
   version = "~> 1.3"
 }
-
 provider null {
   version = "~> 2.1"
 }
-
 provider local {
   version = "~> 1.4"
 }
-
 provider tls {
   version = "~> 2.1"
 }
diff --git a/testdata/v2_full_yaml/terraform/envs/prod/hero/fogg.tf b/testdata/v2_full_yaml/terraform/envs/prod/hero/fogg.tf
index fef1c437..56391748 100644
--- a/testdata/v2_full_yaml/terraform/envs/prod/hero/fogg.tf
+++ b/testdata/v2_full_yaml/terraform/envs/prod/hero/fogg.tf
@@ -1,8 +1,5 @@
 # Auto-generated by fogg. Do not edit
 # Make improvements in fogg, so that everyone can benefit.
-
-
-
 provider aws {
 
   version = "~> 0.12.0"
@@ -11,36 +8,14 @@ provider aws {
 
   allowed_account_ids = [456]
 }
-
 # Aliased Providers (for doing things in every region).
 
 
-
-
-
-
-
-
-
-
-
-
-
-
 provider heroku {
 }
-
-
-
-
-
-
-
-
 terraform {
   required_version = "~>0.100.0"
 
-
   backend s3 {
 
     bucket = "buck"
@@ -51,43 +26,31 @@ terraform {
     profile = "profile"
 
   }
-
 }
-
 variable env {
   type    = string
   default = "prod"
 }
-
 variable project {
   type    = string
   default = "proj"
 }
-
-
 variable region {
   type    = string
   default = "us-west-2"
 }
-
-
 variable component {
   type    = string
   default = "hero"
 }
-
-
 variable aws_profile {
   type    = string
   default = "profile"
 }
-
-
 variable owner {
   type    = string
   default = "foo@example.com"
 }
-
 variable tags {
   type = map(string)
   default = {
@@ -98,17 +61,12 @@ variable tags {
     managedBy = "terraform"
   }
 }
-
-
 variable foo {
   type    = string
   default = "bar1"
 }
-
-
 data terraform_remote_state global {
   backend = "s3"
-
   config = {
 
 
@@ -118,16 +76,10 @@ data terraform_remote_state global {
     region  = "us-west-2"
     profile = "profile"
 
-
   }
 }
-
-
-
-
 data terraform_remote_state datadog {
   backend = "s3"
-
   config = {
 
 
@@ -137,19 +89,11 @@ data terraform_remote_state datadog {
     region  = "us-west-2"
     profile = "profile"
 
-
   }
 }
-
-
-
-
-
 # remote state for accounts
-
 data terraform_remote_state bar {
   backend = "s3"
-
   config = {
 
 
@@ -159,13 +103,10 @@ data terraform_remote_state bar {
     region  = "us-west-2"
     profile = "profile"
 
-
   }
 }
-
 data terraform_remote_state foo {
   backend = "s3"
-
   config = {
 
 
@@ -175,11 +116,8 @@ data terraform_remote_state foo {
     region  = "us-west-2"
     profile = "profile"
 
-
   }
 }
-
-
 # map of aws_accounts
 variable aws_accounts {
   type = map
@@ -195,27 +133,21 @@ variable aws_accounts {
 
   }
 }
-
 provider random {
   version = "~> 2.2"
 }
-
 provider template {
   version = "~> 2.1"
 }
-
 provider archive {
   version = "~> 1.3"
 }
-
 provider null {
   version = "~> 2.1"
 }
-
 provider local {
   version = "~> 1.4"
 }
-
 provider tls {
   version = "~> 2.1"
 }
diff --git a/testdata/v2_full_yaml/terraform/envs/staging/comp1/fogg.tf b/testdata/v2_full_yaml/terraform/envs/staging/comp1/fogg.tf
index 86e069f9..680c21b8 100644
--- a/testdata/v2_full_yaml/terraform/envs/staging/comp1/fogg.tf
+++ b/testdata/v2_full_yaml/terraform/envs/staging/comp1/fogg.tf
@@ -1,8 +1,5 @@
 # Auto-generated by fogg. Do not edit
 # Make improvements in fogg, so that everyone can benefit.
-
-
-
 provider aws {
 
   version = "~> 0.12.0"
@@ -11,31 +8,11 @@ provider aws {
 
   allowed_account_ids = [456]
 }
-
 # Aliased Providers (for doing things in every region).
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 terraform {
   required_version = "~>0.100.0"
 
-
   backend s3 {
 
     bucket = "buck"
@@ -46,43 +23,31 @@ terraform {
     profile = "comp1"
 
   }
-
 }
-
 variable env {
   type    = string
   default = "staging"
 }
-
 variable project {
   type    = string
   default = "proj"
 }
-
-
 variable region {
   type    = string
   default = "us-west-2"
 }
-
-
 variable component {
   type    = string
   default = "comp1"
 }
-
-
 variable aws_profile {
   type    = string
   default = "profile"
 }
-
-
 variable owner {
   type    = string
   default = "foo@example.com"
 }
-
 variable tags {
   type = map(string)
   default = {
@@ -93,17 +58,12 @@ variable tags {
     managedBy = "terraform"
   }
 }
-
-
 variable foo {
   type    = string
   default = "bar2"
 }
-
-
 data terraform_remote_state global {
   backend = "s3"
-
   config = {
 
 
@@ -113,18 +73,10 @@ data terraform_remote_state global {
     region  = "us-west-2"
     profile = "profile"
 
-
   }
 }
-
-
-
-
-
-
 data terraform_remote_state comp2 {
   backend = "s3"
-
   config = {
 
 
@@ -134,15 +86,10 @@ data terraform_remote_state comp2 {
     region  = "us-west-2"
     profile = "profile"
 
-
   }
 }
-
-
-
 data terraform_remote_state vpc {
   backend = "s3"
-
   config = {
 
 
@@ -152,17 +99,11 @@ data terraform_remote_state vpc {
     region  = "us-west-2"
     profile = "profile"
 
-
   }
 }
-
-
-
 # remote state for accounts
-
 data terraform_remote_state bar {
   backend = "s3"
-
   config = {
 
 
@@ -172,13 +113,10 @@ data terraform_remote_state bar {
     region  = "us-west-2"
     profile = "profile"
 
-
   }
 }
-
 data terraform_remote_state foo {
   backend = "s3"
-
   config = {
 
 
@@ -188,11 +126,8 @@ data terraform_remote_state foo {
     region  = "us-west-2"
     profile = "profile"
 
-
   }
 }
-
-
 # map of aws_accounts
 variable aws_accounts {
   type = map
@@ -208,27 +143,21 @@ variable aws_accounts {
 
   }
 }
-
 provider random {
   version = "~> 2.2"
 }
-
 provider template {
   version = "~> 2.1"
 }
-
 provider archive {
   version = "~> 1.3"
 }
-
 provider null {
   version = "~> 2.1"
 }
-
 provider local {
   version = "~> 1.4"
 }
-
 provider tls {
   version = "~> 2.1"
 }
diff --git a/testdata/v2_full_yaml/terraform/envs/staging/comp2/fogg.tf b/testdata/v2_full_yaml/terraform/envs/staging/comp2/fogg.tf
index 106f04ea..6010031f 100644
--- a/testdata/v2_full_yaml/terraform/envs/staging/comp2/fogg.tf
+++ b/testdata/v2_full_yaml/terraform/envs/staging/comp2/fogg.tf
@@ -1,8 +1,5 @@
 # Auto-generated by fogg. Do not edit
 # Make improvements in fogg, so that everyone can benefit.
-
-
-
 provider aws {
 
   version = "~> 0.12.0"
@@ -11,31 +8,11 @@ provider aws {
 
   allowed_account_ids = [456]
 }
-
 # Aliased Providers (for doing things in every region).
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 terraform {
   required_version = "~>0.100.0"
 
-
   backend s3 {
 
     bucket = "buck"
@@ -46,43 +23,31 @@ terraform {
     profile = "profile"
 
   }
-
 }
-
 variable env {
   type    = string
   default = "staging"
 }
-
 variable project {
   type    = string
   default = "proj"
 }
-
-
 variable region {
   type    = string
   default = "us-west-2"
 }
-
-
 variable component {
   type    = string
   default = "comp2"
 }
-
-
 variable aws_profile {
   type    = string
   default = "profile"
 }
-
-
 variable owner {
   type    = string
   default = "foo@example.com"
 }
-
 variable tags {
   type = map(string)
   default = {
@@ -93,17 +58,12 @@ variable tags {
     managedBy = "terraform"
   }
 }
-
-
 variable foo {
   type    = string
   default = "bar2"
 }
-
-
 data terraform_remote_state global {
   backend = "s3"
-
   config = {
 
 
@@ -113,16 +73,10 @@ data terraform_remote_state global {
     region  = "us-west-2"
     profile = "profile"
 
-
   }
 }
-
-
-
-
 data terraform_remote_state comp1 {
   backend = "s3"
-
   config = {
 
 
@@ -132,17 +86,10 @@ data terraform_remote_state comp1 {
     region  = "us-west-2"
     profile = "comp1"
 
-
   }
 }
-
-
-
-
-
 data terraform_remote_state vpc {
   backend = "s3"
-
   config = {
 
 
@@ -152,17 +99,11 @@ data terraform_remote_state vpc {
     region  = "us-west-2"
     profile = "profile"
 
-
   }
 }
-
-
-
 # remote state for accounts
-
 data terraform_remote_state bar {
   backend = "s3"
-
   config = {
 
 
@@ -172,13 +113,10 @@ data terraform_remote_state bar {
     region  = "us-west-2"
     profile = "profile"
 
-
   }
 }
-
 data terraform_remote_state foo {
   backend = "s3"
-
   config = {
 
 
@@ -188,11 +126,8 @@ data terraform_remote_state foo {
     region  = "us-west-2"
     profile = "profile"
 
-
   }
 }
-
-
 # map of aws_accounts
 variable aws_accounts {
   type = map
@@ -208,27 +143,21 @@ variable aws_accounts {
 
   }
 }
-
 provider random {
   version = "~> 2.2"
 }
-
 provider template {
   version = "~> 2.1"
 }
-
 provider archive {
   version = "~> 1.3"
 }
-
 provider null {
   version = "~> 2.1"
 }
-
 provider local {
   version = "~> 1.4"
 }
-
 provider tls {
   version = "~> 2.1"
 }
diff --git a/testdata/v2_full_yaml/terraform/envs/staging/vpc/fogg.tf b/testdata/v2_full_yaml/terraform/envs/staging/vpc/fogg.tf
index 279bdb62..57771d06 100644
--- a/testdata/v2_full_yaml/terraform/envs/staging/vpc/fogg.tf
+++ b/testdata/v2_full_yaml/terraform/envs/staging/vpc/fogg.tf
@@ -1,8 +1,5 @@
 # Auto-generated by fogg. Do not edit
 # Make improvements in fogg, so that everyone can benefit.
-
-
-
 provider aws {
 
   version = "~> 0.12.0"
@@ -11,31 +8,11 @@ provider aws {
 
   allowed_account_ids = [456]
 }
-
 # Aliased Providers (for doing things in every region).
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 terraform {
   required_version = "~>0.100.0"
 
-
   backend s3 {
 
     bucket = "buck"
@@ -46,43 +23,31 @@ terraform {
     profile = "profile"
 
   }
-
 }
-
 variable env {
   type    = string
   default = "staging"
 }
-
 variable project {
   type    = string
   default = "proj"
 }
-
-
 variable region {
   type    = string
   default = "us-west-2"
 }
-
-
 variable component {
   type    = string
   default = "vpc"
 }
-
-
 variable aws_profile {
   type    = string
   default = "profile"
 }
-
-
 variable owner {
   type    = string
   default = "foo@example.com"
 }
-
 variable tags {
   type = map(string)
   default = {
@@ -93,17 +58,12 @@ variable tags {
     managedBy = "terraform"
   }
 }
-
-
 variable foo {
   type    = string
   default = "bar3"
 }
-
-
 data terraform_remote_state global {
   backend = "s3"
-
   config = {
 
 
@@ -113,16 +73,10 @@ data terraform_remote_state global {
     region  = "us-west-2"
     profile = "profile"
 
-
   }
 }
-
-
-
-
 data terraform_remote_state comp1 {
   backend = "s3"
-
   config = {
 
 
@@ -132,15 +86,10 @@ data terraform_remote_state comp1 {
     region  = "us-west-2"
     profile = "comp1"
 
-
   }
 }
-
-
-
 data terraform_remote_state comp2 {
   backend = "s3"
-
   config = {
 
 
@@ -150,19 +99,11 @@ data terraform_remote_state comp2 {
     region  = "us-west-2"
     profile = "profile"
 
-
   }
 }
-
-
-
-
-
 # remote state for accounts
-
 data terraform_remote_state bar {
   backend = "s3"
-
   config = {
 
 
@@ -172,13 +113,10 @@ data terraform_remote_state bar {
     region  = "us-west-2"
     profile = "profile"
 
-
   }
 }
-
 data terraform_remote_state foo {
   backend = "s3"
-
   config = {
 
 
@@ -188,11 +126,8 @@ data terraform_remote_state foo {
     region  = "us-west-2"
     profile = "profile"
 
-
   }
 }
-
-
 # map of aws_accounts
 variable aws_accounts {
   type = map
@@ -208,27 +143,21 @@ variable aws_accounts {
 
   }
 }
-
 provider random {
   version = "~> 2.2"
 }
-
 provider template {
   version = "~> 2.1"
 }
-
 provider archive {
   version = "~> 1.3"
 }
-
 provider null {
   version = "~> 2.1"
 }
-
 provider local {
   version = "~> 1.4"
 }
-
 provider tls {
   version = "~> 2.1"
 }
diff --git a/testdata/v2_full_yaml/terraform/global/fogg.tf b/testdata/v2_full_yaml/terraform/global/fogg.tf
index 6cae804a..fe71a654 100644
--- a/testdata/v2_full_yaml/terraform/global/fogg.tf
+++ b/testdata/v2_full_yaml/terraform/global/fogg.tf
@@ -1,8 +1,5 @@
 # Auto-generated by fogg. Do not edit
 # Make improvements in fogg, so that everyone can benefit.
-
-
-
 provider aws {
 
   version = "~> 0.12.0"
@@ -11,24 +8,8 @@ provider aws {
 
   allowed_account_ids = [456]
 }
-
 # Aliased Providers (for doing things in every region).
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 terraform {
   required_version = "~>0.100.0"
 
@@ -43,41 +24,30 @@ terraform {
 
   }
 }
-
 variable env {
   type    = string
   default = ""
 }
-
 variable project {
   type    = string
   default = "proj"
 }
-
-
 variable region {
   type    = string
   default = "us-west-2"
 }
-
-
 variable component {
   type    = string
   default = "global"
 }
-
-
 variable aws_profile {
   type    = string
   default = "profile"
 }
-
-
 variable owner {
   type    = string
   default = "foo@example.com"
 }
-
 variable tags {
   type = map(string)
   default = {
@@ -88,35 +58,25 @@ variable tags {
     managedBy = "terraform"
   }
 }
-
-
 variable foo {
   type    = string
   default = "bar1"
 }
-
-
-
 provider random {
   version = "~> 2.2"
 }
-
 provider template {
   version = "~> 2.1"
 }
-
 provider archive {
   version = "~> 1.3"
 }
-
 provider null {
   version = "~> 2.1"
 }
-
 provider local {
   version = "~> 1.4"
 }
-
 provider tls {
   version = "~> 2.1"
 }
diff --git a/testdata/v2_minimal_valid_yaml/terraform/global/fogg.tf b/testdata/v2_minimal_valid_yaml/terraform/global/fogg.tf
index 29a7d5ca..7138209c 100644
--- a/testdata/v2_minimal_valid_yaml/terraform/global/fogg.tf
+++ b/testdata/v2_minimal_valid_yaml/terraform/global/fogg.tf
@@ -1,22 +1,5 @@
 # Auto-generated by fogg. Do not edit
 # Make improvements in fogg, so that everyone can benefit.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 terraform {
   required_version = "~>1.1.1"
 
@@ -31,31 +14,22 @@ terraform {
 
   }
 }
-
 variable env {
   type    = string
   default = ""
 }
-
 variable project {
   type    = string
   default = "foo"
 }
-
-
-
 variable component {
   type    = string
   default = "global"
 }
-
-
-
 variable owner {
   type    = string
   default = "foo@example.com"
 }
-
 variable tags {
   type = map(string)
   default = {
@@ -66,30 +40,21 @@ variable tags {
     managedBy = "terraform"
   }
 }
-
-
-
-
 provider random {
   version = "~> 2.2"
 }
-
 provider template {
   version = "~> 2.1"
 }
-
 provider archive {
   version = "~> 1.3"
 }
-
 provider null {
   version = "~> 2.1"
 }
-
 provider local {
   version = "~> 1.4"
 }
-
 provider tls {
   version = "~> 2.1"
 }
diff --git a/testdata/v2_no_aws_provider_yaml/terraform/envs/staging/vpc/fogg.tf b/testdata/v2_no_aws_provider_yaml/terraform/envs/staging/vpc/fogg.tf
index 36f72705..b74b2c55 100644
--- a/testdata/v2_no_aws_provider_yaml/terraform/envs/staging/vpc/fogg.tf
+++ b/testdata/v2_no_aws_provider_yaml/terraform/envs/staging/vpc/fogg.tf
@@ -1,27 +1,8 @@
 # Auto-generated by fogg. Do not edit
 # Make improvements in fogg, so that everyone can benefit.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 terraform {
   required_version = "~>0.100.0"
 
-
   backend s3 {
 
     bucket = "buck"
@@ -32,33 +13,23 @@ terraform {
     profile = "profile"
 
   }
-
 }
-
 variable env {
   type    = string
   default = "staging"
 }
-
 variable project {
   type    = string
   default = "proj"
 }
-
-
-
 variable component {
   type    = string
   default = "vpc"
 }
-
-
-
 variable owner {
   type    = string
   default = "foo@example.com"
 }
-
 variable tags {
   type = map(string)
   default = {
@@ -69,17 +40,12 @@ variable tags {
     managedBy = "terraform"
   }
 }
-
-
 variable foo {
   type    = string
   default = "bar3"
 }
-
-
 data terraform_remote_state global {
   backend = "s3"
-
   config = {
 
 
@@ -89,18 +55,9 @@ data terraform_remote_state global {
     region  = "us-west-2"
     profile = "profile"
 
-
   }
 }
-
-
-
-
-
-
 # remote state for accounts
-
-
 # map of aws_accounts
 variable aws_accounts {
   type = map
@@ -108,27 +65,21 @@ variable aws_accounts {
 
   }
 }
-
 provider random {
   version = "~> 2.2"
 }
-
 provider template {
   version = "~> 2.1"
 }
-
 provider archive {
   version = "~> 1.3"
 }
-
 provider null {
   version = "~> 2.1"
 }
-
 provider local {
   version = "~> 1.4"
 }
-
 provider tls {
   version = "~> 2.1"
 }
diff --git a/testdata/v2_no_aws_provider_yaml/terraform/global/fogg.tf b/testdata/v2_no_aws_provider_yaml/terraform/global/fogg.tf
index 126636f0..a857ff2d 100644
--- a/testdata/v2_no_aws_provider_yaml/terraform/global/fogg.tf
+++ b/testdata/v2_no_aws_provider_yaml/terraform/global/fogg.tf
@@ -1,22 +1,5 @@
 # Auto-generated by fogg. Do not edit
 # Make improvements in fogg, so that everyone can benefit.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 terraform {
   required_version = "~>0.100.0"
 
@@ -31,31 +14,22 @@ terraform {
 
   }
 }
-
 variable env {
   type    = string
   default = ""
 }
-
 variable project {
   type    = string
   default = "proj"
 }
-
-
-
 variable component {
   type    = string
   default = "global"
 }
-
-
-
 variable owner {
   type    = string
   default = "foo@example.com"
 }
-
 variable tags {
   type = map(string)
   default = {
@@ -66,35 +40,25 @@ variable tags {
     managedBy = "terraform"
   }
 }
-
-
 variable foo {
   type    = string
   default = "bar1"
 }
-
-
-
 provider random {
   version = "~> 2.2"
 }
-
 provider template {
   version = "~> 2.1"
 }
-
 provider archive {
   version = "~> 1.3"
 }
-
 provider null {
   version = "~> 2.1"
 }
-
 provider local {
   version = "~> 1.4"
 }
-
 provider tls {
   version = "~> 2.1"
 }