Skip to content

Commit beb806d

Browse files
committed
fix: check AWS credentials and notify about missing environment variables
1 parent 2352410 commit beb806d

File tree

1 file changed

+8
-0
lines changed
  • pkg/retrieval/engine/postgres/initialize/logical

1 file changed

+8
-0
lines changed

pkg/retrieval/engine/postgres/initialize/logical/dump_rds.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,14 @@ func newRDSDumper(rdsCfg *RDSConfig) (*rdsDumper, error) {
6868
return nil, errors.Wrap(err, "failed to start AWS session")
6969
}
7070

71+
credentials, err := awsSession.Config.Credentials.Get()
72+
if err != nil || !credentials.HasKeys() {
73+
log.Dbg(err)
74+
75+
return nil, errors.New(`failed to check AWS credentials.
76+
Set up valid environment variables AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY`)
77+
}
78+
7179
return &rdsDumper{
7280
rdsCfg: rdsCfg,
7381
iamSvc: iam.New(awsSession, aws.NewConfig()),

0 commit comments

Comments
 (0)