From 5876dd5a26da3958e8808946fb3615d63991791e Mon Sep 17 00:00:00 2001 From: Neemias Junior Date: Mon, 2 Dec 2019 15:37:35 +0100 Subject: [PATCH] returning true only when all credentials are set --- plugin.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugin.go b/plugin.go index 511e96e..511632f 100644 --- a/plugin.go +++ b/plugin.go @@ -172,11 +172,11 @@ func CopyTfEnv() { func credsSet() bool { awsTokens := []string{"AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN"} for _, token := range awsTokens { - if os.Getenv(token) != "" { - return true + if os.Getenv(token) == "" { + return false } } - return false + return true } func assumeRole(roleArn string) {