Skip to main content

function_configurations

Creates, updates, deletes or gets a function_configuration resource or lists function_configurations in a region

Overview

Namefunction_configurations
TypeResource
DescriptionAn example resource schema demonstrating some basic constructs and validation rules.
Idawscc.appsync.function_configurations

Fields

NameDatatypeDescription
function_idstringThe unique identifier for the function generated by the service
function_arnstringThe ARN for the function generated by the service
api_idstringThe AWS AppSync GraphQL API that you want to attach using this function.
codestringThe resolver code that contains the request and response functions. When code is used, the runtime is required. The runtime value must be APPSYNC_JS.
code_s3_locationstringThe Amazon S3 endpoint (where the code is located??).
data_source_namestringThe name of data source this function will attach.
descriptionstringThe function description.
function_versionstringThe version of the request mapping template. Currently, only the 2018-05-29 version of the template is supported.
max_batch_sizeintegerThe maximum number of resolver request inputs that will be sent to a single AWS Lambda function in a BatchInvoke operation.
namestringThe name of the function.
request_mapping_templatestringThe Function request mapping template. Functions support only the 2018-05-29 version of the request mapping template.
request_mapping_template_s3_locationstringDescribes a Sync configuration for a resolver. Contains information on which Conflict Detection, as well as Resolution strategy, should be performed when the resolver is invoked.
response_mapping_templatestringThe Function response mapping template.
response_mapping_template_s3_locationstringThe location of a response mapping template in an Amazon S3 bucket. Use this if you want to provision with a template file in Amazon S3 rather than embedding it in your CloudFormation template.
runtimeobjectDescribes a runtime used by an AWS AppSync pipeline resolver or AWS AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified.
sync_configobjectDescribes a Sync configuration for a resolver. Specifies which Conflict Detection strategy and Resolution strategy to use when the resolver is invoked.
regionstringAWS region.

For more information, see AWS::AppSync::FunctionConfiguration.

Methods

NameResourceAccessible byRequired Params
create_resourcefunction_configurationsINSERTApiId, DataSourceName, Name, region
delete_resourcefunction_configurationsDELETEIdentifier, region
update_resourcefunction_configurationsUPDATEIdentifier, PatchDocument, region
list_resourcesfunction_configurations_list_onlySELECTregion
get_resourcefunction_configurationsSELECTIdentifier, region

SELECT examples

Gets all properties from an individual function_configuration.

SELECT
region,
function_id,
function_arn,
api_id,
code,
code_s3_location,
data_source_name,
description,
function_version,
max_batch_size,
name,
request_mapping_template,
request_mapping_template_s3_location,
response_mapping_template,
response_mapping_template_s3_location,
runtime,
sync_config
FROM awscc.appsync.function_configurations
WHERE
region = 'us-east-1' AND
Identifier = '{{ function_arn }}';

INSERT example

Use the following StackQL query and manifest file to create a new function_configuration resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.appsync.function_configurations (
ApiId,
DataSourceName,
Name,
region
)
SELECT
'{{ api_id }}',
'{{ data_source_name }}',
'{{ name }}',
'{{ region }}';

UPDATE example

Use the following StackQL query and manifest file to update a function_configuration resource, using stack-deploy.

/*+ update */
UPDATE awscc.appsync.function_configurations
SET PatchDocument = string('{{ {
"Code": code,
"CodeS3Location": code_s3_location,
"DataSourceName": data_source_name,
"Description": description,
"FunctionVersion": function_version,
"MaxBatchSize": max_batch_size,
"Name": name,
"RequestMappingTemplate": request_mapping_template,
"RequestMappingTemplateS3Location": request_mapping_template_s3_location,
"ResponseMappingTemplate": response_mapping_template,
"ResponseMappingTemplateS3Location": response_mapping_template_s3_location,
"Runtime": runtime,
"SyncConfig": sync_config
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ function_arn }}';

DELETE example

/*+ delete */
DELETE FROM awscc.appsync.function_configurations
WHERE
Identifier = '{{ function_arn }}' AND
region = 'us-east-1';

Permissions

To operate on the function_configurations resource, the following permissions are required:

s3:GetObject,
appsync:CreateFunction