Module: AWSCDK::RDS::IDatabaseCluster

Includes:
EC2::IConnectable, IResource, Interfaces::AWSRDS::IDBClusterRef, SecretsManager::ISecretAttachmentTarget
Included in:
DatabaseClusterBase
Defined in:
rds/i_database_cluster.rb

Overview

Create a clustered database with a given number of instances.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.jsii_overridable_methodsObject



364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
# File 'rds/i_database_cluster.rb', line 364

def self.jsii_overridable_methods
  {
    :node => { kind: :property, name: "node", is_optional: false },
    :env => { kind: :property, name: "env", is_optional: false },
    :stack => { kind: :property, name: "stack", is_optional: false },
    :connections => { kind: :property, name: "connections", is_optional: false },
    :db_cluster_ref => { kind: :property, name: "dbClusterRef", is_optional: false },
    :cluster_arn => { kind: :property, name: "clusterArn", is_optional: false },
    :cluster_endpoint => { kind: :property, name: "clusterEndpoint", is_optional: false },
    :cluster_identifier => { kind: :property, name: "clusterIdentifier", is_optional: false },
    :cluster_read_endpoint => { kind: :property, name: "clusterReadEndpoint", is_optional: false },
    :cluster_resource_identifier => { kind: :property, name: "clusterResourceIdentifier", is_optional: false },
    :instance_endpoints => { kind: :property, name: "instanceEndpoints", is_optional: false },
    :instance_identifiers => { kind: :property, name: "instanceIdentifiers", is_optional: false },
    :engine => { kind: :property, name: "engine", is_optional: true },
    :with => { kind: :method, name: "with", is_optional: false },
    :apply_removal_policy => { kind: :method, name: "applyRemovalPolicy", is_optional: false },
    :as_secret_attachment_target => { kind: :method, name: "asSecretAttachmentTarget", is_optional: false },
    :add_proxy => { kind: :method, name: "addProxy", is_optional: false },
    :grant_connect => { kind: :method, name: "grantConnect", is_optional: false },
    :grant_data_api_access => { kind: :method, name: "grantDataApiAccess", is_optional: false },
    :metric => { kind: :method, name: "metric", is_optional: false },
    :metric_cpu_utilization => { kind: :method, name: "metricCPUUtilization", is_optional: false },
    :metric_database_connections => { kind: :method, name: "metricDatabaseConnections", is_optional: false },
    :metric_deadlocks => { kind: :method, name: "metricDeadlocks", is_optional: false },
    :metric_engine_uptime => { kind: :method, name: "metricEngineUptime", is_optional: false },
    :metric_freeable_memory => { kind: :method, name: "metricFreeableMemory", is_optional: false },
    :metric_free_local_storage => { kind: :method, name: "metricFreeLocalStorage", is_optional: false },
    :metric_network_receive_throughput => { kind: :method, name: "metricNetworkReceiveThroughput", is_optional: false },
    :metric_network_throughput => { kind: :method, name: "metricNetworkThroughput", is_optional: false },
    :metric_network_transmit_throughput => { kind: :method, name: "metricNetworkTransmitThroughput", is_optional: false },
    :metric_snapshot_storage_used => { kind: :method, name: "metricSnapshotStorageUsed", is_optional: false },
    :metric_total_backup_storage_billed => { kind: :method, name: "metricTotalBackupStorageBilled", is_optional: false },
    :metric_volume_bytes_used => { kind: :method, name: "metricVolumeBytesUsed", is_optional: false },
    :metric_volume_read_io_ps => { kind: :method, name: "metricVolumeReadIOPs", is_optional: false },
    :metric_volume_write_io_ps => { kind: :method, name: "metricVolumeWriteIOPs", is_optional: false },
  }
end

Instance Method Details

#add_proxy(id, options) ⇒ AWSCDK::RDS::DatabaseProxy

Add a new db proxy to this cluster.

Parameters:

Returns:



