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.
The function code.
Default: no code is used
dataSourceBaseDataSourcedata_sourceBaseDataSourcedataSourceBaseDataSourceDataSourceBaseDataSourceDataSourceBaseDataSourcerequired#the data source linked to this AppSync Function.
descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string#the description for this AppSync Function.
Default: no description
maxBatchSizeoptionalnumbermax_batch_sizeoptionalint | floatmaxBatchSizeoptionalNumberMaxBatchSizeoptionaldoubleMaxBatchSizeoptional*float64#The maximum number of resolver request inputs that will be sent to a single AWS Lambda function in a BatchInvoke operation.
Default: No max batch size
Can only be set when using LambdaDataSource.
the name of the AppSync Function.
requestMappingTemplateoptionalMappingTemplaterequest_mapping_templateoptionalMappingTemplaterequestMappingTemplateoptionalMappingTemplateRequestMappingTemplateoptionalMappingTemplateRequestMappingTemplateoptionalMappingTemplate#the request mapping template for the AppSync Function.
Default: no request mapping template
responseMappingTemplateoptionalMappingTemplateresponse_mapping_templateoptionalMappingTemplateresponseMappingTemplateoptionalMappingTemplateResponseMappingTemplateoptionalMappingTemplateResponseMappingTemplateoptionalMappingTemplate#the response mapping template for the AppSync Function.
Default: no response mapping template
runtimeoptionalFunctionRuntimeruntimeoptionalFunctionRuntimeruntimeoptionalFunctionRuntimeRuntimeoptionalFunctionRuntimeRuntimeoptionalFunctionRuntime#The functions runtime.
Default: no function runtime, VTL mapping templates used