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

feat(events-targets): add support for AppSync as an EventBridge rule target #29584

Merged
merged 35 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
35e2940
--wip-- [skip ci]
onlybakam Feb 24, 2024
5e15a69
--wip-- [skip ci]
onlybakam Feb 24, 2024
c96645e
--wip-- [skip ci]
onlybakam Feb 26, 2024
291c856
Merge branch 'aws:main' into appsync-event-target
onlybakam Feb 26, 2024
48e7451
Merge branch 'aws:main' into appsync-event-target
onlybakam Mar 1, 2024
22be0d4
add unit tests
onlybakam Mar 8, 2024
73aa8ac
--wip-- [skip ci]
onlybakam Mar 12, 2024
0d108bf
--wip-- [skip ci]
onlybakam Mar 12, 2024
dac9bed
Merge branch 'aws:main' into appsync-event-target
onlybakam Mar 12, 2024
cf4317f
Merge branch 'aws:main' into appsync-event-target
onlybakam Mar 22, 2024
75c66c8
update readme
onlybakam Mar 22, 2024
0ef6506
Merge remote-tracking branch 'origin/appsync-event-target' into appsy…
onlybakam Mar 22, 2024
01bd63a
Merge branch 'aws:main' into appsync-event-target
onlybakam Mar 22, 2024
3a58232
update appsync README
onlybakam Mar 22, 2024
3a4b107
Merge remote-tracking branch 'origin/appsync-event-target' into appsy…
onlybakam Mar 22, 2024
46a4b6c
update README
onlybakam Mar 23, 2024
bbb4c85
fix readme
onlybakam Mar 25, 2024
0765724
Update packages/aws-cdk-lib/aws-events-targets/README.md
onlybakam Apr 3, 2024
2b77f66
Update packages/aws-cdk-lib/aws-events-targets/lib/appsync.ts
onlybakam Apr 3, 2024
6cf0ebd
Update packages/aws-cdk-lib/aws-events-targets/lib/appsync.ts
onlybakam Apr 3, 2024
481bdba
Add visibility check. Remove
onlybakam Apr 4, 2024
7c3d855
update test
onlybakam Apr 4, 2024
6f83ad2
fix README
onlybakam Apr 4, 2024
82d6d2e
Apply suggestions from code review
onlybakam Apr 16, 2024
c9f7243
Update IGraphQlAPI to allow constructing a valid API that can be used…
onlybakam Apr 24, 2024
80de63a
Rename props to match GraphQLApi type and fix readme comment
onlybakam Apr 24, 2024
d4667c4
update tests
onlybakam Apr 24, 2024
af01610
Merge branch 'main' into appsync-event-target
onlybakam May 2, 2024
1621ad9
update to `eventRole`
onlybakam May 2, 2024
6ed6eee
Update packages/aws-cdk-lib/aws-appsync/lib/graphqlapi-base.ts
onlybakam May 8, 2024
b75afa5
Update packages/aws-cdk-lib/aws-appsync/lib/graphqlapi.ts
onlybakam May 8, 2024
e18567e
Fix readme and update appsync.test.ts
onlybakam May 10, 2024
16fc9a7
fix readme
onlybakam May 10, 2024
cbaf203
Merge branch 'main' into appsync-event-target
gracelu0 May 11, 2024
87f427d
Merge branch 'main' into appsync-event-target
mergify[bot] May 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
type Event {
message: String
}
type Query {
getTests: [Event]!
}
type Mutation {
publish(message: String!): Event
}

