Skip to content
Snippets Groups Projects
Commit 3a8e0ee8 authored by Johan de Klerk's avatar Johan de Klerk
Browse files

Correctly load aws config when retrieving the database secret

parent 503fc952
No related branches found
No related tags found
No related merge requests found
...@@ -51,10 +51,16 @@ func getSecret(secretID string, isDebug bool) (string, string) { ...@@ -51,10 +51,16 @@ func getSecret(secretID string, isDebug bool) (string, string) {
// Get local config // Get local config
if isDebug && os.Getenv("ENVIRONMENT") != "" { if isDebug && os.Getenv("ENVIRONMENT") != "" {
awsSession = session.Must(session.NewSessionWithOptions(session.Options{ logs.Info("Using access key %s", os.Getenv("AWS_ACCESS_KEY_ID"))
SharedConfigState: session.SharedConfigEnable, awsSession, err = session.NewSessionWithOptions(session.Options{
Profile: os.Getenv("AWS_PROFILE"), Config: aws.Config{
})) Region: aws.String("af-south-1"),
CredentialsChainVerboseErrors: aws.Bool(true),
},
})
if err != nil {
return "", ""
}
} }
// Create a Secrets Manager client // Create a Secrets Manager client
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment