Skip to content

Commit f1dc142

Browse files
authored
feat(appsync): add maxBatchSize property to the AppSyncFunction Construct (#30266)
### Issue # (if applicable) N/A ### Reason for this change Missing property in the Construct. https://docs.aws.amazon.com/ja_jp/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-functionconfiguration.html#cfn-appsync-functionconfiguration-maxbatchsize ### Description of changes Add `maxBatchSize` property to the `AppSyncFunction` Construct ### Description of how you validated changes Add unit tests and integ tests. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent f45f2ca commit f1dc142

File tree

13 files changed

+1156
-3
lines changed

13 files changed

+1156
-3
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-appsync/test/integ.appsync-function-max-batch-size.js.snapshot/AppSyncFunctionMaxBatchSizeDefaultTestDeployAssert21899F3D.assets.json

+19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-appsync/test/integ.appsync-function-max-batch-size.js.snapshot/AppSyncFunctionMaxBatchSizeDefaultTestDeployAssert21899F3D.template.json

+36
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-appsync/test/integ.appsync-function-max-batch-size.js.snapshot/asset.df9f207d681056c35badb6bc0d60a945b44c887b227b759715fd6a6443486443/lambda-tutorial.js

+70
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-appsync/test/integ.appsync-function-max-batch-size.js.snapshot/aws-cdk-appsync-function-max-batch-size.assets.json

+32
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,229 @@
1+
{
2+
"Resources": {
3+
"LambdaAPID6A5A92B": {
4+
"Type": "AWS::AppSync::GraphQLApi",
5+
"Properties": {
6+
"AuthenticationType": "API_KEY",
7+
"Name": "LambdaAPI"
8+
}
9+
},
10+
"LambdaAPISchemaCC5CA3D2": {
11+
"Type": "AWS::AppSync::GraphQLSchema",
12+
"Properties": {
13+
"ApiId": {
14+
"Fn::GetAtt": [
15+
"LambdaAPID6A5A92B",
16+
"ApiId"
17+
]
18+
},
19+
"Definition": "schema {\n query: Query\n mutation: Mutation\n}\n\ntype Query {\n getPost(id:ID!): Post\n allPosts: [Post]\n}\n\ntype Mutation {\n addPost(id: ID!, author: String!, title: String, content: String, url: String): Post!\n}\n\ntype Post {\n id: ID!\n author: String!\n title: String\n content: String\n url: String\n ups: Int\n downs: Int\n relatedPosts: [Post]\n relatedPostsMaxBatchSize: [Post]\n}"
20+
}
21+
},
22+
"LambdaAPIDefaultApiKey15F6897D": {
23+
"Type": "AWS::AppSync::ApiKey",
24+
"Properties": {
25+
"ApiId": {
26+
"Fn::GetAtt": [
27+
"LambdaAPID6A5A92B",
28+
"ApiId"
29+
]
30+
}
31+
},
32+
"DependsOn": [
33+
"LambdaAPISchemaCC5CA3D2"
34+
]
35+
},
36+
"LambdaAPILambdaDSServiceRole21CACDF8": {
37+
"Type": "AWS::IAM::Role",
38+
"Properties": {
39+
"AssumeRolePolicyDocument": {
40+
"Statement": [
41+
{
42+
"Action": "sts:AssumeRole",
43+
"Effect": "Allow",
44+
"Principal": {
45+
"Service": "appsync.amazonaws.com"
46+
}
47+
}
48+
],
49+
"Version": "2012-10-17"
50+
}
51+
}
52+
},
53+
"LambdaAPILambdaDSServiceRoleDefaultPolicyFB1B9CE8": {
54+
"Type": "AWS::IAM::Policy",
55+
"Properties": {
56+
"PolicyDocument": {
57+
"Statement": [
58+
{
59+
"Action": "lambda:InvokeFunction",
60+
"Effect": "Allow",
61+
"Resource": [
62+
{
63+
"Fn::GetAtt": [
64+
"funcC3A0C2E2",
65+
"Arn"
66+
]
67+
},
68+
{
69+
"Fn::Join": [
70+
"",
71+
[
72+
{
73+
"Fn::GetAtt": [
74+
"funcC3A0C2E2",
75+
"Arn"
76+
]
77+
},
78+
":*"
79+
]
80+
]
81+
}
82+
]
83+
}
84+
],
85+
"Version": "2012-10-17"
86+
},
87+
"PolicyName": "LambdaAPILambdaDSServiceRoleDefaultPolicyFB1B9CE8",
88+
"Roles": [
89+
{
90+
"Ref": "LambdaAPILambdaDSServiceRole21CACDF8"
91+
}
92+
]
93+
}
94+
},
95+
"LambdaAPILambdaDSFD6DF39B": {
96+
"Type": "AWS::AppSync::DataSource",
97+
"Properties": {
98+
"ApiId": {
99+
"Fn::GetAtt": [
100+
"LambdaAPID6A5A92B",
101+
"ApiId"
102+
]
103+
},
104+
"LambdaConfig": {
105+
"LambdaFunctionArn": {
106+
"Fn::GetAtt": [
107+
"funcC3A0C2E2",
108+
"Arn"
109+
]
110+
}
111+
},
112+
"Name": "LambdaDS",
113+
"ServiceRoleArn": {
114+
"Fn::GetAtt": [
115+
"LambdaAPILambdaDSServiceRole21CACDF8",
116+
"Arn"
117+
]
118+
},
119+
"Type": "AWS_LAMBDA"
120+
}
121+
},
122+
"LambdaAPITestFunction64FA697F": {
123+
"Type": "AWS::AppSync::FunctionConfiguration",
124+
"Properties": {
125+
"ApiId": {
126+
"Fn::GetAtt": [
127+
"LambdaAPID6A5A92B",
128+
"ApiId"
129+
]
130+
},
131+
"DataSourceName": "LambdaDS",
132+
"FunctionVersion": "2018-05-29",
133+
"MaxBatchSize": 10,
134+
"Name": "test"
135+
},
136+
"DependsOn": [
137+
"LambdaAPILambdaDSFD6DF39B",
138+
"LambdaAPISchemaCC5CA3D2"
139+
]
140+
},
141+
"funcServiceRoleA96CCB44": {
142+
"Type": "AWS::IAM::Role",
143+
"Properties": {
144+
"AssumeRolePolicyDocument": {
145+
"Statement": [
146+
{
147+
"Action": "sts:AssumeRole",
148+
"Effect": "Allow",
149+
"Principal": {
150+
"Service": "lambda.amazonaws.com"
151+
}
152+
}
153+
],
154+
"Version": "2012-10-17"
155+
},
156+
"ManagedPolicyArns": [
157+
{
158+
"Fn::Join": [
159+
"",
160+
[
161+
"arn:",
162+
{
163+
"Ref": "AWS::Partition"
164+
},
165+
":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
166+
]
167+
]
168+
}
169+
]
170+
}
171+
},
172+
"funcC3A0C2E2": {
173+
"Type": "AWS::Lambda::Function",
174+
"Properties": {
175+
"Code": {
176+
"S3Bucket": {
177+
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
178+
},
179+
"S3Key": "df9f207d681056c35badb6bc0d60a945b44c887b227b759715fd6a6443486443.zip"
180+
},
181+
"Handler": "lambda-tutorial.handler",
182+
"Role": {
183+
"Fn::GetAtt": [
184+
"funcServiceRoleA96CCB44",
185+
"Arn"
186+
]
187+
},
188+
"Runtime": "nodejs18.x"
189+
},
190+
"DependsOn": [
191+
"funcServiceRoleA96CCB44"
192+
]
193+
}
194+
},
195+
"Parameters": {
196+
"BootstrapVersion": {
197+
"Type": "AWS::SSM::Parameter::Value<String>",
198+
"Default": "/cdk-bootstrap/hnb659fds/version",
199+
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
200+
}
201+
},
202+
"Rules": {
203+
"CheckBootstrapVersion": {
204+
"Assertions": [
205+
{
206+
"Assert": {
207+
"Fn::Not": [
208+
{
209+
"Fn::Contains": [
210+
[
211+
"1",
212+
"2",
213+
"3",
214+
"4",
215+
"5"
216+
],
217+
{
218+
"Ref": "BootstrapVersion"
219+
}
220+
]
221+
}
222+
]
223+
},
224+
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
225+
}
226+
]
227+
}
228+
}
229+
}

packages/@aws-cdk-testing/framework-integ/test/aws-appsync/test/integ.appsync-function-max-batch-size.js.snapshot/cdk.out

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)