Class: AWSCDK::DocDB::DatabaseInstanceProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
doc_db/database_instance_props.rb

Overview

Construction properties for a DatabaseInstanceNew.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cluster:, instance_type:, auto_minor_version_upgrade: nil, availability_zone: nil, ca_certificate: nil, db_instance_name: nil, enable_performance_insights: nil, preferred_maintenance_window: nil, removal_policy: nil) ⇒ DatabaseInstanceProps

Returns a new instance of DatabaseInstanceProps.

Parameters:

  • cluster (AWSCDK::Interfaces::AWSDocdb::IDBClusterRef)

    The DocumentDB database cluster the instance should launch into.

  • instance_type (AWSCDK::EC2::InstanceType)

    The name of the compute and memory capacity classes.

  • auto_minor_version_upgrade (Boolean, nil) (defaults to: nil)

    Indicates that minor engine upgrades are applied automatically to the DB instance during the maintenance window.

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

    The name of the Availability Zone where the DB instance will be located.

  • ca_certificate (AWSCDK::RDS::CaCertificate, nil) (defaults to: nil)

    The identifier of the CA certificate for this DB instance.

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

    A name for the DB instance.

  • enable_performance_insights (Boolean, nil) (defaults to: nil)

    A value that indicates whether to enable Performance Insights for the DB Instance.

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

    The weekly time range (in UTC) during which system maintenance can occur.

  • removal_policy (AWSCDK::RemovalPolicy, nil) (defaults to: nil)

    The CloudFormation policy to apply when the instance is removed from the stack or replaced during an update.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'doc_db/database_instance_props.rb', line 16

