-
Notifications
You must be signed in to change notification settings - Fork 819
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
Ability to add custom EventSource and lambda triggers via amplify add function, Kinesis support in analytics category #2463
Merged
kaustavghosh06
merged 56 commits into
aws-amplify:master
from
ambientlight:lambda-custom-event-source
Feb 25, 2020
Merged
Changes from 6 commits
Commits
Show all changes
56 commits
Select commit
Hold shift + click to select a range
f383c94
feat(amplify-category-function): trig base logic
ambientlight 75ef928
fix(amplify-category-function): lint-fix
ambientlight c9da7da
feat(graphql-dynamodb-transformer): liftnested out
ambientlight bfe7a44
feat(amplify-category-function): api/storage trigs
ambientlight a1ba0ed
fix(amplify-category-function): remove sqs from lambda triggers
ambientlight 31db0aa
feat(cli): optional custom question in service-select-prompt
ambientlight 16294f5
fix(cli): fix param rename in comments in copy-batch
ambientlight 9432e3d
feat(amplify-category-analytics): barebone kinesis
ambientlight 14c95a6
feat(amplify-category-analytics): kinesis cognito policies
ambientlight 9516fe6
feat(amplify-category-analytics): kinesis update support
ambientlight c462608
feat(amplify-category-function): analytics kinesis trigger support
ambientlight ef4d0dd
Merge branch 'master' into lambda-custom-event-source
ambientlight e116ca9
fix: lint fix
ambientlight bc5385d
fix(amplify-category-function): fix non appsync resources, redund prompt
ambientlight 5aee354
fix(amplify-category-analytics): getIAMPolicies for kinesis
ambientlight 0fa8c87
fix(amplify-category-analytics): create flow filter condition in kinesis
ambientlight c2e5027
feat(amplify-provider-awscloudformation): nested stack outputs in meta
ambientlight 44d596b
fix(amplify-provider-awscloudformation): logicalId nested, nested forall
ambientlight f1d7c82
fix(graphql-dynamodb-transformer): remove exposed nested outputs in root
ambientlight d1bb7a1
feat(amplify-provider-awscloudformation): exports support
ambientlight 047fece
fix(amplify-provider-awscloudformation): depends.exports fixes
ambientlight 6415619
feat(amplify-category-function): dynamoDB lambda trigger with exports
ambientlight 48e5a2c
feat(amplify-category-analytics): check auth rules in kinesis
ambientlight fbbb939
fix(amplify-provider-awscloudformation): cleaner dependsOn exports
ambientlight 21af03b
fix(amplify-category-function): importValue directly for multienv
ambientlight 5579a9c
feat(amplify-category-analytics): kinesis tweaks, console support
ambientlight 2b628e4
feat(amplify-category-analytics): lock single kinesis resource
ambientlight 548293d
feat(amplify-category-function): collect directives, multi-DDB support
ambientlight c9a4c70
feat(amplify-category-function): lint fix, missed assign, tran-core dep
ambientlight 41ebcb6
feat(amplify-category-api): model-scoped getIAMPolicies
ambientlight f8788e0
feat(amplify-provider-awscloudformation): remove exports aggregation
ambientlight e86b49f
fix(amplify-provider-awscloudformation): fix leftover resourceOutput
ambientlight fee6dcf
Merge branch 'master' into lambda-custom-event-source
ambientlight 7d53c9e
Revert "feat(amplify-category-api): model-scoped getIAMPolicies"
ambientlight 5758a5b
feat(amplify-category-function): trigger dep GraphQLAPIEndpointOutput
ambientlight b3f5913
fix(amplify-category-api): fix undefined TransformPackage
ambientlight 0f1e2c7
feat(amplify-category-function): appsync @model tables in storage flow
ambientlight c30dc36
Merge branch 'master' into lambda-custom-event-source
ambientlight 5b3660c
fix(amplify-category-function): fn::sub reference, storage flow
ambientlight e3ec6ae
Merge branch 'lambda-custom-event-source' of https://github.com/ambie…
ambientlight d9903c2
Merge branch 'master' into lambda-custom-event-source
ambientlight b0af83b
feat(amplify-category-function): model permissions lambda envs
ambientlight 452f46f
fix(amplify-category-analytics): typos, use latest api for service meta
ambientlight 77b4b4c
fix(amplify-category-function): remove scripts, update deps
ambientlight 07a2165
fix(amplify-category-function): guard absent res category in meta
ambientlight e904ce7
fix(amplify-category-function): package.json update
ambientlight c7226e7
Merge branch 'master' into lambda-custom-event-source
ambientlight b58bfc8
fix(amplify-category-function): update flow CF params assume Ref envvar
ambientlight f6d474b
fix(amplify-category-function): triggerEventSourceMappings as array
ambientlight 30744aa
fix(amplify-category-analytics): extend getIAMPolicies for kinesis
ambientlight 1218ff8
fix(amplify-e2e-tests): account for analytics flow update
ambientlight fdcba7d
feat(amplify-e2e-tests): sample lambda trigger e2e test
ambientlight 1f79657
feat(amplify-e2e-tests): kinesis trigger, name validation, template
ambientlight 68a0b7e
fix(amplify-category-function): fix inf loop in unexisting ddb, tests
ambientlight 3dc454b
feat(amplify-e2e-tests): additional perm tests, fix ddb arn derivation
ambientlight 3fc7e57
Merge https://github.com/aws-amplify/amplify-cli into lambda-custom-e…
ambientlight File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
9 changes: 9 additions & 0 deletions
9
...egory-function/provider-utils/awscloudformation/function-template-dir/trigger-dynamodb.js
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
exports.handler = function (event, context) { //eslint-disable-line | ||
console.log(JSON.stringify(event, null, 2)); | ||
event.Records.forEach((record) => { | ||
console.log(record.eventID); | ||
console.log(record.eventName); | ||
console.log('DynamoDB Record: %j', record.dynamodb); | ||
}); | ||
context.done(null, 'Successfully processed DynamoDB record'); // SUCCESS with message | ||
}; | ||
This file contains 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
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not use the callback model since this isn't an async function? https://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-handler.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
absolutely, actually originally just copied this template from
amplify-cli/packages/amplify-category-storage/provider-utils/awscloudformation/triggers/dynamoDB/index.js
Lines 1 to 10 in 08c0c70
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not suggesting you change it. Just curious. If that's the template used then follow that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is a default lambda code template for @model trigger, thanks for bringing this up, it makes sense refining both templates. I mean, for now storage category trigger does not utilize function-category implementation, while actually having a very same logic for triggers, if this gets accepted, will be great to have another PR updating that utilizes function-category implementation in storage flow.