Class: AWSCDK::AppSync::RDSDataSourcePropsV2

Inherits:
BackedDataSourceProps
  • Object
show all
Defined in:
app_sync/rds_data_source_props_v2.rb

Overview

Properties for an AppSync RDS datasource Aurora Serverless V2.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api:, description: nil, metrics_config: nil, name: nil, service_role: nil, secret_store:, serverless_cluster:, database_name: nil) ⇒ RDSDataSourcePropsV2

Returns a new instance of RDSDataSourcePropsV2.

Parameters:

  • api (AWSCDK::Interfaces::AWSAppsync::IGraphQLAPIRef)

    The API to attach this data source to.

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

    the description of the data source.

  • metrics_config (AWSCDK::AppSync::DataSourceMetricsConfig, nil) (defaults to: nil)

    Whether to enable enhanced metrics of the data source Value will be ignored, if enhancedMetricsConfig.dataSourceLevelMetricsBehavior on AppSync GraphqlApi construct is set to FULL_REQUEST_DATA_SOURCE_METRICS.

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

    The name of the data source.

  • service_role (AWSCDK::IAM::IRole, nil) (defaults to: nil)

    The IAM service role to be assumed by AppSync to interact with the data source.

  • secret_store (AWSCDK::SecretsManager::ISecret)

    The secret containing the credentials for the database.

  • serverless_cluster (AWSCDK::RDS::IDatabaseCluster)

    The serverless cluster to call to interact with this data source.

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

    The name of the database to use within the cluster.



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'app_sync/rds_data_source_props_v2.rb', line 15

def initialize(api:, description: nil, metrics_config: nil, name: nil, service_role: nil, secret_store:, serverless_cluster:, database_name: nil)
  @api = api
  Jsii::Type.check_type(@api, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19hcHBzeW5jLklHcmFwaFFMQXBpUmVmIn0=")), "api")
  @description = description
  Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") unless @description.nil?
  @metrics_config = metrics_config
  Jsii::Type.check_type(@metrics_config, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwc3luYy5EYXRhU291cmNlTWV0cmljc0NvbmZpZyJ9")), "metricsConfig") unless @metrics_config.nil?
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name") unless @name.nil?
  @service_role = service_role
  Jsii::Type.check_type(@service_role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "serviceRole") unless @service_role.nil?
  @secret_store = secret_store
  Jsii::Type.check_type(@secret_store, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc2VjcmV0c21hbmFnZXIuSVNlY3JldCJ9")), "secretStore")
  @serverless_cluster = serverless_cluster
  Jsii::Type.check_type(@serverless_cluster, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfcmRzLklEYXRhYmFzZUNsdXN0ZXIifQ==")), "serverlessCluster")
  @database_name = database_name
  Jsii::Type.check_type(@database_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "databaseName") unless @database_name.nil?
end

Instance Attribute Details

#apiAWSCDK::Interfaces::AWSAppsync::IGraphQLAPIRef (readonly)

The API to attach this data source to.



37
38
39
# File 'app_sync/rds_data_source_props_v2.rb', line 37

def api
  @api
end

#database_nameString? (readonly)

Note:

Default: - None

The name of the database to use within the cluster.

Returns:

  • (String, nil)


70
71
72
# File 'app_sync/rds_data_source_props_v2.rb', line 70

def database_name
  @database_name
end

#descriptionString? (readonly)

Note:

Default: - None

the description of the data source.

Returns:

  • (String, nil)


42
43
44
# File 'app_sync/rds_data_source_props_v2.rb', line 42

def description
  @description
end

#metrics_configAWSCDK::AppSync::DataSourceMetricsConfig? (readonly)

Note:

Default: - no metrics configuration

Whether to enable enhanced metrics of the data source Value will be ignored, if enhancedMetricsConfig.dataSourceLevelMetricsBehavior on AppSync GraphqlApi construct is set to FULL_REQUEST_DATA_SOURCE_METRICS.



47
48
49
# File 'app_sync/rds_data_source_props_v2.rb', line 47

def metrics_config
  @metrics_config
end

#nameString? (readonly)

Note:

Default: - id of data source

The name of the data source.

Returns:

  • (String, nil)


52
53
54
# File 'app_sync/rds_data_source_props_v2.rb', line 52

def name
  @name
end

#secret_storeAWSCDK::SecretsManager::ISecret (readonly)

The secret containing the credentials for the database.



61
62
63
# File 'app_sync/rds_data_source_props_v2.rb', line 61

def secret_store
  @secret_store
end

#serverless_clusterAWSCDK::RDS::IDatabaseCluster (readonly)

The serverless cluster to call to interact with this data source.



65
66
67
# File 'app_sync/rds_data_source_props_v2.rb', line 65

def serverless_cluster
  @serverless_cluster
end

#service_roleAWSCDK::IAM::IRole? (readonly)

Note:

Default: - Create a new role

The IAM service role to be assumed by AppSync to interact with the data source.

Returns:



57
58
59
# File 'app_sync/rds_data_source_props_v2.rb', line 57

def service_role
  @service_role
end

Class Method Details

.jsii_propertiesObject



72
73
74
75
76
77
78
79
80
81
82
83
# File 'app_sync/rds_data_source_props_v2.rb', line 72

def self.jsii_properties
  {
    :api => "api",
    :description => "description",
    :metrics_config => "metricsConfig",
    :name => "name",
    :service_role => "serviceRole",
    :secret_store => "secretStore",
    :serverless_cluster => "serverlessCluster",
    :database_name => "databaseName",
  }
end

Instance Method Details

#to_jsiiObject



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'app_sync/rds_data_source_props_v2.rb', line 85

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "api" => @api,
    "description" => @description,
    "metricsConfig" => @metrics_config,
    "name" => @name,
    "serviceRole" => @service_role,
    "secretStore" => @secret_store,
    "serverlessCluster" => @serverless_cluster,
    "databaseName" => @database_name,
  })
  result.compact
end