From 62e5686377fd42fdd0b327ed25c2f1512e93f251 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Vanzuita?= Date: Tue, 19 Jul 2022 09:07:13 -0300 Subject: [PATCH] fix: expose AWS_REGION to local environment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: João Vanzuita Signed-off-by: Thiago Pagotto --- cmd/init.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/init.go b/cmd/init.go index 45e0376e0..d466dc8ef 100644 --- a/cmd/init.go +++ b/cmd/init.go @@ -2,6 +2,7 @@ package cmd import ( "log" + "os" "strings" "time" @@ -80,6 +81,11 @@ to quickly create a Cobra application.`, // name of the cloud region to provision resources when resources are region-specific region, _ := cmd.Flags().GetString("region") viper.Set("aws.region", region) + // propagate it to local environment + err = os.Setenv("AWS_REGION", region) + if err != nil { + log.Panicf("unable to set environment variable AWS_REGION, error is: %v", err) + } log.Println("region:", region) // cluster name