Skip to content
v2.278.0

CfnResolverProps Struct ​

Properties for defining a CfnResolver.

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 cfnResolverProps: appsync.CfnResolverProps = {
  apiId: 'apiId',
  fieldName: 'fieldName',
  typeName: 'typeName',

  // the properties below are optional
  cachingConfig: {
    ttl: 123,

    // the properties below are optional
    cachingKeys: ['cachingKeys'],
  },
  code: 'code',
  codeS3Location: 'codeS3Location',
  dataSourceName: 'dataSourceName',
  kind: 'kind',
  maxBatchSize: 123,
  metricsConfig: 'metricsConfig',
  pipelineConfig: {
    functions: ['functions'],
  },
  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_resolver_props = appsync.CfnResolverProps(
    api_id="apiId",
    field_name="fieldName",
    type_name="typeName",

    # the properties below are optional
    caching_config=appsync.CfnResolver.CachingConfigProperty(
        ttl=123,

        # the properties below are optional
        caching_keys=["cachingKeys"]
    ),
    code="code",
    code_s3_location="codeS3Location",
    data_source_name="dataSourceName",
    kind="kind",
    max_batch_size=123,
    metrics_config="metricsConfig",
    pipeline_config=appsync.CfnResolver.PipelineConfigProperty(
        functions=["functions"]
    ),
    request_mapping_template="requestMappingTemplate",
    request_mapping_template_s3_location="requestMappingTemplateS3Location",
    response_mapping_template="responseMappingTemplate",
    response_mapping_template_s3_location="responseMappingTemplateS3Location",
    runtime=appsync.CfnResolver.AppSyncRuntimeProperty(
        name="name",
        runtime_version="runtimeVersion"
    ),
    sync_config=appsync.CfnResolver.SyncConfigProperty(
        conflict_detection="conflictDetection",

        # the properties below are optional
        conflict_handler="conflictHandler",
        lambda_conflict_handler_config=appsync.CfnResolver.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.*;

CfnResolverProps cfnResolverProps = CfnResolverProps.builder()
        .apiId("apiId")
        .fieldName("fieldName")
        .typeName("typeName")

        // the properties below are optional
        .cachingConfig(CachingConfigProperty.builder()
                .ttl(123)

                // the properties below are optional
                .cachingKeys(List.of("cachingKeys"))
                .build())
        .code("code")
        .codeS3Location("codeS3Location")
        .dataSourceName("dataSourceName")
        .kind("kind")
        .maxBatchSize(123)
        .metricsConfig("metricsConfig")
        .pipelineConfig(PipelineConfigProperty.builder()
                .functions(List.of("functions"))
                .build())
        .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 cfnResolverProps = new CfnResolverProps {
    ApiId = "apiId",
    FieldName = "fieldName",
    TypeName = "typeName",

    // the properties below are optional
    CachingConfig = new CachingConfigProperty {
        Ttl = 123,

        // the properties below are optional
        CachingKeys = new [] { "cachingKeys" }
    },
    Code = "code",
    CodeS3Location = "codeS3Location",
    DataSourceName = "dataSourceName",
    Kind = "kind",
    MaxBatchSize = 123,
    MetricsConfig = "metricsConfig",
    PipelineConfig = new PipelineConfigProperty {
        Functions = new [] { "functions" }
    },
    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"

cfnResolverProps := &CfnResolverProps{
	ApiId: jsii.String("apiId"),
	FieldName: jsii.String("fieldName"),
	TypeName: jsii.String("typeName"),

	// the properties below are optional
	CachingConfig: &CachingConfigProperty{
		Ttl: jsii.Number(123),

		// the properties below are optional
		CachingKeys: []*string{
			jsii.String("cachingKeys"),
		},
	},
	Code: jsii.String("code"),
	CodeS3Location: jsii.String("codeS3Location"),
	DataSourceName: jsii.String("dataSourceName"),
	Kind: jsii.String("kind"),
	MaxBatchSize: jsii.Number(123),
	MetricsConfig: jsii.String("metricsConfig"),
	PipelineConfig: &PipelineConfigProperty{
		Functions: []*string{
			jsii.String("functions"),
		},
	},
	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 to which you want to attach this resolver.
cachingConfigoptionalIResolvable | CfnResolver.CachingConfigPropertycaching_configoptionaltyping.Union[IResolvable, CachingConfigProperty]cachingConfigoptionalIResolvableCachingConfigoptionalIResolvableCachingConfigoptionalinterface{} #
The caching configuration for the resolver.
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.
dataSourceNameoptionalstringdata_source_nameoptionalstrdataSourceNameoptionalStringDataSourceNameoptionalstringDataSourceNameoptional*string #
The resolver data source name.
fieldNamestringfield_namestrfieldNameStringFieldNamestringFieldName*string required #
The GraphQL field on a type that invokes the resolver.
kindoptionalstringkindoptionalstrkindoptionalStringKindoptionalstringKindoptional*string #
The resolver type.
notes
  • UNIT : A UNIT resolver type. A UNIT resolver is the default resolver type. You can use a UNIT resolver to run a GraphQL query against a single data source.
  • PIPELINE : A PIPELINE resolver type. You can use a PIPELINE resolver to invoke a series of Function objects in a serial manner. You can use a pipeline resolver to run a GraphQL query against multiple data sources.
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.
metricsConfigoptionalstringmetrics_configoptionalstrmetricsConfigoptionalStringMetricsConfigoptionalstringMetricsConfigoptional*string #
Enables or disables enhanced resolver metrics for specified resolvers.
notes

Note that MetricsConfig won't be used unless the resolverLevelMetricsBehavior value is set to PER_RESOLVER_METRICS . If the resolverLevelMetricsBehavior is set to FULL_REQUEST_RESOLVER_METRICS instead, MetricsConfig will be ignored. However, you can still set its value.

pipelineConfigoptionalIResolvable | CfnResolver.PipelineConfigPropertypipeline_configoptionaltyping.Union[IResolvable, PipelineConfigProperty]pipelineConfigoptionalIResolvablePipelineConfigoptionalIResolvablePipelineConfigoptionalinterface{} #
Functions linked with the pipeline resolver.
requestMappingTemplateoptionalstringrequest_mapping_templateoptionalstrrequestMappingTemplateoptionalStringRequestMappingTemplateoptionalstringRequestMappingTemplateoptional*string #
The request mapping template.

Request mapping templates are optional when using a Lambda data source. For all other data sources, a request mapping template is required.

requestMappingTemplateS3Locationoptionalstringrequest_mapping_template_s3_locationoptionalstrrequestMappingTemplateS3LocationoptionalStringRequestMappingTemplateS3LocationoptionalstringRequestMappingTemplateS3Locationoptional*string #
The location of a request 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.

responseMappingTemplateoptionalstringresponse_mapping_templateoptionalstrresponseMappingTemplateoptionalStringResponseMappingTemplateoptionalstringResponseMappingTemplateoptional*string #
The 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 | CfnResolver.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 | CfnResolver.SyncConfigPropertysync_configoptionaltyping.Union[IResolvable, SyncConfigProperty]syncConfigoptionalIResolvableSyncConfigoptionalIResolvableSyncConfigoptionalinterface{} #
The `SyncConfig` for a resolver attached to a versioned data source.
typeNamestringtype_namestrtypeNameStringTypeNamestringTypeName*string required #
The GraphQL type that invokes this resolver.