157
158
159
160
161
162
# File 'rds/i_database_cluster.rb', line 157

def add_proxy(id, options)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  options = options.is_a?(Hash) ? ::AWSCDK::RDS::DatabaseProxyOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfcmRzLkRhdGFiYXNlUHJveHlPcHRpb25zIn0=")), "options")
  jsii_call_method("addProxy", [id, options])
end

#apply_removal_policy(policy) ⇒ void

This method returns an undefined value.

Apply the given removal policy to this resource.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

Parameters:



140
141
142
143
# File 'rds/i_database_cluster.rb', line 140

def apply_removal_policy(policy)
  Jsii::Type.check_type(policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZW1vdmFsUG9saWN5In0=")), "policy")
  jsii_call_method("applyRemovalPolicy", [policy])
end

#as_secret_attachment_targetAWSCDK::SecretsManager::SecretAttachmentTargetProps

Renders the target specifications.



148
149
150
# File 'rds/i_database_cluster.rb', line 148

def as_secret_attachment_target()
  jsii_call_method("asSecretAttachmentTarget", [])
end

#cluster_arnString

The ARN of the database cluster.

Returns:

  • (String)


57
58
59
# File 'rds/i_database_cluster.rb', line 57

def cluster_arn()
  jsii_get_property("clusterArn")
end

#cluster_endpointAWSCDK::RDS::Endpoint

The endpoint to use for read/write operations.



64
65
66
# File 'rds/i_database_cluster.rb', line 64

def cluster_endpoint()
  jsii_get_property("clusterEndpoint")
end

#cluster_identifierString

Identifier of the cluster.

Returns:

  • (String)


71
72
73
# File 'rds/i_database_cluster.rb', line 71

def cluster_identifier()
  jsii_get_property("clusterIdentifier")
end

#cluster_read_endpointAWSCDK::RDS::Endpoint

Endpoint to use for load-balanced read-only operations.



78
79
80
# File 'rds/i_database_cluster.rb', line 78

def cluster_read_endpoint()
  jsii_get_property("clusterReadEndpoint")
end

#cluster_resource_identifierString

The immutable identifier for the cluster; for example: cluster-ABCD1234EFGH5678IJKL90MNOP.

This AWS Region-unique identifier is used in things like IAM authentication policies.

Returns:

  • (String)


87
88
89
# File 'rds/i_database_cluster.rb', line 87

def cluster_resource_identifier()
  jsii_get_property("clusterResourceIdentifier")
end

#connectionsAWSCDK::EC2::Connections

The network connections associated with this resource.



43
44
45
# File 'rds/i_database_cluster.rb', line 43

def connections()
  jsii_get_property("connections")
end

#db_cluster_refAWSCDK::Interfaces::AWSRDS::DBClusterReference

A reference to a DBCluster resource.



50
51
52
# File 'rds/i_database_cluster.rb', line 50

def db_cluster_ref()
  jsii_get_property("dbClusterRef")
end

#engineAWSCDK::RDS::IClusterEngine?

The engine of this Cluster.

May be not known for imported Clusters if it wasn't provided explicitly.

Returns:



110
111
112
# File 'rds/i_database_cluster.rb', line 110

def engine()
  jsii_get_property("engine")
end

#envAWSCDK::Interfaces::ResourceEnvironment

The environment this resource belongs to.

For resources that are created and managed in a Stack (those created by creating new class instances like new Role(), new Bucket(), etc.), this is always the same as the environment of the stack they belong to.

For referenced resources (those obtained from referencing methods like Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be different than the stack they were imported into.



29
30
31
# File 'rds/i_database_cluster.rb', line 29

def env()
  jsii_get_property("env")
end

#grant_connect(grantee, db_user) ⇒ AWSCDK::IAM::Grant

Grant the given identity connection access to the Cluster.

Parameters:

  • grantee (AWSCDK::IAM::IGrantable)

    the Principal to grant the permissions to.

  • db_user (String)

    the name of the database user to allow connecting.

Returns:



169
170
171
172
173
# File 'rds/i_database_cluster.rb', line 169

def grant_connect(grantee, db_user)
  Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee")
  Jsii::Type.check_type(db_user, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "dbUser")
  jsii_call_method("grantConnect", [grantee, db_user])
end

#grant_data_api_access(grantee) ⇒ AWSCDK::IAM::Grant

Grant the given identity to access to the Data API.

Parameters:

Returns:



179
180
181
182
# File 'rds/i_database_cluster.rb', line 179

def grant_data_api_access(grantee)
  Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee")
  jsii_call_method("grantDataApiAccess", [grantee])
end

#instance_endpointsArray<AWSCDK::RDS::Endpoint>

Endpoints which address each individual replica.

Returns:



94
95
96
# File 'rds/i_database_cluster.rb', line 94

def instance_endpoints()
  jsii_get_property("instanceEndpoints")
end

#instance_identifiersArray<String>

Identifiers of the replicas.

Returns:

  • (Array<String>)


101
102
103
# File 'rds/i_database_cluster.rb', line 101

def instance_identifiers()
  jsii_get_property("instanceIdentifiers")
end

#metric(metric_name, props = nil) ⇒ AWSCDK::CloudWatch::Metric

Return the given named metric for this DBCluster.

Parameters:

Returns:



189
190
191
192
193
194
# File 'rds/i_database_cluster.rb', line 189

def metric(metric_name, props = nil)
  Jsii::Type.check_type(metric_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "metricName")
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metric", [metric_name, props])
end

#metric_cpu_utilization(props = nil) ⇒ AWSCDK::CloudWatch::Metric

The percentage of CPU utilization.

Average over 5 minutes

Parameters:

Returns:



202
203
204
205
206
# File 'rds/i_database_cluster.rb', line 202

def metric_cpu_utilization(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricCPUUtilization", [props])
end

#metric_database_connections(props = nil) ⇒ AWSCDK::CloudWatch::Metric

The number of database connections in use.

Average over 5 minutes

Parameters:

Returns:



214
215
216
217
218
# File 'rds/i_database_cluster.rb', line 214

def metric_database_connections(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricDatabaseConnections", [props])
end

#metric_deadlocks(props = nil) ⇒ AWSCDK::CloudWatch::Metric

The average number of deadlocks in the database per second.

Average over 5 minutes

Parameters:

Returns:



226
227
228
229
230
# File 'rds/i_database_cluster.rb', line 226

def metric_deadlocks(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricDeadlocks", [props])
end

#metric_engine_uptime(props = nil) ⇒ AWSCDK::CloudWatch::Metric

The amount of time that the instance has been running, in seconds.

Average over 5 minutes

Parameters:

Returns:



238
239
240
241
242
# File 'rds/i_database_cluster.rb', line 238

def metric_engine_uptime(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricEngineUptime", [props])
end

#metric_free_local_storage(props = nil) ⇒ AWSCDK::CloudWatch::Metric

The amount of local storage available, in bytes.

Average over 5 minutes

Parameters:

Returns:



262
263
264
265
266
# File 'rds/i_database_cluster.rb', line 262

def metric_free_local_storage(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricFreeLocalStorage", [props])
end

#metric_freeable_memory(props = nil) ⇒ AWSCDK::CloudWatch::Metric

The amount of available random access memory, in bytes.

Average over 5 minutes

Parameters:

Returns:



250
251
252
253
254
# File 'rds/i_database_cluster.rb', line 250

def metric_freeable_memory(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricFreeableMemory", [props])
end

#metric_network_receive_throughput(props = nil) ⇒ AWSCDK::CloudWatch::Metric

The amount of network throughput received from clients by each instance, in bytes per second.

Average over 5 minutes

Parameters:

Returns:



274
275
276
277
278
# File 'rds/i_database_cluster.rb', line 274

def metric_network_receive_throughput(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricNetworkReceiveThroughput", [props])
end

#metric_network_throughput(props = nil) ⇒ AWSCDK::CloudWatch::Metric

The amount of network throughput both received from and transmitted to clients by each instance, in bytes per second.

Average over 5 minutes

Parameters:

Returns:



286
287
288
289
290
# File 'rds/i_database_cluster.rb', line 286

def metric_network_throughput(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricNetworkThroughput", [props])
end

#metric_network_transmit_throughput(props = nil) ⇒ AWSCDK::CloudWatch::Metric

The amount of network throughput sent to clients by each instance, in bytes per second.

Average over 5 minutes

Parameters:

Returns:



298
299
300
301
302
# File 'rds/i_database_cluster.rb', line 298

def metric_network_transmit_throughput(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricNetworkTransmitThroughput", [props])
end

#metric_snapshot_storage_used(props = nil) ⇒ AWSCDK::CloudWatch::Metric

The total amount of backup storage in bytes consumed by all Aurora snapshots outside its backup retention window.

Average over 5 minutes

Parameters:

Returns:



310
311
312
313
314
# File 'rds/i_database_cluster.rb', line 310

def metric_snapshot_storage_used(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricSnapshotStorageUsed", [props])
end

#metric_total_backup_storage_billed(props = nil) ⇒ AWSCDK::CloudWatch::Metric

The total amount of backup storage in bytes for which you are billed.

Average over 5 minutes

Parameters:

Returns:



322
323
324
325
326
# File 'rds/i_database_cluster.rb', line 322

def metric_total_backup_storage_billed(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricTotalBackupStorageBilled", [props])
end

#metric_volume_bytes_used(props = nil) ⇒ AWSCDK::CloudWatch::Metric

The amount of storage used by your Aurora DB instance, in bytes.

Average over 5 minutes

Parameters:

Returns:



334
335
336
337
338
# File 'rds/i_database_cluster.rb', line 334

def metric_volume_bytes_used(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricVolumeBytesUsed", [props])
end

#metric_volume_read_io_ps(props = nil) ⇒ AWSCDK::CloudWatch::Metric

The number of billed read I/O operations from a cluster volume, reported at 5-minute intervals.

Average over 5 minutes

Parameters:

Returns:



346
347
348
349
350
# File 'rds/i_database_cluster.rb', line 346

def metric_volume_read_io_ps(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricVolumeReadIOPs", [props])
end

#metric_volume_write_io_ps(props = nil) ⇒ AWSCDK::CloudWatch::Metric

The number of write disk I/O operations to the cluster volume, reported at 5-minute intervals.

Average over 5 minutes

Parameters:

Returns:



358
359
360
361
362
# File 'rds/i_database_cluster.rb', line 358

def metric_volume_write_io_ps(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudWatch::MetricOptions.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5NZXRyaWNPcHRpb25zIn0=")), "props") unless props.nil?
  jsii_call_method("metricVolumeWriteIOPs", [props])
end

#nodeConstructs::Node

The tree node.

Returns:

  • (Constructs::Node)


14
15
16
# File 'rds/i_database_cluster.rb', line 14

def node()
  jsii_get_property("node")
end

#stackAWSCDK::Stack

The stack in which this resource is defined.

Returns:



36
37
38
# File 'rds/i_database_cluster.rb', line 36

def stack()
  jsii_get_property("stack")
end

#with(*mixins) ⇒ Constructs::IConstruct

Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited.

Parameters:

  • mixins (Array<Constructs::IMixin>)

    The mixins to apply.

Returns:

  • (Constructs::IConstruct)

    This construct for chaining



121
122
123
124
125
126
# File 'rds/i_database_cluster.rb', line 121

def with(*mixins)
  mixins.each_with_index do |item, index|
    Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLklNaXhpbiJ9")), "mixins[#{index}]")
  end
  jsii_call_method("with", [*mixins])
end