def initialize(cluster:, instance_type:, auto_minor_version_upgrade: nil, availability_zone: nil, ca_certificate: nil, db_instance_name: nil, enable_performance_insights: nil, preferred_maintenance_window: nil, removal_policy: nil)
  @cluster = cluster
  Jsii::Type.check_type(@cluster, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19kb2NkYi5JREJDbHVzdGVyUmVmIn0=")), "cluster")
  @instance_type = instance_type
  Jsii::Type.check_type(@instance_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLkluc3RhbmNlVHlwZSJ9")), "instanceType")
  @auto_minor_version_upgrade = auto_minor_version_upgrade
  Jsii::Type.check_type(@auto_minor_version_upgrade, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "autoMinorVersionUpgrade") unless @auto_minor_version_upgrade.nil?
  @availability_zone = availability_zone
  Jsii::Type.check_type(@availability_zone, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "availabilityZone") unless @availability_zone.nil?
  @ca_certificate = ca_certificate
  Jsii::Type.check_type(@ca_certificate, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfcmRzLkNhQ2VydGlmaWNhdGUifQ==")), "caCertificate") unless @ca_certificate.nil?
  @db_instance_name = db_instance_name
  Jsii::Type.check_type(@db_instance_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "dbInstanceName") unless @db_instance_name.nil?
  @enable_performance_insights = enable_performance_insights
  Jsii::Type.check_type(@enable_performance_insights, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "enablePerformanceInsights") unless @enable_performance_insights.nil?
  @preferred_maintenance_window = preferred_maintenance_window
  Jsii::Type.check_type(@preferred_maintenance_window, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "preferredMaintenanceWindow") unless @preferred_maintenance_window.nil?
  @removal_policy = removal_policy
  Jsii::Type.check_type(@removal_policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZW1vdmFsUG9saWN5In0=")), "removalPolicy") unless @removal_policy.nil?
end

Instance Attribute Details

#auto_minor_version_upgradeBoolean? (readonly)

Note:

Default: true

Indicates that minor engine upgrades are applied automatically to the DB instance during the maintenance window.

Returns:

  • (Boolean, nil)


49
50
51
# File 'doc_db/database_instance_props.rb', line 49

def auto_minor_version_upgrade
  @auto_minor_version_upgrade
end

#availability_zoneString? (readonly)

Note:

Default: - no preference

The name of the Availability Zone where the DB instance will be located.

Returns:

  • (String, nil)


54
55
56
# File 'doc_db/database_instance_props.rb', line 54

def availability_zone
  @availability_zone
end

#ca_certificateAWSCDK::RDS::CaCertificate? (readonly)

Note:

Default: - DocumentDB will choose a certificate authority

The identifier of the CA certificate for this DB instance.

Specifying or updating this property triggers a reboot.



62
63
64
# File 'doc_db/database_instance_props.rb', line 62

def ca_certificate
  @ca_certificate
end

#clusterAWSCDK::Interfaces::AWSDocdb::IDBClusterRef (readonly)

The DocumentDB database cluster the instance should launch into.



40
41
42
# File 'doc_db/database_instance_props.rb', line 40

def cluster
  @cluster
end

#db_instance_nameString? (readonly)

Note:

Default: - a CloudFormation generated name

A name for the DB instance.

If you specify a name, AWS CloudFormation converts it to lowercase.

Returns:

  • (String, nil)


70
71
72
# File 'doc_db/database_instance_props.rb', line 70

def db_instance_name
  @db_instance_name
end

#enable_performance_insightsBoolean? (readonly)

Note:

Default: - false

A value that indicates whether to enable Performance Insights for the DB Instance.

Returns:

  • (Boolean, nil)


75
76
77
# File 'doc_db/database_instance_props.rb', line 75

def enable_performance_insights
  @enable_performance_insights
end

#instance_typeAWSCDK::EC2::InstanceType (readonly)

The name of the compute and memory capacity classes.



44
45
46
# File 'doc_db/database_instance_props.rb', line 44

def instance_type
  @instance_type
end

#preferred_maintenance_windowString? (readonly)

Note:

Default: - a 30-minute window selected at random from an 8-hour block of time for each AWS Region, occurring on a random day of the week. To see the time blocks available, see https://docs.aws.amazon.com/documentdb/latest/developerguide/db-instance-maintain.html#maintenance-window

The weekly time range (in UTC) during which system maintenance can occur.

Format: ddd:hh24:mi-ddd:hh24:mi Constraint: Minimum 30-minute window

Returns:

  • (String, nil)


83
84
85
# File 'doc_db/database_instance_props.rb', line 83

def preferred_maintenance_window
  @preferred_maintenance_window
end

#removal_policyAWSCDK::RemovalPolicy? (readonly)

Note:

Default: RemovalPolicy.Retain

The CloudFormation policy to apply when the instance is removed from the stack or replaced during an update.

Returns:



88
89
90
# File 'doc_db/database_instance_props.rb', line 88

def removal_policy
  @removal_policy
end

Class Method Details

.jsii_propertiesObject



90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'doc_db/database_instance_props.rb', line 90

def self.jsii_properties
  {
    :cluster => "cluster",
    :instance_type => "instanceType",
    :auto_minor_version_upgrade => "autoMinorVersionUpgrade",
    :availability_zone => "availabilityZone",
    :ca_certificate => "caCertificate",
    :db_instance_name => "dbInstanceName",
    :enable_performance_insights => "enablePerformanceInsights",
    :preferred_maintenance_window => "preferredMaintenanceWindow",
    :removal_policy => "removalPolicy",
  }
end

Instance Method Details

#to_jsiiObject



104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# File 'doc_db/database_instance_props.rb', line 104

def to_jsii
  result = {}
  result.merge!({
    "cluster" => @cluster,
    "instanceType" => @instance_type,
    "autoMinorVersionUpgrade" => @auto_minor_version_upgrade,
    "availabilityZone" => @availability_zone,
    "caCertificate" => @ca_certificate,
    "dbInstanceName" => @db_instance_name,
    "enablePerformanceInsights" => @enable_performance_insights,
    "preferredMaintenanceWindow" => @preferred_maintenance_window,
    "removalPolicy" => @removal_policy,
  })
  result.compact
end