I am working with the AWS SDK using the KMS libary. I would like to use async and await instead of callbacks.
import AWS, { KMS } from "aws-sdk";
this.kms = new AWS.KMS();
const key = await this.kms.generateDataKey();
However this does not work, when wrapped in an async function.
How can i use async and await here?
await
requires a promise; that takes a callback.