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
Modifier and TypeClassDescriptionstatic interface
Describes a runtime used by an AWS AppSync pipeline resolver or AWS AppSync function.static final class
A fluent builder forCfnResolver
.static interface
The caching configuration for a resolver that has caching activated.static interface
TheLambdaConflictHandlerConfig
when configuring LAMBDA as the Conflict Handler.static interface
Use thePipelineConfig
property type to specifyPipelineConfig
for an AWS AppSync resolver.static interface
Describes a Sync configuration for a resolver.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The CloudFormation resource type name for this resource class. -
Constructor Summary
ModifierConstructorDescriptionCfnResolver
(Construct scope, String id, CfnResolverProps props) Create a newAWS::AppSync::Resolver
.protected
CfnResolver
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
CfnResolver
(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()
Theresolver
code 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 aBatchInvoke
operation.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.TheSyncConfig
for a resolver attached to a versioned data source.The GraphQL type that invokes this resolver.void
inspect
(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties
(Map<String, Object> props) void
The AWS AppSync GraphQL API to which you want to attach this resolver.void
setCachingConfig
(IResolvable value) The caching configuration for the resolver.void
The caching configuration for the resolver.void
Theresolver
code that contains the request and response functions.void
setCodeS3Location
(String value) The Amazon S3 endpoint.void
setDataSourceName
(String value) The resolver data source name.void
setFieldName
(String value) The GraphQL field on a type that invokes the resolver.void
The resolver type.void
setMaxBatchSize
(Number value) The maximum number of resolver request inputs that will be sent to a single AWS Lambda function in aBatchInvoke
operation.void
setPipelineConfig
(IResolvable value) Functions linked with the pipeline resolver.void
Functions linked with the pipeline resolver.void
setRequestMappingTemplate
(String value) The request mapping template.void
The location of a request mapping template in an Amazon S3 bucket.void
setResponseMappingTemplate
(String value) The response mapping template.void
The location of a response mapping template in an Amazon S3 bucket.void
setRuntime
(IResolvable value) Describes a runtime used by an AWS AppSync pipeline resolver or AWS AppSync function.void
Describes a runtime used by an AWS AppSync pipeline resolver or AWS AppSync function.void
setSyncConfig
(IResolvable value) TheSyncConfig
for a resolver attached to a versioned data source.void
TheSyncConfig
for a resolver attached to a versioned data source.void
setTypeName
(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, validateProperties
Methods inherited from class software.amazon.awscdk.core.CfnRefElement
getRef
Methods inherited from class software.amazon.awscdk.core.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
Methods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods 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:
inspect
in 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:
renderProperties
in 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:
getCfnProperties
in 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
Theresolver
code that contains the request and response functions.When code is used, the
runtime
is required. The runtime value must beAPPSYNC_JS
. -
setCode
Theresolver
code that contains the request and response functions.When code is used, the
runtime
is 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
Function
objects 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
Function
objects 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 aBatchInvoke
operation. -
setMaxBatchSize
The maximum number of resolver request inputs that will be sent to a single AWS Lambda function in aBatchInvoke
operation. -
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
TheSyncConfig
for a resolver attached to a versioned data source. -
setSyncConfig
TheSyncConfig
for a resolver attached to a versioned data source. -
setSyncConfig
TheSyncConfig
for a resolver attached to a versioned data source.
-