No results for

Powered byAlgolia

KMSClient.*DataKey methods, querying Key Management Service data keys, return some KMSDataKey instances. The KMSDataKey object describes an Amazon Key Management Service data key. For instance, the generateDataKey returns the generated KMSDataKey object.

KMSDataKey.idstringThe identifier of the Key Management Service key that encrypted the data key.
KMSDataKey.ciphertextBlobstringThe base64-encoded encrypted copy of the data key.
KMSDataKey.plaintextstringThe 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.


import exec from 'k6/execution';
import { AWSConfig, KMSClient } from '';
const awsConfig = new AWSConfig({
region: __ENV.AWS_REGION,
const kms = new KMSClient(awsConfig);
const testKeyId = 'e67f95-4c047567-4-a0b7-62f7ce8ec8f48';
export default function () {
// List the KMS keys the AWS authentication configuration
// gives us access to.
const keys = kms.listKeys();
// If our test key does not exist, abort the execution.
if (keys.filter((b) => b.keyId === testKeyId).length == 0) {
// Generate a data key from the KMS key.
const key = kms.generateDataKey(testKeyId, 32);