Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(prometheus-scaler): AWS signv4 parses region if provided #5421

Merged
merged 6 commits into from
Jan 20, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ Here is an overview of all new **experimental** features:
### Fixes

- **General**: TODO ([#XXX](https://github.com/kedacore/keda/issues/XXX))
- **AWS AMP Prometheus scaler**: Fix for missing awsRegion from metadata ([#5419](https://github.com/kedacore/keda/issues/5419))
JorTurFer marked this conversation as resolved.
Show resolved Hide resolved

### Deprecations

Expand Down
6 changes: 6 additions & 0 deletions pkg/scalers/aws/aws_sigv4.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ func (rt *roundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
func parseAwsAMPMetadata(config *scalersconfig.ScalerConfig) (*awsConfigMetadata, error) {
meta := awsConfigMetadata{}

if val, ok := config.TriggerMetadata["awsRegion"]; ok && val != "" {
meta.awsRegion = val
} else {
return nil, ErrAwsAMPNoAwsRegion
}
JorTurFer marked this conversation as resolved.
Show resolved Hide resolved

auth, err := GetAwsAuthorization(config.TriggerUniqueKey, config.PodIdentity, config.TriggerMetadata, config.AuthParams, config.ResolvedEnv)
if err != nil {
return nil, err
Expand Down