diff --git a/pkg/scalers/aws/aws_sigv4.go b/pkg/scalers/aws/aws_sigv4.go index 9d68461843b..4f6c75a161d 100644 --- a/pkg/scalers/aws/aws_sigv4.go +++ b/pkg/scalers/aws/aws_sigv4.go @@ -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 + } + auth, err := GetAwsAuthorization(config.TriggerUniqueKey, config.PodIdentity, config.TriggerMetadata, config.AuthParams, config.ResolvedEnv) if err != nil { return nil, err