-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
feat(events-targets): add support for AppSync as an EventBridge rule target #29584
Conversation
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.
Thanks 👍
Left some suggestions for minor adjustments
if (this.props.deadLetterQueue) { | ||
addToDeadLetterQueueResourcePolicy(rule, this.props.deadLetterQueue); | ||
} | ||
|
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.
From docs:
EventBridge supports AWS AppSync public GraphQL APIs. EventBridge does not currently support AWS AppSync Private APIs.
Shouldn't we validate visibility: 'GLOBAL'
as well?
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.
added check.
const role = this.props.eventRole || singletonEventRole(this.appsyncApi); | ||
|
||
// if a role was not provided, attach a permission | ||
if (!this.props.eventRole) { |
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.
if (!this.props.eventRole) { | |
if (!this.props.eventRole && this.props.mutationFields.length) { |
Should we grant permissions if there are no mutationFields
?
Also, is it ok to assume that the provided eventRole
will always have the necessary permissions?
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.
removed mutationFields
, developer needs to provide the proper permissions if they specify the role directly. If eventRole
is provided by customer, there's no check.
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.
developer needs to provide the proper permissions if they specify the role directly
Can you please add it to the README with an example?
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.
done
/** | ||
* The variables that are include in the GraphQL operation. | ||
*/ | ||
readonly variables: events.RuleTargetInput; |
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.
readonly variables: events.RuleTargetInput; | |
readonly variables?: events.RuleTargetInput; |
Can we expect GraphQL queries without variables?
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.
changed to optional
// GIVEN | ||
let stack: cdk.Stack; |
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.
// GIVEN | |
let stack: cdk.Stack; | |
describe('AppSync GraphQL API target', () => { | |
let stack: cdk.Stack; | |
... |
Let's wrap it in a describe
to keep it more organized.
Also, can you please remove the commented dead-code in the file?
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.
updated.
Co-authored-by: Luca Pizzini <[email protected]>
Co-authored-by: Luca Pizzini <[email protected]>
Co-authored-by: Luca Pizzini <[email protected]>
@Mergifyio update |
❌ Mergify doesn't have permission to updateFor security reasons, Mergify can't update this pull request. Try updating locally. |
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
@Mergifyio queue |
🛑 The pull request has been removed from the queue
|
@Mergifyio refresh |
✅ Pull request refreshed |
Reason for this change
Introduces support to configure AppSync GraphQLAPI as an EventBridge target.
Description of changes
GraphQLEndpointArn
attribute in L2 GraphQLAPI constructevents.IRuleTarget
forAppSync
Description of how you validated changes
unit test and integration tests
Issue
Solves #29884
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license