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

Multiple event definitions for existing Cognito User Pools #6491

Merged
merged 1 commit into from Aug 6, 2019

Conversation

pmuens
Copy link
Contributor

@pmuens pmuens commented Aug 2, 2019

What did you implement:

Closes #6420

Adds support to define multiple Cognito User Pool events in one function.

How did you implement it:

Fix it and write regression tests.

How can we verify it:

Use the following serverless.yml file or run the Cognito User Pool integration tests (which were updated as well).

service: test-${self:custom.idx}

provider:
  name: aws
  runtime: nodejs10.x
  versionFunctions: false

custom:
  idx: 0
  pool: ExistingUserPool

functions:
  pre:
    handler: handler.hello
    events:
      - cognitoUserPool:
          pool: ${self:custom.pool}
          trigger: PreSignUp
          existing: true
      - cognitoUserPool:
          pool: ${self:custom.pool}
          trigger: DefineAuthChallenge
          existing: true
  post:
    handler: handler.hello
    events:
      - cognitoUserPool:
          pool: ${self:custom.pool}
          trigger: CreateAuthChallenge
          existing: true
      - cognitoUserPool:
          pool: ${self:custom.pool}
          trigger: VerifyAuthChallengeResponse
          existing: true

Todos:

Note: Run npm run test-ci to run all validation checks on proposed changes

  • Write tests and confirm existing functionality is not broken.
    Validate via npm test
  • Write documentation
  • Ensure there are no lint errors.
    Validate via npm run lint-updated
    Note: Some reported issues can be automatically fixed by running npm run lint:fix
  • Ensure introduced changes match Prettier formatting.
    Validate via npm run prettier-check-updated
    Note: All reported issues can be automatically fixed by running npm run prettify-updated
  • Make sure code coverage hasn't dropped
  • Provide verification config / commands / resources
  • Enable "Allow edits from maintainers" for this PR
  • Update the messages below

Is this ready for review?: NO
Is it a breaking change?: NO

@pmuens pmuens force-pushed the existing-cognit-user-pool-multi branch from c3e7dae to 5c85094 Compare August 6, 2019 10:52
Copy link
Contributor

@medikoo medikoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't add more than one Lambda trigger to existing Cognito User Pools at a time
2 participants