guard on both accessdenied (no IAM policy) and validationerror (no username specified)

This commit is contained in:
Clint Shryock 2015-08-07 11:55:44 -05:00
parent 31fab62bfd
commit eb90457223
1 changed files with 1 additions and 1 deletions

View File

@ -188,7 +188,7 @@ func (c *Config) ValidateCredentials(iamconn *iam.IAM) error {
if awsErr, ok := err.(awserr.Error); ok {
if awsErr.Code() == "AccessDenied" {
if awsErr.Code() == "AccessDenied" || awsErr.Code() == "ValidationError" {
log.Printf("[WARN] AccessDenied Error with iam.GetUser, assuming IAM profile")
// User may be an IAM instance profile, or otherwise IAM role without the
// GetUser permissions, so fail silently