Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix jslib-aws links & general improvements to that specific section #1453

Merged
merged 5 commits into from
Dec 27, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,44 +1,43 @@
---
title: 'EventBridgeClient.putEvents'
title: 'putEvents'
heitortsergent marked this conversation as resolved.
Show resolved Hide resolved
head_title: 'EventBridgeClient.putEvents'
slug: 'eventbridgeclient-putevents'
description: 'EventBridgeClient.putEvents sends custom events to Amazon EventBridge'
excerpt: 'EventBridgeClient.putEvents sends custom events to Amazon EventBridge'
weight: 10
---

# EventBridgeClient.putEvents
# putEvents

`EventBridgeClient.putEvents` sends custom events to Amazon EventBridge so that they can be matched to rules.

### Parameters

| Parameter | Type | Description |
| :------------ | :-------------- | :----------------------------------------------------------------------------------------------------------------------- |
| input | [PutEventsInput](#puteventsinput) | An array of objects representing events to be submitted. |
| Parameter | Type | Description |
| :-------- | :-------------------------------- | :------------------------------------------------------- |
| input | [PutEventsInput](#puteventsinput) | An array of objects representing events to be submitted. |

#### PutEventsInput

| Parameter | Type | Description |
| :-------- | :-------------- | :----------------------------------------------------------------------------------------------------------------------- |
| Entries | [EventBridgeEntry](#eventbridgeentry)[] | An array of objects representing events to be submitted. |
| EndpointId | string (optional) | The ID of the target to receive the event. |
| Parameter | Type | Description |
| :--------- | :-------------------------------------- | :------------------------------------------------------- |
| Entries | [EventBridgeEntry](#eventbridgeentry)[] | An array of objects representing events to be submitted. |
| EndpointId | string (optional) | The ID of the target to receive the event. |

#### EventBridgeEntry

| Parameter | Type | Description |
| :-------- | :----- | :----------------------------------------------------------------------------------------------------------------------- |
| Source | string | The source of the event. |
| Detail | object | A JSON object containing event data. |
| DetailType | string | Free-form string used to decide what fields to expect in the event detail. |
| Resources | string[] (optional) | AWS resources, identified by Amazon Resource Name (ARN), which the event primarily concerns. |
| EventBusName | string (optional) | The event bus that will receive the event. If you omit this, the default event bus is used. Only the AWS account that owns a bus can write to it. |

| Parameter | Type | Description |
| :----------- | :------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------ |
| Source | string | The source of the event. |
| Detail | object | A JSON object containing event data. |
| DetailType | string | Free-form string used to decide what fields to expect in the event detail. |
| Resources | string[] (optional) | AWS resources, identified by Amazon Resource Name (ARN), which the event primarily concerns. |
| EventBusName | string (optional) | The event bus that will receive the event. If you omit this, the default event bus is used. Only the AWS account that owns a bus can write to it. |

### Returns

| Type | Description |
| :-------------- | :---------------------------------------------------------------------------------- |
| `Promise<void>` | A Promise that fulfills when the events have been sent to Amazon EventBridge. |
| Type | Description |
| :-------------- | :---------------------------------------------------------------------------- |
| `Promise<void>` | A Promise that fulfills when the events have been sent to Amazon EventBridge. |

### Example

Expand All @@ -56,19 +55,19 @@ const awsConfig = new AWSConfig({

const eventBridge = new EventBridgeClient(awsConfig);
const eventEntry = {
Source: "my.source",
Detail: {
key: "value"
},
DetailType: "MyDetailType",
Resources: ["resource-arn"],
Source: 'my.source',
Detail: {
key: 'value',
},
DetailType: 'MyDetailType',
Resources: ['resource-arn'],
};

export default async function () {
await eventBridge.putEvents({
Entries: [eventEntry]
});
await eventBridge.putEvents({
Entries: [eventEntry],
});
}
```

{{< /code >}}
{{< /code >}}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ title: 'KMSDataKey'
slug: 'kmsdatakey'
head_title: 'KMSDataKey'
description: 'KMSDataKey is returned by the KMSClient.*DataKey methods that query KMS data keys'
weight: 20
---

# KMSDataKey
Expand All @@ -11,10 +12,10 @@ description: 'KMSDataKey is returned by the KMSClient.*DataKey methods that quer
The KMSDataKey object describes an Amazon Key Management Service data key.
For instance, the [`generateDataKey`](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/jslib/aws/kmsclient/kmsclient-generatedatakey/) returns the generated KMSDataKey object.

| Name | Type | Description |
| :-------------------------- | :----- | :------------------------------------------------------------------------------------------------------------------------------ |
| `KMSDataKey.id` | string | The identifier of the Key Management Service key that encrypted the data key. |
| `KMSDataKey.ciphertextBlob` | string | The base64-encoded encrypted copy of the data key. |
| Name | Type | Description |
| :-------------------------- | :----- | :-------------------------------------------------------------------------------------------------------------------------------------------------- |
| `KMSDataKey.id` | string | The identifier of the Key Management Service key that encrypted the data key. |
| `KMSDataKey.ciphertextBlob` | string | The base64-encoded encrypted copy of the data key. |
| `KMSDataKey.plaintext` | string | The plain text data key. Use this data key to encrypt your data outside of Key Management Service. Then, remove it from memory as soon as possible. |

### Example
Expand Down Expand Up @@ -53,4 +54,3 @@ export default async function () {
_A k6 script that generating a data key from an AWS Key Management Service key_

{{< /code >}}

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
title: 'KMSKey'
slug: 'kmskey'
head_title: 'KMSKey'
description: 'KMSKey is returned by the KMSClient.* methods that query KMS keys'
excerpt: 'KMSKey is returned by the KMSClient.* methods that query KMS keys'
weight: 20
---

# KMSKey
Expand Down Expand Up @@ -47,4 +47,4 @@ export default async function () {

_A k6 script querying the user's Key Management Service keys and verifying their test key exists_

{{< /code >}}
{{< /code >}}
10 changes: 5 additions & 5 deletions docs/sources/next/javascript-api/jslib/aws/KMSClient/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ Both the dedicated `kms.js` jslib bundle and the all-encompassing `aws.js` bundl

### Methods

| Function | Description |
| :-------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------- |
| [listKeys](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/jslib/aws/kmsclient/00 listkeys) | List the all the Key Management Service keys in the caller's AWS account and region. |
| [generateDataKey](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/jslib/aws/kmsclient/00 generateDataKey) | Generate a symmetric data key for use outside of the AWS Key Management Service. |
| Function | Description |
| :------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------- |
| [listKeys](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/jslib/aws/kmsclient/listkeys) | List the all the Key Management Service keys in the caller's AWS account and region. |
| [generateDataKey](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/jslib/aws/kmsclient/generatedatakey) | Generate a symmetric data key for use outside of the AWS Key Management Service. |

### Throws

Expand Down Expand Up @@ -63,7 +63,7 @@ export default async function (data) {

export function handleSummary(data) {
return {
stdout: textSummary(data, { indent: ' ', enableColors: true }),
'stdout': textSummary(data, { indent: ' ', enableColors: true }),
'./test-run.key': data.dataKey,
};
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
---
title: 'KMSClient.generateDataKey'
title: 'generateDataKey'
heitortsergent marked this conversation as resolved.
Show resolved Hide resolved
head_title: 'KMSClient.generateDataKey'
slug: 'kmsclient-generatedatakey'
description: 'KMSClient.generateDataKey generates a symmetric data key for use outside of the AWS Key Management Service'
excerpt: 'KMSClient.generateDataKey generates a symmetric data key for use outside of the AWS Key Management Service'
weight: 10
---

# KMSClient.generateDataKey
# generateDataKey

`KMSClient.generateDataKey` generates a symmetric data key for use outside of the AWS Key Management Service.

### Parameters

| Name | Type | Description |
| :--- | :----- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Name | Type | Description |
| :----- | :----- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id` | string | The identifier of the key. This can be either the key ID or the Amazon Resource Name (ARN) of the key. |
| `size` | number | The length of the data key. For example, use the value 64 to generate a 512-bit data key (64 bytes is 512 bits). For 256-bit (32-byte) data keys, use the value 32, instead. |

### Returns

| Type | Description |
| :-------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------- |
| Type | Description |
| :------------------------------------------------------------------------------------------------------------ | :-------------------------------------------------------------------------------------------------------------------------------------- |
| Promise<[KMSDataKey](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/jslib/aws/kmsclient/kmsdatakey)> | A Promise that fulfills with a [KMSDataKey](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/jslib/aws/kmsclient/kmskey) object. |

### Example
Expand Down Expand Up @@ -59,5 +59,3 @@ export default async function () {
_A k6 script that generating a data key from an AWS Key Management Service key_

{{< /code >}}


Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
---
title: 'KMSClient.listKeys()'
title: 'listKeys'
heitortsergent marked this conversation as resolved.
Show resolved Hide resolved
head_title: 'KMSClient.listKeys()'
slug: 'kmsclient-listkeys'
description: "KMSClient.listKeys lists all the KMS keys in the caller's AWS account and region"
excerpt: "KMSClient.listKeys lists all the KMS keys in the caller's AWS account and region"
weight: 10
---

# KMSClient.listKeys()
# listKeys

`KMSClient.listKeys()` lists all the Key Management Service keys in the caller's AWS account and region.

### Returns

| Type | Description |
| :-------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------- |
| Type | Description |
| :------------------------------------------------------------------------------------------------------ | :----------------------------------------------------------------------------------------------------------------------------------------------- |
| Promise<[KMSKey[]](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/jslib/aws/kmsclient/kmskey)> | A Promise that fulfills with an array of [`KMSKey`](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/jslib/aws/kmsclient/kmskey) objects. |

### Example
Expand Down Expand Up @@ -49,5 +49,3 @@ export default async function () {
_A k6 script querying the user's Key Management Service keys and verifying their test key exists_

{{< /code >}}


This file was deleted.

Loading
Loading