Class CfnResolver
- All Implemented Interfaces:
IConstruct,IDependable,IInspectable,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct
AWS::AppSync::Resolver.
The AWS::AppSync::Resolver resource defines the logical GraphQL resolver that you attach to fields in a schema. Request and response templates for resolvers are written in Apache Velocity Template Language (VTL) format. For more information about resolvers, see Resolver Mapping Template Reference .
When you submit an update, AWS CloudFormation updates resources based on differences between what you submit and the stack's current template. To cause this resource to be updated you must change a property value for this resource in the CloudFormation template. Changing the Amazon S3 file content without changing a property value will not result in an update operation.
See Update Behaviors of Stack Resources in the AWS CloudFormation User Guide .
Example:
// 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.*;
CfnResolver cfnResolver = CfnResolver.Builder.create(this, "MyCfnResolver")
.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)
.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();
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceDescribes a runtime used by an AWS AppSync pipeline resolver or AWS AppSync function.static final classA fluent builder forCfnResolver.static interfaceThe caching configuration for a resolver that has caching activated.static interfaceTheLambdaConflictHandlerConfigwhen configuring LAMBDA as the Conflict Handler.static interfaceUse thePipelineConfigproperty type to specifyPipelineConfigfor an AWS AppSync resolver.static interfaceDescribes a Sync configuration for a resolver.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.core.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionCfnResolver(Construct scope, String id, CfnResolverProps props) Create a newAWS::AppSync::Resolver.protectedCfnResolver(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnResolver(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptiongetApiId()The AWS AppSync GraphQL API to which you want to attach this resolver.The GraphQL field on a type that invokes the resolver.ARN of the resolver, such asarn:aws:appsync:us-east-1:123456789012:apis/graphqlapiid/types/typename/resolvers/resolvername.The GraphQL type that invokes this resolver.The caching configuration for the resolver.getCode()Theresolvercode that contains the request and response functions.The Amazon S3 endpoint.The resolver data source name.The GraphQL field on a type that invokes the resolver.getKind()The resolver type.The maximum number of resolver request inputs that will be sent to a single AWS Lambda function in aBatchInvokeoperation.Functions linked with the pipeline resolver.The request mapping template.The location of a request mapping template in an Amazon S3 bucket.The response mapping template.The location of a response mapping template in an Amazon S3 bucket.Describes a runtime used by an AWS AppSync pipeline resolver or AWS AppSync function.TheSyncConfigfor a resolver attached to a versioned data source.The GraphQL type that invokes this resolver.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidThe AWS AppSync GraphQL API to which you want to attach this resolver.voidsetCachingConfig(IResolvable value) The caching configuration for the resolver.voidThe caching configuration for the resolver.voidTheresolvercode that contains the request and response functions.voidsetCodeS3Location(String value) The Amazon S3 endpoint.voidsetDataSourceName(String value) The resolver data source name.voidsetFieldName(String value) The GraphQL field on a type that invokes the resolver.voidThe resolver type.voidsetMaxBatchSize(Number value) The maximum number of resolver request inputs that will be sent to a single AWS Lambda function in aBatchInvokeoperation.voidsetPipelineConfig(IResolvable value) Functions linked with the pipeline resolver.voidFunctions linked with the pipeline resolver.voidsetRequestMappingTemplate(String value) The request mapping template.voidThe location of a request mapping template in an Amazon S3 bucket.voidsetResponseMappingTemplate(String value) The response mapping template.voidThe location of a response mapping template in an Amazon S3 bucket.voidsetRuntime(IResolvable value) Describes a runtime used by an AWS AppSync pipeline resolver or AWS AppSync function.voidDescribes a runtime used by an AWS AppSync pipeline resolver or AWS AppSync function.voidsetSyncConfig(IResolvable value) TheSyncConfigfor a resolver attached to a versioned data source.voidTheSyncConfigfor a resolver attached to a versioned data source.voidsetTypeName(String value) The GraphQL type that invokes this resolver.Methods inherited from class software.amazon.awscdk.core.CfnResource
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.core.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.core.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validateMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnResolver
protected CfnResolver(software.amazon.jsii.JsiiObjectRef objRef) -
CfnResolver
protected CfnResolver(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnResolver
@Stability(Stable) public CfnResolver(@NotNull Construct scope, @NotNull String id, @NotNull CfnResolverProps props) Create a newAWS::AppSync::Resolver.- Parameters:
scope-- scope in which this resource is defined.
id-- scoped id of the resource.
props-- resource properties.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector-- tree inspector to collect and process attributes.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrFieldName
The GraphQL field on a type that invokes the resolver. -
getAttrResolverArn
ARN of the resolver, such asarn:aws:appsync:us-east-1:123456789012:apis/graphqlapiid/types/typename/resolvers/resolvername. -
getAttrTypeName
The GraphQL type that invokes this resolver. -
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getApiId
The AWS AppSync GraphQL API to which you want to attach this resolver. -
setApiId
The AWS AppSync GraphQL API to which you want to attach this resolver. -
getFieldName
The GraphQL field on a type that invokes the resolver. -
setFieldName
The GraphQL field on a type that invokes the resolver. -
getTypeName
The GraphQL type that invokes this resolver. -
setTypeName
The GraphQL type that invokes this resolver. -
getCachingConfig
The caching configuration for the resolver. -
setCachingConfig
The caching configuration for the resolver. -
setCachingConfig
The caching configuration for the resolver. -
getCode
Theresolvercode that contains the request and response functions.When code is used, the
runtimeis required. The runtime value must beAPPSYNC_JS. -
setCode
Theresolvercode that contains the request and response functions.When code is used, the
runtimeis required. The runtime value must beAPPSYNC_JS. -
getCodeS3Location
The Amazon S3 endpoint. -
setCodeS3Location
The Amazon S3 endpoint. -
getDataSourceName
The resolver data source name. -
setDataSourceName
The resolver data source name. -
getKind
The resolver type.- 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
Functionobjects in a serial manner. You can use a pipeline resolver to run a GraphQL query against multiple data sources.
-
setKind
The resolver type.- 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
Functionobjects in a serial manner. You can use a pipeline resolver to run a GraphQL query against multiple data sources.
-
getMaxBatchSize
The maximum number of resolver request inputs that will be sent to a single AWS Lambda function in aBatchInvokeoperation. -
setMaxBatchSize
The maximum number of resolver request inputs that will be sent to a single AWS Lambda function in aBatchInvokeoperation. -
getPipelineConfig
Functions linked with the pipeline resolver. -
setPipelineConfig
Functions linked with the pipeline resolver. -
setPipelineConfig
@Stability(Stable) public void setPipelineConfig(@Nullable CfnResolver.PipelineConfigProperty value) Functions linked with the pipeline resolver. -
getRequestMappingTemplate
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.
-
setRequestMappingTemplate
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.
-
getRequestMappingTemplateS3Location
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.
-
setRequestMappingTemplateS3Location
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.
-
getResponseMappingTemplate
The response mapping template. -
setResponseMappingTemplate
The response mapping template. -
getResponseMappingTemplateS3Location
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.
-
setResponseMappingTemplateS3Location
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.
-
getRuntime
Describes 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.
-
setRuntime
Describes 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.
-
setRuntime
Describes 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.
-
getSyncConfig
TheSyncConfigfor a resolver attached to a versioned data source. -
setSyncConfig
TheSyncConfigfor a resolver attached to a versioned data source. -
setSyncConfig
TheSyncConfigfor a resolver attached to a versioned data source.
-