AppsyncFunctionProps

class aws_cdk.aws_appsync.AppsyncFunctionProps(*, name, code=None, description=None, max_batch_size=None, request_mapping_template=None, response_mapping_template=None, runtime=None, api, data_source)

Bases: BaseAppsyncFunctionProps

the CDK properties for AppSync Functions.

Parameters:
  • name (str) – the name of the AppSync Function.

  • code (Optional[Code]) – The function code. Default: - no code is used

  • description (Optional[str]) – the description for this AppSync Function. Default: - no description

  • max_batch_size (Union[int, float, None]) – 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. Default: - No max batch size

  • request_mapping_template (Optional[MappingTemplate]) – the request mapping template for the AppSync Function. Default: - no request mapping template

  • response_mapping_template (Optional[MappingTemplate]) – the response mapping template for the AppSync Function. Default: - no response mapping template

  • runtime (Optional[FunctionRuntime]) – The functions runtime. Default: - no function runtime, VTL mapping templates used

  • api (IGraphqlApi) – the GraphQL Api linked to this AppSync Function.

  • data_source (BaseDataSource) – the data source linked to this AppSync Function.

ExampleMetadata:

infused

Example:

# api: appsync.GraphqlApi


appsync_function = appsync.AppsyncFunction(self, "function",
    name="appsync_function",
    api=api,
    data_source=api.add_none_data_source("none"),
    request_mapping_template=appsync.MappingTemplate.from_file("request.vtl"),
    response_mapping_template=appsync.MappingTemplate.from_file("response.vtl")
)

Attributes

api

the GraphQL Api linked to this AppSync Function.

code

The function code.

Default:
  • no code is used

data_source

the data source linked to this AppSync Function.

description

the description for this AppSync Function.

Default:
  • no description

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.

Default:
  • No max batch size

name

the name of the AppSync Function.

request_mapping_template

the request mapping template for the AppSync Function.

Default:
  • no request mapping template

response_mapping_template

the response mapping template for the AppSync Function.

Default:
  • no response mapping template

runtime

The functions runtime.

Default:
  • no function runtime, VTL mapping templates used