0
0
mirror of https://github.com/thegeeklab/wp-opentofu.git synced 2024-11-22 00:30:40 +00:00

returning true only when all credentials are set

This commit is contained in:
Neemias Junior 2019-12-02 15:37:35 +01:00 committed by Jacob McCann
parent 8d8f5c4d78
commit 5876dd5a26
No known key found for this signature in database
GPG Key ID: B5A476DE32B9AE72

View File

@ -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) {