How to send AWS API request in K6

Hi All,

I’m new to K6 and javascript.
I need to get some ‘Amazon CloudWatch’ Metrics in my K6 performance test suite.
Followed the steps given in https://k6.io/docs/examples/http-authentication#aws-signature-v4-authentication, but it doesn’t work.

Is there any other way to send AWS request using AWS Signature in K6

Hi, welcome :slight_smile:

Which k6 version are you using? (Output of k6 version)

AFAIK that’s the only way to authenticate with v4 in k6.

When you say “it doesn’t work”, what exactly doesn’t work? What steps did you take, what errors did you receive, etc.? It’s difficult to help you without being able to reproduce the issue. :slight_smile:

There’s an AWS request signing demo that @mstoykov did several months ago: https://gist.github.com/MStoykov/38cc1293daa9080b11e26053589a6865

It’s not very polished, but it shows how this can be done without any browserify or other costly alternatives.

1 Like

Hi @imiric,

Sorry for the late reply.
The error i was getting when using browserified version of aws4 was -

TypeError: Object has no member 'setPrototypeOf' at file

I’m using k6 version - v0.26.2

I have resolved the issue by referring to solution in - this issue