type Subscription {
onPublish: Event @aws_subscribe(mutations: ["publish"])
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,238 @@
{
"Resources": {
"baseApiCDA4D43A": {
"Type": "AWS::AppSync::GraphQLApi",
"Properties": {
"AuthenticationType": "AWS_IAM",
"Name": "aws-cdk-aws-appsync-target-integ-api"
}
},
"baseApiSchemaB12C7BB0": {
"Type": "AWS::AppSync::GraphQLSchema",
"Properties": {
"ApiId": {
"Fn::GetAtt": [
"baseApiCDA4D43A",
"ApiId"
]
},
"Definition": "type Event {\n message: String\n}\ntype Query {\n getTests: [Event]!\n}\ntype Mutation {\n publish(message: String!): Event\n}\n\ntype Subscription {\n onPublish: Event @aws_subscribe(mutations: [\"publish\"])\n}\n"
}
},
"baseApinone7DDDEE3D": {
"Type": "AWS::AppSync::DataSource",
"Properties": {
"ApiId": {
"Fn::GetAtt": [
"baseApiCDA4D43A",
"ApiId"
]
},
"Name": "none",
"Type": "NONE"
}
},
"baseApipublisherC3F47EA2": {
"Type": "AWS::AppSync::Resolver",
"Properties": {
"ApiId": {
"Fn::GetAtt": [
"baseApiCDA4D43A",
"ApiId"
]
},
"Code": "export const request = (ctx) => ({payload: null})\nexport const response = (ctx) => ctx.args.message",
"DataSourceName": "none",
"FieldName": "publish",
"Kind": "UNIT",
"Runtime": {
"Name": "APPSYNC_JS",
"RuntimeVersion": "1.0.0"
},
"TypeName": "Mutation"
},
"DependsOn": [
"baseApinone7DDDEE3D",
"baseApiSchemaB12C7BB0"
]
},
"baseApiEventsRoleAC472BD7": {
"Type": "AWS::IAM::Role",
"Properties": {
"AssumeRolePolicyDocument": {
"Statement": [
{
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": "events.amazonaws.com"
}
}
],
"Version": "2012-10-17"
}
}
},
"baseApiEventsRoleDefaultPolicy94199357": {
"Type": "AWS::IAM::Policy",
"Properties": {
"PolicyDocument": {
"Statement": [
{
"Action": "appsync:GraphQL",
"Effect": "Allow",
"Resource": {
"Fn::Join": [
"",
[
"arn:",
{
"Ref": "AWS::Partition"
},
":appsync:",
{
"Ref": "AWS::Region"
},
":",
{
"Ref": "AWS::AccountId"
},
":apis/",
{
"Fn::GetAtt": [
"baseApiCDA4D43A",
"ApiId"
]
},
"/types/Mutation/fields/publish"
]
]
}
}
],
"Version": "2012-10-17"
},
"PolicyName": "baseApiEventsRoleDefaultPolicy94199357",
"Roles": [
{
"Ref": "baseApiEventsRoleAC472BD7"
}
]
}
},
"Queue4A7E3555": {
"Type": "AWS::SQS::Queue",
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
},
"QueuePolicy25439813": {
"Type": "AWS::SQS::QueuePolicy",
"Properties": {
"PolicyDocument": {
"Statement": [
{
"Action": "sqs:SendMessage",
"Condition": {
"ArnEquals": {
"aws:SourceArn": {
"Fn::GetAtt": [
"TimerBF6F831F",
"Arn"
]
}
}
},
"Effect": "Allow",
"Principal": {
"Service": "events.amazonaws.com"
},
"Resource": {
"Fn::GetAtt": [
"Queue4A7E3555",
"Arn"
]
},
"Sid": "AllowEventRuleawscdkawsappsynctargetintegTimer2A2187F8"
}
],
"Version": "2012-10-17"
},
"Queues": [
{
"Ref": "Queue4A7E3555"
}
]
}
},
"TimerBF6F831F": {
"Type": "AWS::Events::Rule",
"Properties": {
"ScheduleExpression": "rate(1 minute)",
"State": "ENABLED",
"Targets": [
{
"AppSyncParameters": {
"GraphQLOperation": "mutation Publish($message: String!){ publish(message: $message) { message } }"
},
"Arn": {
"Fn::GetAtt": [
"baseApiCDA4D43A",
"GraphQLEndpointArn"
]
},
"DeadLetterConfig": {
"Arn": {
"Fn::GetAtt": [
"Queue4A7E3555",
"Arn"
]
}
},
"Id": "Target0",
"Input": "{\"message\":\"hello world\"}",
"RoleArn": {
"Fn::GetAtt": [
"baseApiEventsRoleAC472BD7",
"Arn"
]
}
}
]
}
}
},
"Parameters": {
"BootstrapVersion": {
"Type": "AWS::SSM::Parameter::Value<String>",
"Default": "/cdk-bootstrap/hnb659fds/version",
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
}
},
"Rules": {
"CheckBootstrapVersion": {
"Assertions": [
{
"Assert": {
"Fn::Not": [
{
"Fn::Contains": [
[
"1",
"2",
"3",
"4",
"5"
],
{
"Ref": "BootstrapVersion"
}
]
}
]
},
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
}
]
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading