Skip to content
v2.274.0

AppsyncFunctionProps Struct ​

the CDK properties for AppSync Functions.

Example ​

ts
declare const api: appsync.GraphqlApi;

const appsyncFunction = new appsync.AppsyncFunction(this, 'function', {
  name: 'appsync_function',
  api,
  dataSource: api.addNoneDataSource('none'),
  requestMappingTemplate: appsync.MappingTemplate.fromFile('request.vtl'),
  responseMappingTemplate: appsync.MappingTemplate.fromFile('response.vtl'),
});

Properties ​

the GraphQL Api linked to this AppSync Function.
codeCodecodeCodecodeCodeCodeCodeCodeCode= no code is used#
The function code.
dataSourceBaseDataSourcedata_sourceBaseDataSourcedataSourceBaseDataSourceDataSourceBaseDataSourceDataSourceBaseDataSourcerequired#
the data source linked to this AppSync Function.
descriptionstringdescriptionstrdescriptionStringDescriptionstringDescription*string= no description#
the description for this AppSync Function.
maxBatchSizenumbermax_batch_sizeint | floatmaxBatchSizeNumberMaxBatchSizedoubleMaxBatchSize*float64= No max batch size#
The maximum number of resolver request inputs that will be sent to a single AWS Lambda function in a BatchInvoke operation.

Can only be set when using LambdaDataSource.

namestringnamestrnameStringNamestringName*stringrequired#
the name of the AppSync Function.
requestMappingTemplateMappingTemplaterequest_mapping_templateMappingTemplaterequestMappingTemplateMappingTemplateRequestMappingTemplateMappingTemplateRequestMappingTemplateMappingTemplate= no request mapping template#
the request mapping template for the AppSync Function.
responseMappingTemplateMappingTemplateresponse_mapping_templateMappingTemplateresponseMappingTemplateMappingTemplateResponseMappingTemplateMappingTemplateResponseMappingTemplateMappingTemplate= no response mapping template#
the response mapping template for the AppSync Function.
runtimeFunctionRuntimeruntimeFunctionRuntimeruntimeFunctionRuntimeRuntimeFunctionRuntimeRuntimeFunctionRuntime= no function runtime, VTL mapping…#
The functions runtime.
default

Default: no function runtime, VTL mapping templates used