Skip to content

Commit

Permalink
fix: expose AWS_REGION to local environment
Browse files Browse the repository at this point in the history
Signed-off-by: João Vanzuita <joao@kubeshop.io>
Signed-off-by: Thiago Pagotto <pagottoo@gmail.com>
  • Loading branch information
João Vanzuita authored and pagottoo committed Jul 19, 2022
1 parent 2879c6c commit 62e5686
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package cmd

import (
"log"
"os"
"strings"
"time"

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 62e5686

Please sign in to comment.