Add logging during awskms auto-unseal (#9794)

Adds debug and warn logging around AWS credential chain generation,
specifically to help users debugging auto-unseal problems on AWS, by
logging which role is being used in the case of a webidentity token.

Adds a deferred call to flush the log output as well, to ensure logs
are output in the event of an initialization failure.
This commit is contained in:
Theron Voran
2020-09-28 14:06:49 -07:00
committed by GitHub
parent 1c0b92369f
commit 10c0adad72
28 changed files with 348 additions and 80 deletions

View File

@@ -121,7 +121,7 @@ func (b *backend) clientIAM(ctx context.Context, s logical.Storage) (iamiface.IA
return b.iamClient, nil
}
iamClient, err := nonCachedClientIAM(ctx, s)
iamClient, err := nonCachedClientIAM(ctx, s, b.Logger())
if err != nil {
return nil, err
}
@@ -148,7 +148,7 @@ func (b *backend) clientSTS(ctx context.Context, s logical.Storage) (stsiface.ST
return b.stsClient, nil
}
stsClient, err := nonCachedClientSTS(ctx, s)
stsClient, err := nonCachedClientSTS(ctx, s, b.Logger())
if err != nil {
return nil, err
}