Class CfnResolver

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

@Generated(value="jsii-pacmak/1.101.0 (build b95fe5d)", date="2024-07-12T19:33:57.682Z") @Stability(Stable) public class CfnResolver extends CfnResource implements IInspectable
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)
         .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();
 

See Also:
  • 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 software.constructs.Construct scope, @NotNull String id, @NotNull CfnResolverProps props)
      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). 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.
    • setCode

      @Stability(Stable) public void setCode(@Nullable String value)
      The resolver code that contains the request and response functions.
    • 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.
    • setKind

      @Stability(Stable) public void setKind(@Nullable String value)
      The resolver type.
    • 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.
    • getMetricsConfig

      @Stability(Stable) @Nullable public String getMetricsConfig()
      Enables or disables enhanced resolver metrics for specified resolvers.
    • setMetricsConfig

      @Stability(Stable) public void setMetricsConfig(@Nullable String value)
      Enables or disables enhanced resolver metrics for specified resolvers.
    • 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.
    • setRequestMappingTemplate

      @Stability(Stable) public void setRequestMappingTemplate(@Nullable String value)
      The request mapping template.
    • getRequestMappingTemplateS3Location

      @Stability(Stable) @Nullable public String getRequestMappingTemplateS3Location()
      The location of a request mapping template in an Amazon S3 bucket.
    • setRequestMappingTemplateS3Location

      @Stability(Stable) public void setRequestMappingTemplateS3Location(@Nullable String value)
      The location of a request mapping template in an Amazon S3 bucket.
    • 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.
    • setResponseMappingTemplateS3Location

      @Stability(Stable) public void setResponseMappingTemplateS3Location(@Nullable String value)
      The location of a response mapping template in an Amazon S3 bucket.
    • getRuntime

      @Stability(Stable) @Nullable public Object getRuntime()
      Describes a runtime used by an AWS AppSync resolver or AWS AppSync function.
    • setRuntime

      @Stability(Stable) public void setRuntime(@Nullable IResolvable value)
      Describes a runtime used by an AWS AppSync resolver or AWS AppSync function.
    • setRuntime

      @Stability(Stable) public void setRuntime(@Nullable CfnResolver.AppSyncRuntimeProperty value)
      Describes a runtime used by an AWS AppSync resolver or AWS AppSync function.
    • 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.