Skip to content

Commit

Permalink
aws sqs also support newer env var names
Browse files Browse the repository at this point in the history
  • Loading branch information
jry-anchor committed Feb 9, 2021
1 parent c68eb4e commit 1b0c6cb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions aws-sqs-http-connector/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,12 @@ func getAwsConfig() (*aws.Config, error) {
config.Credentials = credentials.NewStaticCredentials(os.Getenv("AWS_ACCESS_KEY"), os.Getenv("AWS_SECRET_KEY"), "")
return config, nil
}
// https://github.com/fission/keda-connectors/issues/46
// Also support newer env var names set by newer Fission
if os.Getenv("AWS_ACCESS_KEY_ID") != "" && os.Getenv("AWS_SECRET_ACCESS_KEY") != "" {
config.Credentials = credentials.NewStaticCredentials(os.Getenv("AWS_ACCESS_KEY_ID"), os.Getenv("AWS_SECRET_ACCESS_KEY"), "")
return config, nil
}
if os.Getenv("AWS_CRED_PATH") != "" && os.Getenv("AWS_CRED_PROFILE") != "" {
config.Credentials = credentials.NewSharedCredentials(os.Getenv("AWS_CRED_PATH"), os.Getenv("AWS_CRED_PROFILE"))
return config, nil
Expand Down

0 comments on commit 1b0c6cb

Please sign in to comment.