Class: AWSCDK::AppSync::SourceAPIOptions

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

Overview

Additional API configuration for creating a AppSync Merged API.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source_apis:, merged_api_execution_role: nil) ⇒ SourceAPIOptions

Returns a new instance of SourceAPIOptions.

Parameters:

  • source_apis (Array<AWSCDK::AppSync::SourceAPI>)

    Definition of source APIs associated with this Merged API.

  • merged_api_execution_role (AWSCDK::IAM::Role, nil) (defaults to: nil)

    IAM Role used to validate access to source APIs at runtime and to update the merged API endpoint with the source API changes.



9
10
11
12
13
14
# File 'app_sync/source_api_options.rb', line 9

def initialize(source_apis:, merged_api_execution_role: nil)
  @source_apis = source_apis.is_a?(Array) ? source_apis.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::AppSync::SourceAPI.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : source_apis
  Jsii::Type.check_type(@source_apis, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19hcHBzeW5jLlNvdXJjZUFwaSJ9LCJraW5kIjoiYXJyYXkifX0=")), "sourceApis")
  @merged_api_execution_role = merged_api_execution_role
  Jsii::Type.check_type(@merged_api_execution_role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLlJvbGUifQ==")), "mergedApiExecutionRole") unless @merged_api_execution_role.nil?
end

Instance Attribute Details

#merged_api_execution_roleAWSCDK::IAM::Role? (readonly)

Note:

Default: - An IAM Role with acccess to source schemas will be created

IAM Role used to validate access to source APIs at runtime and to update the merged API endpoint with the source API changes.

Returns:



24
25
26
# File 'app_sync/source_api_options.rb', line 24

def merged_api_execution_role
  @merged_api_execution_role
end

#source_apisArray<AWSCDK::AppSync::SourceAPI> (readonly)

Definition of source APIs associated with this Merged API.

Returns:



19
20
21
# File 'app_sync/source_api_options.rb', line 19

def source_apis
  @source_apis
end

Class Method Details

.jsii_propertiesObject



26
27
28
29
30
31
# File 'app_sync/source_api_options.rb', line 26

def self.jsii_properties
  {
    :source_apis => "sourceApis",
    :merged_api_execution_role => "mergedApiExecutionRole",
  }
end

Instance Method Details

#to_jsiiObject



33
34
35
36
37
38
39
40
# File 'app_sync/source_api_options.rb', line 33

def to_jsii
  result = {}
  result.merge!({
    "sourceApis" => @source_apis,
    "mergedApiExecutionRole" => @merged_api_execution_role,
  })
  result.compact
end