Class: AWSCDK::AppSync::CfnResolverProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
app_sync/cfn_resolver_props.rb

Overview

Properties for defining a CfnResolver.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_id:, field_name:, type_name:, caching_config: nil, code: nil, code_s3_location: nil, data_source_name: nil, kind: nil, max_batch_size: nil, metrics_config: nil, pipeline_config: nil, request_mapping_template: nil, request_mapping_template_s3_location: nil, response_mapping_template: nil, response_mapping_template_s3_location: nil, runtime: nil, sync_config: nil) ⇒ CfnResolverProps

Returns a new instance of CfnResolverProps.

Parameters:

  • api_id (String)

    The AWS AppSync GraphQL API to which you want to attach this resolver.

  • field_name (String)

    The GraphQL field on a type that invokes the resolver.

  • type_name (String)

    The GraphQL type that invokes this resolver.

  • caching_config (AWSCDK::IResolvable, AWSCDK::AppSync::CfnResolver::CachingConfigProperty, nil) (defaults to: nil)

    The caching configuration for the resolver.

  • code (String, nil) (defaults to: nil)

    The resolver code that contains the request and response functions.

  • code_s3_location (String, nil) (defaults to: nil)

    The Amazon S3 endpoint.

  • data_source_name (String, nil) (defaults to: nil)

    The resolver data source name.

  • kind (String, nil) (defaults to: nil)

    The resolver type.

  • max_batch_size (Numeric, nil) (defaults to: nil)

    The maximum number of resolver request inputs that will be sent to a single AWS Lambda function in a BatchInvoke operation.

  • metrics_config (String, nil) (defaults to: nil)

    Enables or disables enhanced resolver metrics for specified resolvers.

  • pipeline_config (AWSCDK::IResolvable, AWSCDK::AppSync::CfnResolver::PipelineConfigProperty, nil) (defaults to: nil)

    Functions linked with the pipeline resolver.

  • request_mapping_template (String, nil) (defaults to: nil)

    The request mapping template.

  • request_mapping_template_s3_location (String, nil) (defaults to: nil)

    The location of a request mapping template in an Amazon S3 bucket.

  • response_mapping_template (String, nil) (defaults to: nil)

    The response mapping template.

  • response_mapping_template_s3_location (String, nil) (defaults to: nil)

    The location of a response mapping template in an Amazon S3 bucket.

  • runtime (AWSCDK::IResolvable, AWSCDK::AppSync::CfnResolver::AppSyncRuntimeProperty, nil) (defaults to: nil)

    Describes a runtime used by an AWS AppSync resolver or AWS AppSync function.

  • sync_config (AWSCDK::IResolvable, AWSCDK::AppSync::CfnResolver::SyncConfigProperty, nil) (defaults to: nil)

    The SyncConfig for a resolver attached to a versioned data source.



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'app_sync/cfn_resolver_props.rb', line 26

