Browse Source

returning true only when all credentials are set

pull/119/head
Neemias Junior 5 years ago
committed by Jacob McCann
parent
commit
5876dd5a26
No known key found for this signature in database GPG Key ID: B5A476DE32B9AE72
  1. 6
      plugin.go

6
plugin.go

@ -172,11 +172,11 @@ func CopyTfEnv() {
func credsSet() bool { func credsSet() bool {
awsTokens := []string{"AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN"} awsTokens := []string{"AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN"}
for _, token := range awsTokens { for _, token := range awsTokens {
if os.Getenv(token) != "" { if os.Getenv(token) == "" {
return true return false
} }
} }
return false return true
} }
func assumeRole(roleArn string) { func assumeRole(roleArn string) {

Loading…
Cancel
Save