-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(appsync): add
maxBatchSize
property to the AppSyncFunction
C…
…onstruct (#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*
- Loading branch information
Showing
13 changed files
with
1,156 additions
and
3 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
...h-size.js.snapshot/AppSyncFunctionMaxBatchSizeDefaultTestDeployAssert21899F3D.assets.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
36 changes: 36 additions & 0 deletions
36
...size.js.snapshot/AppSyncFunctionMaxBatchSizeDefaultTestDeployAssert21899F3D.template.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
70 changes: 70 additions & 0 deletions
70
...asset.df9f207d681056c35badb6bc0d60a945b44c887b227b759715fd6a6443486443/lambda-tutorial.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
32 changes: 32 additions & 0 deletions
32
...c-function-max-batch-size.js.snapshot/aws-cdk-appsync-function-max-batch-size.assets.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
229 changes: 229 additions & 0 deletions
229
...function-max-batch-size.js.snapshot/aws-cdk-appsync-function-max-batch-size.template.json
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,229 @@ | ||
{ | ||
"Resources": { | ||
"LambdaAPID6A5A92B": { | ||
"Type": "AWS::AppSync::GraphQLApi", | ||
"Properties": { | ||
"AuthenticationType": "API_KEY", | ||
"Name": "LambdaAPI" | ||
} | ||
}, | ||
"LambdaAPISchemaCC5CA3D2": { | ||
"Type": "AWS::AppSync::GraphQLSchema", | ||
"Properties": { | ||
"ApiId": { | ||
"Fn::GetAtt": [ | ||
"LambdaAPID6A5A92B", | ||
"ApiId" | ||
] | ||
}, | ||
"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}" | ||
} | ||
}, | ||
"LambdaAPIDefaultApiKey15F6897D": { | ||
"Type": "AWS::AppSync::ApiKey", | ||
"Properties": { | ||
"ApiId": { | ||
"Fn::GetAtt": [ | ||
"LambdaAPID6A5A92B", | ||
"ApiId" | ||
] | ||
} | ||
}, | ||
"DependsOn": [ | ||
"LambdaAPISchemaCC5CA3D2" | ||
] | ||
}, | ||
"LambdaAPILambdaDSServiceRole21CACDF8": { | ||
"Type": "AWS::IAM::Role", | ||
"Properties": { | ||
"AssumeRolePolicyDocument": { | ||
"Statement": [ | ||
{ | ||
"Action": "sts:AssumeRole", | ||
"Effect": "Allow", | ||
"Principal": { | ||
"Service": "appsync.amazonaws.com" | ||
} | ||
} | ||
], | ||
"Version": "2012-10-17" | ||
} | ||
} | ||
}, | ||
"LambdaAPILambdaDSServiceRoleDefaultPolicyFB1B9CE8": { | ||
"Type": "AWS::IAM::Policy", | ||
"Properties": { | ||
"PolicyDocument": { | ||
"Statement": [ | ||
{ | ||
"Action": "lambda:InvokeFunction", | ||
"Effect": "Allow", | ||
"Resource": [ | ||
{ | ||
"Fn::GetAtt": [ | ||
"funcC3A0C2E2", | ||
"Arn" | ||
] | ||
}, | ||
{ | ||
"Fn::Join": [ | ||
"", | ||
[ | ||
{ | ||
"Fn::GetAtt": [ | ||
"funcC3A0C2E2", | ||
"Arn" | ||
] | ||
}, | ||
":*" | ||
] | ||
] | ||
} | ||
] | ||
} | ||
], | ||
"Version": "2012-10-17" | ||
}, | ||
"PolicyName": "LambdaAPILambdaDSServiceRoleDefaultPolicyFB1B9CE8", | ||
"Roles": [ | ||
{ | ||
"Ref": "LambdaAPILambdaDSServiceRole21CACDF8" | ||
} | ||
] | ||
} | ||
}, | ||
"LambdaAPILambdaDSFD6DF39B": { | ||
"Type": "AWS::AppSync::DataSource", | ||
"Properties": { | ||
"ApiId": { | ||
"Fn::GetAtt": [ | ||
"LambdaAPID6A5A92B", | ||
"ApiId" | ||
] | ||
}, | ||
"LambdaConfig": { | ||
"LambdaFunctionArn": { | ||
"Fn::GetAtt": [ | ||
"funcC3A0C2E2", | ||
"Arn" | ||
] | ||
} | ||
}, | ||
"Name": "LambdaDS", | ||
"ServiceRoleArn": { | ||
"Fn::GetAtt": [ | ||
"LambdaAPILambdaDSServiceRole21CACDF8", | ||
"Arn" | ||
] | ||
}, | ||
"Type": "AWS_LAMBDA" | ||
} | ||
}, | ||
"LambdaAPITestFunction64FA697F": { | ||
"Type": "AWS::AppSync::FunctionConfiguration", | ||
"Properties": { | ||
"ApiId": { | ||
"Fn::GetAtt": [ | ||
"LambdaAPID6A5A92B", | ||
"ApiId" | ||
] | ||
}, | ||
"DataSourceName": "LambdaDS", | ||
"FunctionVersion": "2018-05-29", | ||
"MaxBatchSize": 10, | ||
"Name": "test" | ||
}, | ||
"DependsOn": [ | ||
"LambdaAPILambdaDSFD6DF39B", | ||
"LambdaAPISchemaCC5CA3D2" | ||
] | ||
}, | ||
"funcServiceRoleA96CCB44": { | ||
"Type": "AWS::IAM::Role", | ||
"Properties": { | ||
"AssumeRolePolicyDocument": { | ||
"Statement": [ | ||
{ | ||
"Action": "sts:AssumeRole", | ||
"Effect": "Allow", | ||
"Principal": { | ||
"Service": "lambda.amazonaws.com" | ||
} | ||
} | ||
], | ||
"Version": "2012-10-17" | ||
}, | ||
"ManagedPolicyArns": [ | ||
{ | ||
"Fn::Join": [ | ||
"", | ||
[ | ||
"arn:", | ||
{ | ||
"Ref": "AWS::Partition" | ||
}, | ||
":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" | ||
] | ||
] | ||
} | ||
] | ||
} | ||
}, | ||
"funcC3A0C2E2": { | ||
"Type": "AWS::Lambda::Function", | ||
"Properties": { | ||
"Code": { | ||
"S3Bucket": { | ||
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" | ||
}, | ||
"S3Key": "df9f207d681056c35badb6bc0d60a945b44c887b227b759715fd6a6443486443.zip" | ||
}, | ||
"Handler": "lambda-tutorial.handler", | ||
"Role": { | ||
"Fn::GetAtt": [ | ||
"funcServiceRoleA96CCB44", | ||
"Arn" | ||
] | ||
}, | ||
"Runtime": "nodejs18.x" | ||
}, | ||
"DependsOn": [ | ||
"funcServiceRoleA96CCB44" | ||
] | ||
} | ||
}, | ||
"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." | ||
} | ||
] | ||
} | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...ork-integ/test/aws-appsync/test/integ.appsync-function-max-batch-size.js.snapshot/cdk.out
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.