def initialize(api_id:, field_name:, type_name:, caching_config: nil, code: nil, code_s3_location: nil, data_source_name: nil, kind: nil, max_batch_size: nil, metrics_config: nil, pipeline_config: nil, request_mapping_template: nil, request_mapping_template_s3_location: nil, response_mapping_template: nil, response_mapping_template_s3_location: nil, runtime: nil, sync_config: nil)
  @api_id = api_id
  Jsii::Type.check_type(@api_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "apiId")
  @field_name = field_name
  Jsii::Type.check_type(@field_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "fieldName")
  @type_name = type_name
  Jsii::Type.check_type(@type_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "typeName")
  @caching_config = caching_config.is_a?(Hash) ? ::AWSCDK::AppSync::CfnResolver::CachingConfigProperty.new(**caching_config.transform_keys(&:to_sym)) : caching_config
  Jsii::Type.check_type(@caching_config, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19hcHBzeW5jLkNmblJlc29sdmVyLkNhY2hpbmdDb25maWdQcm9wZXJ0eSJ9XX19")), "cachingConfig") unless @caching_config.nil?
  @code = code
  Jsii::Type.check_type(@code, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "code") unless @code.nil?
  @code_s3_location = code_s3_location
  Jsii::Type.check_type(@code_s3_location, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "codeS3Location") unless @code_s3_location.nil?
  @data_source_name = data_source_name
  Jsii::Type.check_type(@data_source_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "dataSourceName") unless @data_source_name.nil?
  @kind = kind
  Jsii::Type.check_type(@kind, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "kind") unless @kind.nil?
  @max_batch_size = max_batch_size
  Jsii::Type.check_type(@max_batch_size, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "maxBatchSize") unless @max_batch_size.nil?
  @metrics_config = metrics_config
  Jsii::Type.check_type(@metrics_config, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "metricsConfig") unless @metrics_config.nil?
  @pipeline_config = pipeline_config.is_a?(Hash) ? ::AWSCDK::AppSync::CfnResolver::PipelineConfigProperty.new(**pipeline_config.transform_keys(&:to_sym)) : pipeline_config
  Jsii::Type.check_type(@pipeline_config, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19hcHBzeW5jLkNmblJlc29sdmVyLlBpcGVsaW5lQ29uZmlnUHJvcGVydHkifV19fQ==")), "pipelineConfig") unless @pipeline_config.nil?
  @request_mapping_template = request_mapping_template
  Jsii::Type.check_type(@request_mapping_template, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "requestMappingTemplate") unless @request_mapping_template.nil?
  @request_mapping_template_s3_location = request_mapping_template_s3_location
  Jsii::Type.check_type(@request_mapping_template_s3_location, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "requestMappingTemplateS3Location") unless @request_mapping_template_s3_location.nil?
  @response_mapping_template = response_mapping_template
  Jsii::Type.check_type(@response_mapping_template, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "responseMappingTemplate") unless @response_mapping_template.nil?
  @response_mapping_template_s3_location = response_mapping_template_s3_location
  Jsii::Type.check_type(@response_mapping_template_s3_location, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "responseMappingTemplateS3Location") unless @response_mapping_template_s3_location.nil?
  @runtime = runtime.is_a?(Hash) ? ::AWSCDK::AppSync::CfnResolver::AppSyncRuntimeProperty.new(**runtime.transform_keys(&:to_sym)) : runtime
  Jsii::Type.check_type(@runtime, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19hcHBzeW5jLkNmblJlc29sdmVyLkFwcFN5bmNSdW50aW1lUHJvcGVydHkifV19fQ==")), "runtime") unless @runtime.nil?
  @sync_config = sync_config.is_a?(Hash) ? ::AWSCDK::AppSync::CfnResolver::SyncConfigProperty.new(**sync_config.transform_keys(&:to_sym)) : sync_config
  Jsii::Type.check_type(@sync_config, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19hcHBzeW5jLkNmblJlc29sdmVyLlN5bmNDb25maWdQcm9wZXJ0eSJ9XX19")), "syncConfig") unless @sync_config.nil?
end

Instance Attribute Details

#api_idString (readonly)

The AWS AppSync GraphQL API to which you want to attach this resolver.



67
68
69
# File 'app_sync/cfn_resolver_props.rb', line 67

def api_id
  @api_id
end

#caching_configAWSCDK::IResolvable, ... (readonly)

The caching configuration for the resolver.



82
83
84
# File 'app_sync/cfn_resolver_props.rb', line 82

def caching_config
  @caching_config
end

#codeString? (readonly)

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 .



89
90
91
# File 'app_sync/cfn_resolver_props.rb', line 89

def code
  @code
end

#code_s3_locationString? (readonly)

The Amazon S3 endpoint.



94
95
96
# File 'app_sync/cfn_resolver_props.rb', line 94

def code_s3_location
  @code_s3_location
end

#data_source_nameString? (readonly)

The resolver data source name.



99
100
101
# File 'app_sync/cfn_resolver_props.rb', line 99

def data_source_name
  @data_source_name
end

#field_nameString (readonly)

The GraphQL field on a type that invokes the resolver.



72
73
74
# File 'app_sync/cfn_resolver_props.rb', line 72

def field_name
  @field_name
end

#kindString? (readonly)

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.


107
108
109
# File 'app_sync/cfn_resolver_props.rb', line 107

def kind
  @kind
end

#max_batch_sizeNumeric? (readonly)

The maximum number of resolver request inputs that will be sent to a single AWS Lambda function in a BatchInvoke operation.



112
113
114
# File 'app_sync/cfn_resolver_props.rb', line 112

def max_batch_size
  @max_batch_size
end

#metrics_configString? (readonly)

Enables or disables enhanced resolver metrics for specified resolvers.

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



119
120
121
# File 'app_sync/cfn_resolver_props.rb', line 119

def metrics_config
  @metrics_config
end

#pipeline_configAWSCDK::IResolvable, ... (readonly)

Functions linked with the pipeline resolver.



124
125
126
# File 'app_sync/cfn_resolver_props.rb', line 124

def pipeline_config
  @pipeline_config
end

#request_mapping_templateString? (readonly)

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.



131
132
133
# File 'app_sync/cfn_resolver_props.rb', line 131

def request_mapping_template
  @request_mapping_template
end

#request_mapping_template_s3_locationString? (readonly)

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.



138
139
140
# File 'app_sync/cfn_resolver_props.rb', line 138

def request_mapping_template_s3_location
  @request_mapping_template_s3_location
end

#response_mapping_templateString? (readonly)

The response mapping template.



143
144
145
# File 'app_sync/cfn_resolver_props.rb', line 143

def response_mapping_template
  @response_mapping_template
end

#response_mapping_template_s3_locationString? (readonly)

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.



150
151
152
# File 'app_sync/cfn_resolver_props.rb', line 150

def response_mapping_template_s3_location
  @response_mapping_template_s3_location
end

#runtimeAWSCDK::IResolvable, ... (readonly)

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.



157
158
159
# File 'app_sync/cfn_resolver_props.rb', line 157

def runtime
  @runtime
end

#sync_configAWSCDK::IResolvable, ... (readonly)

The SyncConfig for a resolver attached to a versioned data source.



162
163
164
# File 'app_sync/cfn_resolver_props.rb', line 162

def sync_config
  @sync_config
end

#type_nameString (readonly)

The GraphQL type that invokes this resolver.



77
78
79
# File 'app_sync/cfn_resolver_props.rb', line 77

def type_name
  @type_name
end

Class Method Details

.jsii_propertiesObject



164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# File 'app_sync/cfn_resolver_props.rb', line 164

def self.jsii_properties
  {
    :api_id => "apiId",
    :field_name => "fieldName",
    :type_name => "typeName",
    :caching_config => "cachingConfig",
    :code => "code",
    :code_s3_location => "codeS3Location",
    :data_source_name => "dataSourceName",
    :kind => "kind",
    :max_batch_size => "maxBatchSize",
    :metrics_config => "metricsConfig",
    :pipeline_config => "pipelineConfig",
    :request_mapping_template => "requestMappingTemplate",
    :request_mapping_template_s3_location => "requestMappingTemplateS3Location",
    :response_mapping_template => "responseMappingTemplate",
    :response_mapping_template_s3_location => "responseMappingTemplateS3Location",
    :runtime => "runtime",
    :sync_config => "syncConfig",
  }
end

Instance Method Details

#to_jsiiObject



186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
# File 'app_sync/cfn_resolver_props.rb', line 186

def to_jsii
  result = {}
  result.merge!({
    "apiId" => @api_id,
    "fieldName" => @field_name,
    "typeName" => @type_name,
    "cachingConfig" => @caching_config,
    "code" => @code,
    "codeS3Location" => @code_s3_location,
    "dataSourceName" => @data_source_name,
    "kind" => @kind,
    "maxBatchSize" => @max_batch_size,
    "metricsConfig" => @metrics_config,
    "pipelineConfig" => @pipeline_config,
    "requestMappingTemplate" => @request_mapping_template,
    "requestMappingTemplateS3Location" => @request_mapping_template_s3_location,
    "responseMappingTemplate" => @response_mapping_template,
    "responseMappingTemplateS3Location" => @response_mapping_template_s3_location,
    "runtime" => @runtime,
    "syncConfig" => @sync_config,
  })
  result.compact
end