Created
August 9, 2022 14:59
-
-
Save tsh-code/acfa7cb3deda92061fe5d74fe7a301eb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Chime } from "@aws-sdk/client-chime"; | |
const throttledQueue = require("throttled-queue"); | |
const queue = throttledQueue(10, 1000, true); | |
const chimeClient = new Chime(chimeConfig); | |
async createAppInstanceUser(userName: string, appInstanceArn: string) { | |
const newUser = await this.queue(() => | |
this.client.createAppInstanceUser({ | |
AppInstanceArn: appInstanceArn, | |
AppInstanceUserId: userName, | |
Name: userName, | |
}), | |
); | |
return newUser.AppInstanceUserArn; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment