From 1d85ae14237e0a86d672a68f91e0a487275a41cb Mon Sep 17 00:00:00 2001 From: Stanislas Nanchen Date: Sat, 7 Jul 2018 05:56:11 +0200 Subject: [PATCH] break early if the given profile does not exists. --- main.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.go b/main.go index c77aadb..a53202e 100644 --- a/main.go +++ b/main.go @@ -36,6 +36,10 @@ func main() { if len(region) == 0 { region = cfg.Region } + _, err = cfg.Credentials.Retrieve() + if err != nil { + panic("unable to retrieve credentials from profile") + } vPrintln("Using the AWS Region %s", region) iamc := iam.New(cfg) stsc := sts.New(cfg)