Skip to content

Commit

Permalink
restore backed up groups to users
Browse files Browse the repository at this point in the history
  • Loading branch information
Philipp Tölke committed Jan 12, 2021
1 parent 07a69d4 commit c6f101a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,19 @@ function restore(cli) {
const wrapped = limiter.wrap(async () => cognitoIsp.adminCreateUser(params).promise());
const response = await wrapped();
console.log(response);

if (user.Groups) {
user.Groups.forEach(async (group) => {
const iparams = {
UserPoolId: userPoolId,
Username: user.Username,
GroupName: group,
};
const iwrapped = limiter.wrap(async () => cognitoIsp.adminAddUserToGroup(iparams).promise());
const iresponse = await iwrapped();
console.log(iresponse);
});
}
});
});
}
Expand Down

0 comments on commit c6f101a

Please sign in to comment.