Add support for existing Cognito User Pools#6362
Merged
Conversation
7 tasks
7db8b73 to
8d6f1de
Compare
315679f to
49ccc72
Compare
exoego
reviewed
Jul 17, 2019
lib/plugins/aws/package/compile/events/cognitoUserPool/index.js
Outdated
Show resolved
Hide resolved
lib/plugins/aws/package/compile/events/cognitoUserPool/index.js
Outdated
Show resolved
Hide resolved
medikoo
reviewed
Jul 17, 2019
lib/plugins/aws/customResources/resources/cognitoUserPool/lib/permissions.js
Outdated
Show resolved
Hide resolved
lib/plugins/aws/customResources/resources/cognitoUserPool/lib/userPool.js
Outdated
Show resolved
Hide resolved
lib/plugins/aws/customResources/resources/cognitoUserPool/lib/userPool.js
Outdated
Show resolved
Hide resolved
lib/plugins/aws/package/compile/events/cognitoUserPool/index.js
Outdated
Show resolved
Hide resolved
49ccc72 to
71ef724
Compare
Contributor
Author
71ef724 to
b929c82
Compare
b929c82 to
63c070c
Compare
medikoo
approved these changes
Jul 18, 2019
Contributor
medikoo
left a comment
There was a problem hiding this comment.
LGTM, still on stylistic note, it'll be good to reduce lodash usage.
I see in many places _.merge where Object.assign works, or _.forEach(array), where we can directly do array.forEach or for (const item of array)
I think it'll be good to favor native functions over external utils (where they do not bring added value)
Contributor
Author
|
Thanks for the review @medikoo 👍 I agree that we should definitely try to adhere to vanilla JS as much as possible given that we dropped support for all the old Node.js versions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds support for existing Cognito User Pools via a custom resource.
What did you implement:
Closes #4207
Closes #5401
Refs #4241
Refs #5642
Refs #6290
/cc @exoego
How did you implement it:
Checks the
existingconfig property of thecognitoUserPoolevent and swaps out the Cognito User Pool CloudFormation resource with a custom resource the Serverless Framework provides. The custom resource basically does raw SDK calls to update the existing Cognito User Pool. This way everything is encapsulated via CloudFormation and the stack won't get out of sync if we implement it via raw SDK calls.How can we verify it:
Todos:
Note: Run
npm run test-cito run all validation checks on proposed changesValidate via
npm testValidate via
npm run lint-updatedNote: Some reported issues can be automatically fixed by running
npm run lint:fixValidate via
npm run prettier-check-updatedNote: All reported issues can be automatically fixed by running
npm run prettify-updatedIs this ready for review?: YES
Is it a breaking change?: NO