Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: skip UserPoolId and use only IDs with pattern UserPoolIdXXXX #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,15 +169,18 @@ class ServerlessPlugin {
this.plugin_log('process_deploy started.');
var that = this;
try {
var userpoolids = await this.get_deployed_userpool_id();
userpoolids.forEach(function(userpoolid) {
var resource = that.serverless.service.resources.Resources[userpoolid.name.substring(10)];
var domain = resource.Properties.UserPoolName;
userpoolid.domain = domain;
});
for (var index in userpoolids) {
await that.create_userpool_domain(userpoolids[index].id, userpoolids[index].domain);
}
var userpoolids = await this.get_deployed_userpool_id()
userpoolids = userpoolids
.filter(upi => upi.name !== 'UserPoolId')
.map(upi => {
var cleanName = upi.name.substring(10)
var resource = that.serverless.service.resources.Resources[cleanName]
upi.domain = resource.Properties.UserPoolName
return upi
})
userpoolids.forEach(async ({ id, domain }) => {
await that.create_userpool_domain(id, domain)
})
} catch (error) {
this.plugin_log(error.stack);
}
Expand Down