Skip to content

Commit 4b13c8a

Browse files
committed
docs(aws) update past documentation versions for new aws release
1 parent 8a92d06 commit 4b13c8a

File tree

312 files changed

+7786
-1211
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

312 files changed

+7786
-1211
lines changed

docs/sources/k6/v0.47.x/javascript-api/jslib/aws/EventBridgeClient/_index.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ EventBridgeClient methods will throw errors in case of failure.
3434
{{< code >}}
3535

3636
```javascript
37-
import { AWSConfig, EventBridgeClient } from 'https://jslib.k6.io/aws/0.11.0/event-bridge.js';
37+
import {
38+
AWSConfig,
39+
EventBridgeClient,
40+
} from 'https://jslib.k6.io/aws/{{< param "JSLIB_AWS_VERSION" >}}/event-bridge.js';
3841

3942
const awsConfig = new AWSConfig({
4043
region: __ENV.AWS_REGION,

docs/sources/k6/v0.47.x/javascript-api/jslib/aws/EventBridgeClient/putEvents.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ weight: 10
4444
{{< code >}}
4545

4646
```javascript
47-
import { AWSConfig, EventBridgeClient } from 'https://jslib.k6.io/aws/0.11.0/event-bridge.js';
47+
import {
48+
AWSConfig,
49+
EventBridgeClient,
50+
} from 'https://jslib.k6.io/aws/{{< param "JSLIB_AWS_VERSION" >}}/event-bridge.js';
4851

