Remove spaces from Cognito Pool Name

This commit is contained in:
Joel Van Horn 2019-07-20 00:42:57 -04:00
parent bc366d5f2e
commit 072e1155bd

View File

@ -3,7 +3,7 @@
const Lambda = require('aws-sdk/clients/lambda');
function getStatementId(functionName, userPoolName) {
const normalizedUserPoolName = userPoolName.toLowerCase().replace(/[.:*]/g, '');
const normalizedUserPoolName = userPoolName.toLowerCase().replace(/[.:*\s]/g, '');
const id = `${functionName}-${normalizedUserPoolName}`;
if (id.length < 100) {
return id;