MappingTemplate

class aws_cdk.aws_appsync.MappingTemplate

Bases: object

MappingTemplates for AppSync resolvers.

stability :stability: experimental

__init__()

Initialize self. See help(type(self)) for accurate signature.

Return type

None

Methods

render_template()

this is called to render the mapping template to a VTL string.

stability :stability: experimental

Return type

str

Static Methods

classmethod dynamo_db_delete_item(key_name, id_arg)

Mapping template to delete a single item from a DynamoDB table.

Parameters
  • key_name (str) – the name of the hash key field.

  • id_arg (str) – the name of the Mutation argument.

stability :stability: experimental

Return type

MappingTemplate

classmethod dynamo_db_get_item(key_name, id_arg)

Mapping template to get a single item from a DynamoDB table.

Parameters
  • key_name (str) – the name of the hash key field.

  • id_arg (str) – the name of the Query argument.

stability :stability: experimental

Return type

MappingTemplate

classmethod dynamo_db_put_item(key, values)

Mapping template to save a single item to a DynamoDB table.

Parameters
  • key (PrimaryKey) – the assigment of Mutation values to the primary key.

  • values (AttributeValues) – the assignment of Mutation values to the table attributes.

stability :stability: experimental

Return type

MappingTemplate

classmethod dynamo_db_query(cond)

Mapping template to query a set of items from a DynamoDB table.

Parameters

cond (KeyCondition) – the key condition for the query.

stability :stability: experimental

Return type

MappingTemplate

classmethod dynamo_db_result_item()

Mapping template for a single result item from DynamoDB.

stability :stability: experimental

Return type

MappingTemplate

classmethod dynamo_db_result_list()

Mapping template for a result list from DynamoDB.

stability :stability: experimental

Return type

MappingTemplate

classmethod dynamo_db_scan_table()

Mapping template to scan a DynamoDB table to fetch all entries.

stability :stability: experimental

Return type

MappingTemplate

classmethod from_file(file_name)

Create a mapping template from the given file.

Parameters

file_name (str) –

stability :stability: experimental

Return type

MappingTemplate

classmethod from_string(template)

Create a mapping template from the given string.

Parameters

template (str) –

stability :stability: experimental

Return type

MappingTemplate

classmethod lambda_request(payload)

Mapping template to invoke a Lambda function.

Parameters

payload (str) – the VTL template snippet of the payload to send to the lambda.

stability :stability: experimental

Return type

MappingTemplate

classmethod lambda_result()

Mapping template to return the Lambda result to the caller.

stability :stability: experimental

Return type

MappingTemplate