{"id":18429716,"url":"https://github.com/joanlopez/xk6-aws","last_synced_at":"2025-08-09T02:09:41.294Z","repository":{"id":239666063,"uuid":"800191528","full_name":"joanlopez/xk6-aws","owner":"joanlopez","description":"A k6 extension to interact with Amazon Web Services (S3, EventBridge, Kinesis, etc)","archived":false,"fork":false,"pushed_at":"2024-06-11T17:00:56.000Z","size":98,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-25T00:30:56.776Z","etag":null,"topics":["aws","aws-sdk","xk6","xk6-extension"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joanlopez.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-05-13T21:55:10.000Z","updated_at":"2024-10-15T07:29:41.000Z","dependencies_parsed_at":"2025-04-13T21:55:06.677Z","dependency_job_id":"a9c17869-081b-4107-a1c1-12ac91d3b9e6","html_url":"https://github.com/joanlopez/xk6-aws","commit_stats":null,"previous_names":["joanlopez/xk6-aws"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/joanlopez/xk6-aws","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joanlopez%2Fxk6-aws","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joanlopez%2Fxk6-aws/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joanlopez%2Fxk6-aws/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joanlopez%2Fxk6-aws/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joanlopez","download_url":"https://codeload.github.com/joanlopez/xk6-aws/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joanlopez%2Fxk6-aws/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269518731,"owners_count":24430644,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-09T02:00:10.424Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","aws-sdk","xk6","xk6-extension"],"created_at":"2024-11-06T05:18:27.673Z","updated_at":"2025-08-09T02:09:41.217Z","avatar_url":"https://github.com/joanlopez.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# xk6-aws\n\nxk6-aws is an [extension for k6](https://k6.io/docs/extensions). \nIt adds support to interact with [Amazon Web Services](https://aws.amazon.com/es/) from your k6 scripts.\n\n```javascript\nimport {S3Client} from \"k6/x/aws\";\n\nexport default function () {\n  // By default, it uses the default AWS credentials (from environment variables or shared credentials file)\n  const s3 = new S3Client();\n\t\n  const {contents} = s3.listObjects({bucket: \"my-bucket\"})\n}\n```\n\nCheck the [examples](#examples) section below for an extensive and complete implementation.\n\n## Getting started\n\nUsing the xk6-aws extension involves building a k6 binary incorporating it. \nA detailed guide on how to do this using a [Docker](https://www.docker.com/) or [Go](https://go.dev/) environment\nis available in the [extension's documentation](https://grafana.com/docs/k6/latest/extensions/build-k6-binary-using-go/).\n\nIn the current state, building directly from the source code using Go could be helpful. We list below the suggested steps:\n\n### Prepare the local environment\n\n1. Make sure `git` and `go` are available commands.\n2. Install [xk6](https://github.com/grafana/xk6#local-installation) as suggested in the [local installation](https://github.com/grafana/xk6#local-installation) documentation's section.\n3. Clone the xk6-aws repository and move inside the project's folder\n\n### Build the binary\n\n1. Build a k6 binary incorporating the xk6-aws extension\n```bash\nxk6 build --with github.com/joanlopez/xk6-aws=.\n```\n\n2. Run a test script with the newly built binary\n```bash\n./k6 run script.js\n```\n\n## Usage\n\nOnce [built](#getting-started) into a k6 executable using [xk6](https://github.com/grafana/xk6),\nthe extension can be imported by load test scripts as the `k6/x/aws` JavaScript module.\n\n```javascript\nimport {AWSConfig} from 'k6/x/aws';\n```\n\n### AWSConfig\n\nThe module exports a `AWSConfig` type which can be used to configure a service client. \nConstruct an `AWSConfig` instance by passing the region, credentials and optionally the endpoint details.\n\n```js\nconst config = new AWSConfig(\n  {\n    region: \"us-east-1\",\n    access_key_id: \"test\",\n    secret_access_key: \"test\",\n    endpoint: {url: \"http://localhost:4566\", signing_region: \"us-east-1\"},\n  },\n);\n```\n\nThe table below details the expected arguments:\n\n| Argument                | Type   | Required | Description                                                                                          |\n|-------------------------|--------|----------|------------------------------------------------------------------------------------------------------|\n| Region                  | string | No       | The AWS region where the resources will be created or accessed.                                      |\n| Access key id           | string | No       | The AWS access key ID for the account.                                                               |\n| Secret access key       | string | No       | The AWS secret access key for the account.                                                           |\n| Endpoint url            | string | No       | The complete URL to use for the constructed client. Overrides the default endpoint for the service.  |\n| Endpoint signing region | string | No       | The region to use for signing the request. Useful when the endpoint URL differs from the AWS region. |\n\nAn initialized configuration can then be used to instantiate a service client.\n\n```js\nconst s3 = new S3Client(config);\n```\n\nWhen no `AWSConfig` is provided, service clients will use the default AWS credentials (_from environment variables or shared credentials file_):\n- `AWS_REGION`\n- `AWS_ACCESS_KEY_ID`\n- `AWS_SECRET_ACCESS_KEY`\n- `AWS_SESSION_TOKEN`\n- `AWS_ENDPOINT_URL`\n\n```js\nconst s3 = new S3Client();\n```\n\nThe returned client (`s3` in this example) can be used to interact with the corresponding service.\n\n## Examples\n\nIn [examples](./examples) you can find a [fully working testing environment](./examples/docker-compose.yml),\nbased on [LocalStack](https://www.localstack.cloud/) and script examples for different services \n([s3.js](./examples/s3.js), [kinesis.js](./examples/kinesis.js), [eventbridge.js](./examples/eventbridge.js)...) \nare available to demonstrate how to use the `k6/x/aws` module to interact with each of the services.\n\n## Support\n\nPlease, note that this extension is not officially supported by Grafana Labs/k6 core team.\n\n## Development\n\nThis extension is built on top of the [AWS SDK for Go v2 (aws-sdk-go-v2)](https://github.com/aws/aws-sdk-go-v2).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoanlopez%2Fxk6-aws","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoanlopez%2Fxk6-aws","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoanlopez%2Fxk6-aws/lists"}