4952
const awsConfig = new AWSConfig({
5053
region: __ENV.AWS_REGION,

docs/sources/k6/v0.47.x/javascript-api/jslib/aws/KMSClient/KMSDataKey.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ For instance, the [`generateDataKey`](https://grafana.com/docs/k6/<K6_VERSION>/j
2525
```javascript
2626
import exec from 'k6/execution';
2727

28-
import { AWSConfig, KMSClient } from 'https://jslib.k6.io/aws/0.11.0/kms.js';
28+
import {
29+
AWSConfig,
30+
KMSClient,
31+
} from 'https://jslib.k6.io/aws/{{< param "JSLIB_AWS_VERSION" >}}/kms.js';
2932

3033
const awsConfig = new AWSConfig({
3134
region: __ENV.AWS_REGION,

docs/sources/k6/v0.47.x/javascript-api/jslib/aws/KMSClient/KMSKey.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
title: 'KMSKey'
3-
slug: 'kmskey'
43
head_title: 'KMSKey'
54
description: 'KMSKey is returned by the KMSClient.* methods that query KMS keys'
65
description: 'KMSKey is returned by the KMSClient.* methods that query KMS keys'
@@ -23,7 +22,10 @@ weight: 20
2322
```javascript
2423
import exec from 'k6/execution';
2524

26-
import { AWSConfig, KMSClient } from 'https://jslib.k6.io/aws/0.11.0/kms.js';
25+
import {
26+
AWSConfig,
27+
KMSClient,
28+
} from 'https://jslib.k6.io/aws/{{< param "JSLIB_AWS_VERSION" >}}/kms.js';
2729

2830
const awsConfig = new AWSConfig({
2931
region: __ENV.AWS_REGION,

docs/sources/k6/v0.47.x/javascript-api/jslib/aws/KMSClient/_index.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ Both the dedicated `kms.js` jslib bundle and the all-encompassing `aws.js` bundl
3939
```javascript
4040
import { textSummary } from 'https://jslib.k6.io/k6-summary/0.0.2/index.js';
4141

42-
import { AWSConfig, KMSClient } from 'https://jslib.k6.io/aws/0.11.0/kms.js';
42+
import {
43+
AWSConfig,
44+
KMSClient,
45+
} from 'https://jslib.k6.io/aws/{{< param "JSLIB_AWS_VERSION" >}}/kms.js';
4346

4447
const awsConfig = new AWSConfig({
4548
region: __ENV.AWS_REGION,

docs/sources/k6/v0.47.x/javascript-api/jslib/aws/KMSClient/generateDataKey.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ weight: 10
3030
```javascript
3131
import exec from 'k6/execution';
3232

33-
import { AWSConfig, KMSClient } from 'https://jslib.k6.io/aws/0.11.0/kms.js';
33+
import {
34+
AWSConfig,
35+
KMSClient,
36+
} from 'https://jslib.k6.io/aws/{{< param "JSLIB_AWS_VERSION" >}}/kms.js';
3437

3538
const awsConfig = new AWSConfig({
3639
region: __ENV.AWS_REGION,
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
title: 'LambdaClient'
3+
head_title: 'LambdaClient'
4+
description: 'LambdaClient allows interacting with the AWS Lambda service'
5+
weight: 00
6+
---
7+
8+
# LambdaClient
9+
10+
{{< docs/shared source="k6" lookup="blocking-aws-blockquote.md" version="<K6_VERSION>" >}}
11+
12+
`LambdaClient` interacts with [AWS Lambda](https://aws.amazon.com/lambda/). With it, you can invoke a Lambda function.
13+
14+
Both the dedicated `lambda.js` jslib bundle and the all-encompassing `aws.js` bundle include the `LambdaClient`.
15+
16+
### Methods
17+
18+
| Function | Description |
19+
| :------------------------------------------------------------------------------------------------------------------------ | :------------------------------ |
20+
| [invoke(name, payload, [options])](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/jslib/aws/lambdaclient/invoke) | Invokes an AWS Lambda function. |
21+
22+
### Throws
23+
24+
`LambdaClient` methods will throw errors in case of failure.
25+
26+
| Error | Condition |
27+
| :-------------------- | :---------------------------------------------------------- |
28+
| InvalidSignatureError | When invalid credentials were provided. |
29+
| LambdaInvocationError | When AWS replied to the requested invocation with an error. |
30+
31+
### Examples
32+
33+
{{< code >}}
34+
35+
```javascript
36+
import {
37+
AWSConfig,
38+
LambdaClient,
39+
} from 'https://jslib.k6.io/aws/{{< param "JSLIB_AWS_VERSION" >}}/lambda.js';
40+
import { check } from 'k6';
41+
42+
const awsConfig = new AWSConfig({
43+
region: __ENV.AWS_REGION,
44+
accessKeyId: __ENV.AWS_ACCESS_KEY_ID,
45+
secretAccessKey: __ENV.AWS_SECRET_ACCESS_KEY,
46+
sessionToken: __ENV.AWS_SESSION_TOKEN,
47+
});
48+
49+
const lambdaClient = new LambdaClient(awsConfig);
50+
51+
export default async function () {
52+
const response = await lambdaClient.invoke('add-numbers', JSON.stringify({ x: 1, y: 2 }));
53+
54+
check(response, {
55+
'status is 200': (r) => r.statusCode === 200,
56+
'payload is 3': (r) => r.payload === 3,
57+
});
58+
}
59+
```
60+
61+
{{< /code >}}
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
---
2+
title: 'invoke'
3+
head_title: 'LambdaClient.invoke(name, payload, [options])'
4+
description: 'LambdaClient.invoke invokes an AWS Lamba function'
5+
weight: 10
6+
---
7+
8+
# LambdaClient.invoke(name, payload, [options])
9+
10+
`LambdaClient.invoke` invokes an AWS Lambda function.
11+
12+
### Parameters
13+
14+
| Parameter | Type | Description |
15+
| :-------- | :-------------------------------------- | :---------------------------------------------- |
16+
| name | string | Name of the function to invoke. |
17+
| payload | string | Payload to send to the function being invoked. |
18+
| options | [InvocationOptions](#invocationoptions) | Additional options to customize the invocation. |
19+
20+
#### InvocationOptions
21+
22+
InvocationOptions is an object used to customize the invocation of a Lambda function.
23+
It has the following properties:
24+
25+
| Property | Type | Description |
26+
| :------------- | :---------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
27+
| invocationType | string (optional) | Specifies the invocation type (synchronous or asynchronous). Possible values are: `RequestResponse`, which invokes the function synchronously, `Event`, which invokes the function asynchronously, and `DryRun` which validates the parameter values and verifies that the user or role has permission to invoke the function. Default is `RequestResponse`. |
28+
| logType | string (optional) | Specifies the type of log to include in the response. Set to `Tail` to include the execution log in the response. Applies to synchronously invoked functions only. Default is `None`. |
29+
| clientContext | string (optional) | Client context to pass to the function. Can be made up of up to 3,583 bytes of base64-encoded data. Default is `null`. |
30+
| qualifier | string (optional) | Version or alias of the function to invoke. |
31+
32+
### Returns
33+
34+
| Type | Description |
35+
| :------------------------------------------------- | :---------------------------------------------------------------- |
36+
| Promise<[InvocationResponse](#invocationresponse)> | A promise that fulfills when the object has been deleted from S3. |
37+
38+
#### InvocationResponse
39+
40+
InvocationResponse is an object that represents the response of an invocation. It has the following properties:
41+
42+
| Property | Type | Description |
43+
| :-------------- | :---------------- | :----------------------------------------- |
44+
| statusCode | number | Status code of the invocation. |
45+
| executedVersion | string (optional) | The version of the function that executed. |
46+
| logResult | string (optional) | Log result of the invocation. |
47+
| payload | string (optional) | Payload returned by the function. |
48+
49+
### Example
50+
51+
{{< code >}}
52+
53+
```javascript
54+
import {
55+
AWSConfig,
56+
LambdaClient,
57+
} from 'https://jslib.k6.io/aws/{{< param "JSLIB_AWS_VERSION" >}}/lambda.js';
58+
import { check } from 'k6';
59+
60+
const awsConfig = new AWSConfig({
61+
region: __ENV.AWS_REGION,
62+
accessKeyId: __ENV.AWS_ACCESS_KEY_ID,
63+
secretAccessKey: __ENV.AWS_SECRET_ACCESS_KEY,
64+
sessionToken: __ENV.AWS_SESSION_TOKEN,
65+
});
66+
67+
const lambdaClient = new LambdaClient(awsConfig);
68+
69+
export default async function () {
70+
const response = await lambdaClient.invoke('add-numbers', JSON.stringify({ x: 1, y: 2 }));
71+
72+
check(response, {
73+
'status is 200': (r) => r.statusCode === 200,
74+
'payload is 3': (r) => r.payload === 3,
75+
});
76+
}
77+
```
78+
79+
{{< /code >}}

docs/sources/k6/v0.47.x/javascript-api/jslib/aws/S3Client/Bucket.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
title: 'Bucket'
33
head_title: 'Bucket'
4-
slug: 'bucket'
54
description: 'Bucket is returned by the S3Client.* methods who query S3 buckets.'
65
weight: 20
76
---
@@ -20,7 +19,10 @@ Bucket is returned by the S3Client.\* methods that query S3 buckets. Namely, `li
2019
{{< code >}}
2120

2221
```javascript
23-
import { AWSConfig, S3Client } from 'https://jslib.k6.io/aws/0.11.0/s3.js';
22+
import {
23+
AWSConfig,
24+
S3Client,
25+
} from 'https://jslib.k6.io/aws/{{< param "JSLIB_AWS_VERSION" >}}/s3.js';
2426

2527
const awsConfig = new AWSConfig({
2628
region: __ENV.AWS_REGION,

docs/sources/k6/v0.47.x/javascript-api/jslib/aws/S3Client/Object.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
---
22
title: 'Object'
33
head_title: 'Object'
4-
slug: 'object'
54
description: "Object is returned by the S3Client.* methods who query S3 buckets' objects."
65
weight: 20
76
---
87

98
# Object
109

11-
Object is returned by the S3Client.\* methods that query S3 buckets' objects. Namely, [`listObjects`](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/jslib/aws/s3client/s3client-listobjects), [`getObject`](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/jslib/aws/s3client/s3client-getobject), [`putObject`](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/jslib/aws/s3client/s3client-putobject),
12-
and [`deleteObject`](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/jslib/aws/s3client/s3client-deleteobject). The Object construct describes an Amazon S3 object.
10+
Object is returned by the S3Client.\* methods that query S3 buckets' objects. Namely, [`listObjects`](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/jslib/aws/s3client/listobjects), [`getObject`](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/jslib/aws/s3client/getobject), [`putObject`](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/jslib/aws/s3client/putobject),
11+
and [`deleteObject`](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/jslib/aws/s3client/deleteobject). The Object construct describes an Amazon S3 object.
1312

1413
| Name | Type | Description |
1514
| :-------------------- | :---------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
@@ -31,7 +30,7 @@ import {
3130
// listBuckets,
3231
AWSConfig,
3332
S3Client,
34-
} from 'https://jslib.k6.io/aws/0.11.0/s3.js';
33+
} from 'https://jslib.k6.io/aws/{{< param "JSLIB_AWS_VERSION" >}}/s3.js';
3534

3635
const awsConfig = new AWSConfig({
3736
region: __ENV.AWS_REGION,

0 commit comments

Comments
 (0)