Skip to content

Commit

Permalink
Add logs around credentials validation
Browse files Browse the repository at this point in the history
  • Loading branch information
t0yv0 committed Nov 27, 2023
1 parent faa863a commit 229f72c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions provider/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"context"
_ "embed"
"fmt"
"log"
"os"
"path/filepath"
"strconv"
Expand Down Expand Up @@ -633,12 +634,21 @@ func preConfigureCallback(vars resource.PropertyMap, c shim.ResourceConfig) erro
// if we skipCredentialsValidation then we don't need to do anything in
// preConfigureCallback as this is an explicit operation
if skipCredentialsValidation {
log.Printf("[INFO] pulumi-aws: skip credentials validation")
return nil
}

var err error
if credentialsValidationRun.CompareAndSwap(false, true) {
log.Printf("[INFO] pulumi-aws: starting to validate credentials. " +
"Disable this by AWS_SKIP_CREDENTIALS_VALIDATION or " +
"skipCredentialsValidation option")
err = validateCredentials(vars, c)
if err == nil {
log.Printf("[INFO] pulumi-aws: credentials are valid")
} else {
log.Printf("[INFO] pulumi-aws: error validating credentials: %v", err)
}
}
return err
}
Expand Down

0 comments on commit 229f72c

Please sign in to comment.