Skip to content

Commit

Permalink
AWS Auth: Update error message to include underlying error (hashicorp…
Browse files Browse the repository at this point in the history
  • Loading branch information
pcman312 authored and jartek committed Sep 11, 2021
1 parent e17052b commit 9ebada5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion builtin/credential/aws/path_login.go
Expand Up @@ -1364,7 +1364,7 @@ func (b *backend) pathLoginUpdateIam(ctx context.Context, req *logical.Request,
if roleEntry.InferredEntityType == ec2EntityType {
instance, err := b.validateInstance(ctx, req.Storage, entity.SessionInfo, roleEntry.InferredAWSRegion, callerID.Account)
if err != nil {
return logical.ErrorResponse(fmt.Sprintf("failed to verify %s as a valid EC2 instance in region %s", entity.SessionInfo, roleEntry.InferredAWSRegion)), nil
return logical.ErrorResponse("failed to verify %s as a valid EC2 instance in region %s: %s", entity.SessionInfo, roleEntry.InferredAWSRegion, err), nil
}

// build a fake identity doc to pass on metadata about the instance to verifyInstanceMeetsRoleRequirements
Expand Down
3 changes: 3 additions & 0 deletions changelog/11638.txt
@@ -0,0 +1,3 @@
```release-note:improvement
auth/aws: Underlying error included in validation failure message.
```

0 comments on commit 9ebada5

Please sign in to comment.