Skip to content

Instantly share code, notes, and snippets.

@tsh-code
Created August 9, 2022 14:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tsh-code/acfa7cb3deda92061fe5d74fe7a301eb to your computer and use it in GitHub Desktop.
Save tsh-code/acfa7cb3deda92061fe5d74fe7a301eb to your computer and use it in GitHub Desktop.
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