grafana / k6-jslib-aws

Javascript Library allowing to interact with AWS resources from k6 scripts
Apache License 2.0
18 stars 28 forks source link

Is LambdaClient available? #86

Closed aaleksandrov closed 2 months ago

aaleksandrov commented 6 months ago

According to the Readme section (https://github.com/grafana/k6-jslib-aws#lambda) Lambda client should be available but Docs link leads to non-existing page https://k6.io/docs/javascript-api/jslib/aws/lambdaclient , also link from example (https://jslib.k6.io/aws/0.11.0/lambda.js) leads to 404

nickcaballero commented 6 months ago

I see it here - https://github.com/grafana/k6-jslib-aws/blob/main/build/lambda.js. Maybe it just didn't get published?

oleiade commented 6 months ago

Indeed @aaleksandrov @nickcaballero we have yet to publish a new release containing the lambda asset. It was a mishap on our side that the documentation went through prior.

We'll look into publishing a new version as soon as our outstanding PRs are merged 👍🏻

In the meantime, feel free to use the GitHub published file: https://raw.githubusercontent.com/grafana/k6-jslib-aws/main/build/lambda.js, but beware that those build files are not officially supported, and will likely change very soon, and I'd recommend to fallback to the jslib.k6.io as soon as the newer version is published 🙇🏻 (I'll update this issue when it is).

import { LambdaClient } from 'https://raw.githubusercontent.com/grafana/k6-jslib-aws/main/build/lambda.js'

export default function () {
}
oleiade commented 2 months ago

Hi @aaleksandrov 👋🏻

Sorry for the delay; we've just published jslib-aws v0.12.0, which now officially exposes the LambdaClient.

The documentation is gonna be updated soon once: https://github.com/grafana/k6-docs/pull/1585 is merged, but you can use the client already by importing it like the following:

import { AWSConfig, LambdaClient } from 'https://jslib.k6.io/aws/0.12.0/lambda.js';

Closing, but feel free to re-open or open another issue if you need further support 🙇🏻