Skip to content

Commit

Permalink
feat(appsync): add maxBatchSize property to the AppSyncFunction C…
Browse files Browse the repository at this point in the history
…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
mazyu36 authored Jun 13, 2024
1 parent f45f2ca commit f1dc142
Show file tree
Hide file tree
Showing 13 changed files with 1,156 additions and 3 deletions.

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.

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."
}
]
}
}
}

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

Loading

0 comments on commit f1dc142

Please sign in to comment.