k6-jslib-aws

Javascript Library allowing to interact with AWS resources from k6 scripts

APACHE-2.0 License

Stars
18
Committers
24

Bot releases are hidden (Show)

k6-jslib-aws - v0.11.0 Latest Release

Published by oleiade about 1 year ago

What's Changed

  • Add support for attributes and delay seconds for SQS by @nickcaballero in https://github.com/grafana/k6-jslib-aws/pull/65
  • Fixed #30, by adding a params argument to the s3.putObject method, allowing to pass specific request parameters such as contentDisposition, contentLength, contentType or contentMD5 to such requests.
  • Fixed #52, by renaming the kinesis interfaces and type properties to lowercased camelCase to fit our existing naming convention.
  • Improved S3 test coverage.

Full Changelog: https://github.com/grafana/k6-jslib-aws/compare/v0.10.0...v0.11.0

k6-jslib-aws - v0.10.0

Published by oleiade about 1 year ago

What's Changed

New Contributors

Full Changelog: https://github.com/grafana/k6-jslib-aws/compare/v0.9.0...v0.10.0

k6-jslib-aws - v0.9.0

Published by oleiade about 1 year ago

What's changed

⚠️ Important: This release contains significant changes that might affect your existing workflows. All client methods are now asynchronous, which is a breaking change from earlier versions. ⚠️

The following public methods have become asynchronous in this release:

  • KinesisClient
  • KMSClient
  • S3Client
  • SecretsManagerClient
  • SQSClient
  • SystemsManagerClient

However, the SignatureV4 class and its methods remain synchronous.

What this Means for You

Asynchronous Methods

In version v0.9.0, client methods are now async functions, which means they return a Promise instead of a data type. For instance, the S3Client.listBuckets method, previously defined as listBuckets(): Array<S3Bucket>, is now an async function: async listBuckets(): Promise<Array<S3Bucket>>.

Using the Asynchronous Methods

You can handle the returned Promise using the await keyword. This way, your asynchronous code will have a synchronous look and feel. Here's an example:

export default async function () {
  // ...
  const buckets = await s3.listBuckets()
}
Note: k6's setup, teardown, handleSummary, and default functions can be declared as async functions.

## Full Example

```javascript
import exec from 'k6/execution'
import { AWSConfig, S3Client } from 'https://jslib.k6.io/aws/0.9.0/s3.js'

const testFile = open('bonjour.txt', 'r')
const awsConfig = new AWSConfig.fromEnvironment()
const s3 = new S3Client(awsConfig)
const testBucketName = 'test-jslib-aws'
const testFileKey = 'bonjour.txt'

export default async function () {
    const buckets = await s3.listBuckets()
    if (buckets.filter((b) => b.name === testBucketName).length == 0) {
        exec.test.abort()
    }

    await s3.putObject(testBucketName, testFileKey, testFile)
    const objects = await s3.listObjects(testBucketName)
    if (objects.filter((o) => o.key === testFileKey).length == 0) {
        exec.test.abort()
    }

    const obj = await s3.getObject(testBucketName, testFileKey)
    await s3.deleteObject(testBucketName, testFileKey)
}

Compatibility with Older k6 Versions

If you're using an older version of k6 that doesn't support asynchronous code execution, we recommend staying with v0.8.1 until you upgrade your k6 version.

k6-jslib-aws - v0.8.1

Published by oleiade about 1 year ago

What's changed

  • S3 now has support for the copyObject operation, thanks to @bendennis in #53

New Contributors

  • @bendennis made their first contribution in #53

Full changelog

https://github.com/grafana/k6-jslib-aws/compare/v0.8.0...v0.8.1

k6-jslib-aws - v0.8.0

Published by oleiade over 1 year ago

What's Changed

New Contributors

Full Changelog: https://github.com/grafana/k6-jslib-aws/compare/v0.7.2...v0.8.0

k6-jslib-aws - 0.7.2

Published by oleiade over 1 year ago

This release offers:

  • A SQSClient allowing users to interact with the Amazon Simple Queue service from their k6 scripts. Thanks @nickcaballero and @jdinsel-xealth for your contributions 🙇🏻
  • AWSConfig now has a static fromEnvironment method, allowing to include the AWS configuration from environment variables in a one-liner
const config = AWSConfig.fromEnvironment()
  • A fix for misnamed accessKeyId configuration. Errors have also been adjusted to be clearer in the event of a misconfiguration.
  • A fix for the handling of signed requests by clients. Under certain circumstances, the SignatureV4 class, which is also used by most of our client classes would have produced incorrect signatures, depending on the request's payload.
k6-jslib-aws - 0.7.1

Published by immavalls almost 2 years ago

This version contains minor bug fixes:

k6-jslib-aws - v0.7.0

Published by oleiade almost 2 years ago

This version contains a complete rewrite of the AWS signature v4 procedure, and exposes a SignatureV4 class allowing to both sign and presign requests to AWS directly from your k6 scripts 🚀

It is also now possible to override the jslib's client classes (S3Client, SecretsManagerClient, etc) host, in order to, for example, interact with a AWS-compatible backend. We actually use that new feature ourselves in our test suite, in order to interact with localstack.

k6-jslib-aws - v0.6.0

Published by oleiade about 2 years ago

This version adds support for a limited subset of the Amazon AWS Systems Manager service 🚀

From the ssm.js file, users are now able to use the SystemsManagerClient to retrieve a parameter from Amazon Systems Manager, using the getParameter method.

A big thank you to @mcnamaram for contributing this feature and making this release possible 🎉 👏🏻 🙇🏻

k6-jslib-aws - v0.1.0

Published by oleiade over 2 years ago

Includes:

  • support for AWS v4 signature computation.
  • support for basic subset of AWS S3 operations.
k6-jslib-aws - v0.3.0

Published by oleiade over 2 years ago

The bundling of the library has been reshaped so that it delivers three different JS files, as well as their respective source-maps:

  • aws.min.js: includes the whole set of available AWS services.
  • s3.min.js: includes the S3Client client, as well as its dependencies.
  • secrets-manager.min.js: includes the SecretsManagerClient, as well as its dependencies.

The whole codebase has also been ported to typescript, to offer and support type annotations, which both helps to develop the library and using it.

k6-jslib-aws - v0.4.0

Published by oleiade over 2 years ago

This version contains minor improvements, refactors and bug fixes:

  • It implements support for the S3Client.listObjects prefix parameter,
    which now allows you to query only objects with a name matching the
    provided prefix.
  • It ensures the S3Object.storageClass is set when returned by the
    S3Client.getObject method.
  • Renames the existing SecretsManagerError to
    SecretsManagerServiceError for consistency.
  • Renames the SecretsManagerClient methods secretID parameter to
    id, and secretString to secret.
  • Aligns the internal error handling APIs