Skip to content
v2.277.0

CfnFunctionConfigurationProps Struct ​

Properties for defining a CfnFunctionConfiguration.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_appsync as appsync } from 'aws-cdk-lib';
const cfnFunctionConfigurationProps: appsync.CfnFunctionConfigurationProps = {
  apiId: 'apiId',
  dataSourceName: 'dataSourceName',
  name: 'name',

  // the properties below are optional
  code: 'code',
  codeS3Location: 'codeS3Location',
  description: 'description',
  functionVersion: 'functionVersion',
  maxBatchSize: 123,
  requestMappingTemplate: 'requestMappingTemplate',
  requestMappingTemplateS3Location: 'requestMappingTemplateS3Location',
  responseMappingTemplate: 'responseMappingTemplate',
  responseMappingTemplateS3Location: 'responseMappingTemplateS3Location',
  runtime: {
    name: 'name',
    runtimeVersion: 'runtimeVersion',
  },
  syncConfig: {
    conflictDetection: 'conflictDetection',

    // the properties below are optional
    conflictHandler: 'conflictHandler',
    lambdaConflictHandlerConfig: {
      lambdaConflictHandlerArn: 'lambdaConflictHandlerArn',
    },
  },
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_appsync as appsync

cfn_function_configuration_props = appsync.CfnFunctionConfigurationProps(
    api_id="apiId",
    data_source_name="dataSourceName",
    name="name",

    # the properties below are optional
    code="code",
    code_s3_location="codeS3Location",
    description="description",
    function_version="functionVersion",
    max_batch_size=123,
    request_mapping_template="requestMappingTemplate",
    request_mapping_template_s3_location="requestMappingTemplateS3Location",
    response_mapping_template="responseMappingTemplate",
    response_mapping_template_s3_location="responseMappingTemplateS3Location",
    runtime=appsync.CfnFunctionConfiguration.AppSyncRuntimeProperty(
        name="name",
        runtime_version="runtimeVersion"
    ),
    sync_config=appsync.CfnFunctionConfiguration.SyncConfigProperty(
        conflict_detection="conflictDetection",

        # the properties below are optional
        conflict_handler="conflictHandler",
        lambda_conflict_handler_config=appsync.CfnFunctionConfiguration.LambdaConflictHandlerConfigProperty(
            lambda_conflict_handler_arn="lambdaConflictHandlerArn"
        )
    )
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.appsync.*;

CfnFunctionConfigurationProps cfnFunctionConfigurationProps = CfnFunctionConfigurationProps.builder()
        .apiId("apiId")
        .dataSourceName("dataSourceName")
        .name("name")

        // the properties below are optional
        .code("code")
        .codeS3Location("codeS3Location")
        .description("description")
        .functionVersion("functionVersion")
        .maxBatchSize(123)
        .requestMappingTemplate("requestMappingTemplate")
        .requestMappingTemplateS3Location("requestMappingTemplateS3Location")
        .responseMappingTemplate("responseMappingTemplate")
        .responseMappingTemplateS3Location("responseMappingTemplateS3Location")
        .runtime(AppSyncRuntimeProperty.builder()
                .name("name")
                .runtimeVersion("runtimeVersion")
                .build())
        .syncConfig(SyncConfigProperty.builder()
                .conflictDetection("conflictDetection")

                // the properties below are optional
                .conflictHandler("conflictHandler")
                .lambdaConflictHandlerConfig(LambdaConflictHandlerConfigProperty.builder()
                        .lambdaConflictHandlerArn("lambdaConflictHandlerArn")
                        .build())
                .build())
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.AppSync;

var cfnFunctionConfigurationProps = new CfnFunctionConfigurationProps {
    ApiId = "apiId",
    DataSourceName = "dataSourceName",
    Name = "name",

    // the properties below are optional
    Code = "code",
    CodeS3Location = "codeS3Location",
    Description = "description",
    FunctionVersion = "functionVersion",
    MaxBatchSize = 123,
    RequestMappingTemplate = "requestMappingTemplate",
    RequestMappingTemplateS3Location = "requestMappingTemplateS3Location",
    ResponseMappingTemplate = "responseMappingTemplate",
    ResponseMappingTemplateS3Location = "responseMappingTemplateS3Location",
    Runtime = new AppSyncRuntimeProperty {
        Name = "name",
        RuntimeVersion = "runtimeVersion"
    },
    SyncConfig = new SyncConfigProperty {
        ConflictDetection = "conflictDetection",

        // the properties below are optional
        ConflictHandler = "conflictHandler",
        LambdaConflictHandlerConfig = new LambdaConflictHandlerConfigProperty {
            LambdaConflictHandlerArn = "lambdaConflictHandlerArn"
        }
    }
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnFunctionConfigurationProps := &CfnFunctionConfigurationProps{
	ApiId: jsii.String("apiId"),
	DataSourceName: jsii.String("dataSourceName"),
	Name: jsii.String("name"),

	// the properties below are optional
	Code: jsii.String("code"),
	CodeS3Location: jsii.String("codeS3Location"),
	Description: jsii.String("description"),
	FunctionVersion: jsii.String("functionVersion"),
	MaxBatchSize: jsii.Number(123),
	RequestMappingTemplate: jsii.String("requestMappingTemplate"),
	RequestMappingTemplateS3Location: jsii.String("requestMappingTemplateS3Location"),
	ResponseMappingTemplate: jsii.String("responseMappingTemplate"),
	ResponseMappingTemplateS3Location: jsii.String("responseMappingTemplateS3Location"),
	Runtime: &AppSyncRuntimeProperty{
		Name: jsii.String("name"),
		RuntimeVersion: jsii.String("runtimeVersion"),
	},
	SyncConfig: &SyncConfigProperty{
		ConflictDetection: jsii.String("conflictDetection"),

		// the properties below are optional
		ConflictHandler: jsii.String("conflictHandler"),
		LambdaConflictHandlerConfig: &LambdaConflictHandlerConfigProperty{
			LambdaConflictHandlerArn: jsii.String("lambdaConflictHandlerArn"),
		},
	},
}

Properties ​

apiIdstringapi_idstrapiIdStringApiIdstringApiId*string required #
The AWS AppSync GraphQL API that you want to attach using this function.
codeoptionalstringcodeoptionalstrcodeoptionalStringCodeoptionalstringCodeoptional*string #
The `resolver` code that contains the request and response functions.

When code is used, the runtime is required. The runtime value must be APPSYNC_JS .

codeS3Locationoptionalstringcode_s3_locationoptionalstrcodeS3LocationoptionalStringCodeS3LocationoptionalstringCodeS3Locationoptional*string #
The Amazon S3 endpoint.
dataSourceNamestringdata_source_namestrdataSourceNameStringDataSourceNamestringDataSourceName*string required #
The name of data source this function will attach.
descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string #
The `Function` description.
functionVersionoptionalstringfunction_versionoptionalstrfunctionVersionoptionalStringFunctionVersionoptionalstringFunctionVersionoptional*string #
The version of the request mapping template.

Currently, only the 2018-05-29 version of the template is supported.

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.
namestringnamestrnameStringNamestringName*string required #
The name of the function.
requestMappingTemplateoptionalstringrequest_mapping_templateoptionalstrrequestMappingTemplateoptionalStringRequestMappingTemplateoptionalstringRequestMappingTemplateoptional*string #
The `Function` request mapping template.

Functions support only the 2018-05-29 version of the request mapping template.

requestMappingTemplateS3Locationoptionalstringrequest_mapping_template_s3_locationoptionalstrrequestMappingTemplateS3LocationoptionalStringRequestMappingTemplateS3LocationoptionalstringRequestMappingTemplateS3Locationoptional*string #
Describes 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.

responseMappingTemplateoptionalstringresponse_mapping_templateoptionalstrresponseMappingTemplateoptionalStringResponseMappingTemplateoptionalstringResponseMappingTemplateoptional*string #
The `Function` response mapping template.
responseMappingTemplateS3Locationoptionalstringresponse_mapping_template_s3_locationoptionalstrresponseMappingTemplateS3LocationoptionalStringResponseMappingTemplateS3LocationoptionalstringResponseMappingTemplateS3Locationoptional*string #
The 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.

runtimeoptionalIResolvable | CfnFunctionConfiguration.AppSyncRuntimePropertyruntimeoptionaltyping.Union[IResolvable, AppSyncRuntimeProperty]runtimeoptionalIResolvableRuntimeoptionalIResolvableRuntimeoptionalinterface{} #
Describes a runtime used by an AWS AppSync 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.

syncConfigoptionalIResolvable | CfnFunctionConfiguration.SyncConfigPropertysync_configoptionaltyping.Union[IResolvable, SyncConfigProperty]syncConfigoptionalIResolvableSyncConfigoptionalIResolvableSyncConfigoptionalinterface{} #
Describes a Sync configuration for a resolver.

Specifies which Conflict Detection strategy and Resolution strategy to use when the resolver is invoked.