Skip to content

Commit

Permalink
fix(AWS Cognito): Correct logicalIds based on triggers (#9592)
Browse files Browse the repository at this point in the history
* fix: strips nonalphanumerical characters

* fix: strips nonalphanumerical characters

* test: strips nonalphanumerical characters

* test: strips nonalphanumerical characters

* fix: prettier check
  • Loading branch information
Arun-kc committed Jun 14, 2021
1 parent 4a732e2 commit f4c9b58
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/plugins/aws/lib/naming.js
Expand Up @@ -519,7 +519,7 @@ module.exports = {
functionName
)}LambdaPermissionCognitoUserPool${this.normalizeNameToAlphaNumericOnly(
poolId
)}TriggerSource${triggerSource}`;
)}TriggerSource${this.normalizeNameToAlphaNumericOnly(triggerSource)}`;
},
getLambdaAlbPermissionLogicalId(functionName) {
return `${this.getNormalizedFunctionName(functionName)}LambdaPermissionAlb`;
Expand Down
6 changes: 4 additions & 2 deletions test/unit/lib/plugins/aws/lib/naming.test.js
Expand Up @@ -705,9 +705,11 @@ describe('#naming()', () => {
sdk.naming.getLambdaCognitoUserPoolPermissionLogicalId(
'functionName',
'Pool1',
'CustomMessage'
'PreSignUp_ExternalProvider'
)
).to.equal('FunctionNameLambdaPermissionCognitoUserPoolPool1TriggerSourceCustomMessage');
).to.equal(
'FunctionNameLambdaPermissionCognitoUserPoolPool1TriggerSourcePreSignUpExternalProvider'
);
});

describe('#getLambdaAlbPermissionLogicalId()', () => {
Expand Down

0 comments on commit f4c9b58

Please sign in to comment.