From b90c1181b71d073f385ad47dad2fd9108a9813ae Mon Sep 17 00:00:00 2001 From: VJ Patel Date: Sat, 3 Sep 2022 18:17:35 +0000 Subject: [PATCH] fix downloading of terraform registry modules via Terraform --- example/1.2/BUILD | 1 - example/1.2/main.tf | 29 +++++++++++++++++------------ pkg/root/virtualenv.go | 6 +++--- 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/example/1.2/BUILD b/example/1.2/BUILD index 6f3bd69..855a2a7 100644 --- a/example/1.2/BUILD +++ b/example/1.2/BUILD @@ -7,7 +7,6 @@ terraform_root( "variables.tf", ], modules = [ - "//example/third_party/terraform/module:cloudposse_null_label_0_12", "//example/1.2/my_module:my_module", ], toolchain = "//example/third_party/terraform:1.2", diff --git a/example/1.2/main.tf b/example/1.2/main.tf index b19d9ad..77d21d0 100644 --- a/example/1.2/main.tf +++ b/example/1.2/main.tf @@ -16,20 +16,25 @@ resource "null_resource" "version" { } } -module "label" { - source = "//example/third_party/terraform/module:cloudposse_null_label_0_12" - namespace = "eg" - stage = "prod" - name = "bastion" - attributes = ["public"] - delimiter = "-" +# module "label" { +# source = "//example/third_party/terraform/module:cloudposse_null_label_0_12" +# namespace = "eg" +# stage = "prod" +# name = "bastion" +# attributes = ["public"] +# delimiter = "-" - tags = { - "BusinessUnit" = "XYZ", - "Snapshot" = "true" - } -} +# tags = { +# "BusinessUnit" = "XYZ", +# "Snapshot" = "true" +# } +# } module "my_label" { source = "//example/1.2/my_module:my_module" } + +module "label" { + source = "cloudposse/label/null" + version = "0.25.0" +} diff --git a/pkg/root/virtualenv.go b/pkg/root/virtualenv.go index 1ce5a0d..4ce5075 100644 --- a/pkg/root/virtualenv.go +++ b/pkg/root/virtualenv.go @@ -77,9 +77,9 @@ func (c *CommandVirtualEnv) Execute(args []string) error { return fmt.Errorf("could not create symlink from '%s' to '%s': %w", old, new, err) } - // set GIT_DIR - fmt.Printf(`GIT_DIR=%s/.git`+"\n", repoRoot) - fmt.Println(`export GIT_DIR`) + // set REPO_ROOT + fmt.Printf(`REPO_ROOT=%s`+"\n", repoRoot) + fmt.Println(`export REPO_ROOT`) // change user's working directory. log.Info().Str("path", virtualEnvDir).Msg("working directory")