Class: AWSCDK::AppSync::CfnFunctionConfigurationProps

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

Overview

Properties for defining a CfnFunctionConfiguration.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_id:, data_source_name:, name:, code: nil, code_s3_location: nil, description: nil, function_version: nil, max_batch_size: 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) ⇒ CfnFunctionConfigurationProps

Returns a new instance of CfnFunctionConfigurationProps.

Parameters:

  • api_id (String)

    The AWS AppSync GraphQL API that you want to attach using this function.

  • data_source_name (String)

    The name of data source this function will attach.

  • name (String)

    The name of the function.

  • 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.

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

    The Function description.

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

    The version of the request mapping template.

  • 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.

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

    The Function request mapping template.

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

    Describes a Sync configuration for a resolver.

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

    The Function 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::CfnFunctionConfiguration::AppSyncRuntimeProperty, nil) (defaults to: nil)

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

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

    Describes a Sync configuration for a resolver.



23
24
25
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
# File 'app_sync/cfn_function_configuration_props.rb', line 23

def initialize(api_id:, data_source_name:, name:, code: nil, code_s3_location: nil, description: nil, function_version: nil, max_batch_size: 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")
  @data_source_name = data_source_name
  Jsii::Type.check_type(@data_source_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "dataSourceName")
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name")
  @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?
  @description = description
  Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") unless @description.nil?
  @function_version = function_version
  Jsii::Type.check_type(@function_version, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "functionVersion") unless @function_version.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?
  @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::CfnFunctionConfiguration::AppSyncRuntimeProperty.new(**runtime.transform_keys(&:to_sym)) : runtime
  Jsii::Type.check_type(@runtime, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19hcHBzeW5jLkNmbkZ1bmN0aW9uQ29uZmlndXJhdGlvbi5BcHBTeW5jUnVudGltZVByb3BlcnR5In1dfX0=")), "runtime") unless @runtime.nil?
  @sync_config = sync_config.is_a?(Hash) ? ::AWSCDK::AppSync::CfnFunctionConfiguration::SyncConfigProperty.new(**sync_config.transform_keys(&:to_sym)) : sync_config
  Jsii::Type.check_type(@sync_config, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19hcHBzeW5jLkNmbkZ1bmN0aW9uQ29uZmlndXJhdGlvbi5TeW5jQ29uZmlnUHJvcGVydHkifV19fQ==")), "syncConfig") unless @sync_config.nil?
end

Instance Attribute Details

#api_idString (readonly)

The AWS AppSync GraphQL API that you want to attach using this function.



58
59
60
# File 'app_sync/cfn_function_configuration_props.rb', line 58

def api_id
  @api_id
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 .



75
76
77
# File 'app_sync/cfn_function_configuration_props.rb', line 75

def code
  @code
end

#code_s3_locationString? (readonly)

The Amazon S3 endpoint.



80
81
82
# File 'app_sync/cfn_function_configuration_props.rb', line 80

def code_s3_location
  @code_s3_location
end

#data_source_nameString (readonly)

The name of data source this function will attach.



63
64
65
# File 'app_sync/cfn_function_configuration_props.rb', line 63

def data_source_name
  @data_source_name
end

#descriptionString? (readonly)

The Function description.



85
86
87
# File 'app_sync/cfn_function_configuration_props.rb', line 85

def description
  @description
end

#function_versionString? (readonly)

The version of the request mapping template.

Currently, only the 2018-05-29 version of the template is supported.



92
93
94
# File 'app_sync/cfn_function_configuration_props.rb', line 92

def function_version
  @function_version
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.



97
98
99
# File 'app_sync/cfn_function_configuration_props.rb', line 97

def max_batch_size
  @max_batch_size
end

#nameString (readonly)

The name of the function.



68
69
70
# File 'app_sync/cfn_function_configuration_props.rb', line 68

def name
  @name
end

#request_mapping_templateString? (readonly)

The Function request mapping template.

Functions support only the 2018-05-29 version of the request mapping template.



104
105
106
# File 'app_sync/cfn_function_configuration_props.rb', line 104

def request_mapping_template
  @request_mapping_template
end

#request_mapping_template_s3_locationString? (readonly)

Describes a Sync configuration for a resolver.

Contains information on which Conflict Detection, as well as Resolution strategy, should be performed when the resolver is invoked.



111
112
113
# File 'app_sync/cfn_function_configuration_props.rb', line 111

def request_mapping_template_s3_location
  @request_mapping_template_s3_location
end

#response_mapping_templateString? (readonly)

The Function response mapping template.



116
117
118
# File 'app_sync/cfn_function_configuration_props.rb', line 116

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.



123
124
125
# File 'app_sync/cfn_function_configuration_props.rb', line 123

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.



130
131
132
# File 'app_sync/cfn_function_configuration_props.rb', line 130

def runtime
  @runtime
end

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

Describes a Sync configuration for a resolver.

Specifies which Conflict Detection strategy and Resolution strategy to use when the resolver is invoked.



137
138
139
# File 'app_sync/cfn_function_configuration_props.rb', line 137

def sync_config
  @sync_config
end

Class Method Details

.jsii_propertiesObject



139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# File 'app_sync/cfn_function_configuration_props.rb', line 139

def self.jsii_properties
  {
    :api_id => "apiId",
    :data_source_name => "dataSourceName",
    :name => "name",
    :code => "code",
    :code_s3_location => "codeS3Location",
    :description => "description",
    :function_version => "functionVersion",
    :max_batch_size => "maxBatchSize",
    :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



158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# File 'app_sync/cfn_function_configuration_props.rb', line 158

def to_jsii
  result = {}
  result.merge!({
    "apiId" => @api_id,
    "dataSourceName" => @data_source_name,
    "name" => @name,
    "code" => @code,
    "codeS3Location" => @code_s3_location,
    "description" => @description,
    "functionVersion" => @function_version,
    "maxBatchSize" => @max_batch_size,
    "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