Class CfnResolver

java.lang.Object
software.amazon.jsii.JsiiObject
All Implemented Interfaces:
IConstruct, IDependable, IInspectable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:49.452Z") @Stability(Stable) public class CfnResolver extends CfnResource implements IInspectable
A CloudFormation 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();
 
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String 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 new AWS::AppSync::Resolver.

      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      This parameter is required.
      props -
      • resource properties.
      This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector -
      • tree inspector to collect and process attributes.
      This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrFieldName

      @Stability(Stable) @NotNull public String getAttrFieldName()
      The GraphQL field on a type that invokes the resolver.
    • getAttrResolverArn

      @Stability(Stable) @NotNull public String getAttrResolverArn()
      ARN of the resolver, such as arn:aws:appsync:us-east-1:123456789012:apis/graphqlapiid/types/typename/resolvers/resolvername .
    • getAttrTypeName

      @Stability(Stable) @NotNull public String getAttrTypeName()
      The GraphQL type that invokes this resolver.
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getApiId

      @Stability(Stable) @NotNull public String getApiId()
      The AWS AppSync GraphQL API to which you want to attach this resolver.
    • setApiId

      @Stability(Stable) public void setApiId(@NotNull String value)
      The AWS AppSync GraphQL API to which you want to attach this resolver.
    • getFieldName

      @Stability(Stable) @NotNull public String getFieldName()
      The GraphQL field on a type that invokes the resolver.
    • setFieldName

      @Stability(Stable) public void setFieldName(@NotNull String value)
      The GraphQL field on a type that invokes the resolver.
    • getTypeName

      @Stability(Stable) @NotNull public String getTypeName()
      The GraphQL type that invokes this resolver.
    • setTypeName

      @Stability(Stable) public void setTypeName(@NotNull String value)
      The GraphQL type that invokes this resolver.
    • getCachingConfig

      @Stability(Stable) @Nullable public Object getCachingConfig()
      The caching configuration for the resolver.
    • setCachingConfig

      @Stability(Stable) public void setCachingConfig(@Nullable IResolvable value)
      The caching configuration for the resolver.
    • setCachingConfig

      @Stability(Stable) public void setCachingConfig(@Nullable CfnResolver.CachingConfigProperty value)
      The caching configuration for the resolver.
    • getCode

      @Stability(Stable) @Nullable public String getCode()
      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 .

    • setCode

      @Stability(Stable) public void setCode(@Nullable String value)
      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 .

    • getCodeS3Location

      @Stability(Stable) @Nullable public String getCodeS3Location()
      The Amazon S3 endpoint.
    • setCodeS3Location

      @Stability(Stable) public void setCodeS3Location(@Nullable String value)
      The Amazon S3 endpoint.
    • getDataSourceName

      @Stability(Stable) @Nullable public String getDataSourceName()
      The resolver data source name.
    • setDataSourceName

      @Stability(Stable) public void setDataSourceName(@Nullable String value)
      The resolver data source name.
    • getKind

      @Stability(Stable) @Nullable public String 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

      @Stability(Stable) public void setKind(@Nullable String value)
      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

      @Stability(Stable) @Nullable public Number getMaxBatchSize()
      The maximum number of resolver request inputs that will be sent to a single AWS Lambda function in a BatchInvoke operation.
    • setMaxBatchSize

      @Stability(Stable) public void setMaxBatchSize(@Nullable Number value)
      The maximum number of resolver request inputs that will be sent to a single AWS Lambda function in a BatchInvoke operation.
    • getPipelineConfig

      @Stability(Stable) @Nullable public Object getPipelineConfig()
      Functions linked with the pipeline resolver.
    • setPipelineConfig

      @Stability(Stable) public void setPipelineConfig(@Nullable IResolvable value)
      Functions linked with the pipeline resolver.
    • setPipelineConfig

      @Stability(Stable) public void setPipelineConfig(@Nullable CfnResolver.PipelineConfigProperty value)
      Functions linked with the pipeline resolver.
    • getRequestMappingTemplate

      @Stability(Stable) @Nullable public String 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

      @Stability(Stable) public void setRequestMappingTemplate(@Nullable String value)
      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

      @Stability(Stable) @Nullable public String 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

      @Stability(Stable) public void setRequestMappingTemplateS3Location(@Nullable String value)
      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

      @Stability(Stable) @Nullable public String getResponseMappingTemplate()
      The response mapping template.
    • setResponseMappingTemplate

      @Stability(Stable) public void setResponseMappingTemplate(@Nullable String value)
      The response mapping template.
    • getResponseMappingTemplateS3Location

      @Stability(Stable) @Nullable public String 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

      @Stability(Stable) public void setResponseMappingTemplateS3Location(@Nullable String value)
      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

      @Stability(Stable) @Nullable public Object 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

      @Stability(Stable) public void setRuntime(@Nullable IResolvable value)
      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

      @Stability(Stable) public void setRuntime(@Nullable CfnResolver.AppSyncRuntimeProperty value)
      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

      @Stability(Stable) @Nullable public Object getSyncConfig()
      The SyncConfig for a resolver attached to a versioned data source.
    • setSyncConfig

      @Stability(Stable) public void setSyncConfig(@Nullable IResolvable value)
      The SyncConfig for a resolver attached to a versioned data source.
    • setSyncConfig

      @Stability(Stable) public void setSyncConfig(@Nullable CfnResolver.SyncConfigProperty value)
      The SyncConfig for a resolver attached to a versioned data source.