Class: AWSCDK::RDS::InstanceProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
rds/instance_props.rb

Overview

Instance properties for database instances.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(vpc:, allow_major_version_upgrade: nil, auto_minor_version_upgrade: nil, delete_automated_backups: nil, enable_performance_insights: nil, instance_type: nil, parameter_group: nil, parameters: nil, performance_insight_encryption_key: nil, performance_insight_retention: nil, preferred_maintenance_window: nil, publicly_accessible: nil, security_groups: nil, vpc_subnets: nil) ⇒ InstanceProps

Returns a new instance of InstanceProps.

Parameters:

  • vpc (AWSCDK::EC2::IVPC)

    What subnets to run the RDS instances in.

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

    Whether to allow upgrade of major version for the DB instance.

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

    Whether to enable automatic upgrade of minor version for the DB instance.

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

    Whether to remove automated backups immediately after the DB instance is deleted for the DB instance.

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

    Whether to enable Performance Insights for the DB instance.

  • instance_type (AWSCDK::EC2::InstanceType, nil) (defaults to: nil)

    What type of instance to start for the replicas.

  • parameter_group (AWSCDK::RDS::IParameterGroup, nil) (defaults to: nil)

    The DB parameter group to associate with the instance.

  • parameters (Hash{String => String}, nil) (defaults to: nil)

    The parameters in the DBParameterGroup to create automatically.

  • performance_insight_encryption_key (AWSCDK::KMS::IKey, nil) (defaults to: nil)

    The AWS KMS key for encryption of Performance Insights data.

  • performance_insight_retention (AWSCDK::RDS::PerformanceInsightRetention, nil) (defaults to: nil)

    The amount of time, in days, to retain Performance Insights data.

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

    A preferred maintenance window day/time range. Should be specified as a range ddd:hh24:mi-ddd:hh24:mi (24H Clock UTC).

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

    Indicates whether the DB instance is an internet-facing instance.

  • security_groups (Array<AWSCDK::EC2::ISecurityGroup>, nil) (defaults to: nil)

    Security group.

  • vpc_subnets (AWSCDK::EC2::SubnetSelection, nil) (defaults to: nil)

    Where to place the instances within the VPC.



21
22
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
# File 'rds/instance_props.rb', line 21

def initialize(vpc:, allow_major_version_upgrade: nil, auto_minor_version_upgrade: nil, delete_automated_backups: nil, enable_performance_insights: nil, instance_type: nil, parameter_group: nil, parameters: nil, performance_insight_encryption_key: nil, performance_insight_retention: nil, preferred_maintenance_window: nil, publicly_accessible: nil, security_groups: nil, vpc_subnets: nil)
  @vpc = vpc
  Jsii::Type.check_type(@vpc, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLklWcGMifQ==")), "vpc")
  @allow_major_version_upgrade = allow_major_version_upgrade
  Jsii::Type.check_type(@allow_major_version_upgrade, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "allowMajorVersionUpgrade") unless @allow_major_version_upgrade.nil?
  @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?
  @delete_automated_backups = delete_automated_backups
  Jsii::Type.check_type(@delete_automated_backups, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "deleteAutomatedBackups") unless @delete_automated_backups.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?
  @instance_type = instance_type
  Jsii::Type.check_type(@instance_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLkluc3RhbmNlVHlwZSJ9")), "instanceType") unless @instance_type.nil?
  @parameter_group = parameter_group
  Jsii::Type.check_type(@parameter_group, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfcmRzLklQYXJhbWV0ZXJHcm91cCJ9")), "parameterGroup") unless @parameter_group.nil?
  @parameters = parameters
  Jsii::Type.check_type(@parameters, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "parameters") unless @parameters.nil?
  @performance_insight_encryption_key = performance_insight_encryption_key
  Jsii::Type.check_type(@performance_insight_encryption_key, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfa21zLklLZXkifQ==")), "performanceInsightEncryptionKey") unless @performance_insight_encryption_key.nil?
  @performance_insight_retention = performance_insight_retention
  Jsii::Type.check_type(@performance_insight_retention, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfcmRzLlBlcmZvcm1hbmNlSW5zaWdodFJldGVudGlvbiJ9")), "performanceInsightRetention") unless @performance_insight_retention.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?
  @publicly_accessible = publicly_accessible
  Jsii::Type.check_type(@publicly_accessible, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "publiclyAccessible") unless @publicly_accessible.nil?
  @security_groups = security_groups
  Jsii::Type.check_type(@security_groups, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuSVNlY3VyaXR5R3JvdXAifSwia2luZCI6ImFycmF5In19")), "securityGroups") unless @security_groups.nil?
  @vpc_subnets = vpc_subnets.is_a?(Hash) ? ::AWSCDK::EC2::SubnetSelection.new(**vpc_subnets.transform_keys(&:to_sym)) : vpc_subnets
  Jsii::Type.check_type(@vpc_subnets, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLlN1Ym5ldFNlbGVjdGlvbiJ9")), "vpcSubnets") unless @vpc_subnets.nil?
end

Instance Attribute Details

#allow_major_version_upgradeBoolean? (readonly)

Note:

Default: - false

Whether to allow upgrade of major version for the DB instance.

Returns:

  • (Boolean, nil)


62
63
64
# File 'rds/instance_props.rb', line 62

def allow_major_version_upgrade
  @allow_major_version_upgrade
end

#auto_minor_version_upgradeBoolean? (readonly)

Note:

Default: - true

Whether to enable automatic upgrade of minor version for the DB instance.

Returns:

  • (Boolean, nil)


67
68
69
# File 'rds/instance_props.rb', line 67

def auto_minor_version_upgrade
  @auto_minor_version_upgrade
end

#delete_automated_backupsBoolean? (readonly)

Note:

Default: - true

Whether to remove automated backups immediately after the DB instance is deleted for the DB instance.

Returns:

  • (Boolean, nil)


72
73
74
# File 'rds/instance_props.rb', line 72

def delete_automated_backups
  @delete_automated_backups
end

#enable_performance_insightsBoolean? (readonly)

Note:

Default: - false, unless performanceInsightRetention or performanceInsightEncryptionKey is set.

Whether to enable Performance Insights for the DB instance.

Returns:

  • (Boolean, nil)


77
78
79
# File 'rds/instance_props.rb', line 77

def enable_performance_insights
  @enable_performance_insights
end

#instance_typeAWSCDK::EC2::InstanceType? (readonly)

Note:

Default: - t3.medium (or, more precisely, db.t3.medium)

What type of instance to start for the replicas.

Returns:



82
83
84
# File 'rds/instance_props.rb', line 82

def instance_type
  @instance_type
end

#parameter_groupAWSCDK::RDS::IParameterGroup? (readonly)

Note:

Default: no parameter group

The DB parameter group to associate with the instance.



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

def parameter_group
  @parameter_group
end

#parametersHash{String => String}? (readonly)

Note:

Default: - None

The parameters in the DBParameterGroup to create automatically.

You can only specify parameterGroup or parameters but not both. You need to use a versioned engine to auto-generate a DBParameterGroup.

Returns:

  • (Hash{String => String}, nil)


95
96
97
# File 'rds/instance_props.rb', line 95

def parameters
  @parameters
end

#performance_insight_encryption_keyAWSCDK::KMS::IKey? (readonly)

Note:

Default: - default master key

The AWS KMS key for encryption of Performance Insights data.

Returns:



100
101
102
# File 'rds/instance_props.rb', line 100

def performance_insight_encryption_key
  @performance_insight_encryption_key
end

#performance_insight_retentionAWSCDK::RDS::PerformanceInsightRetention? (readonly)

Note:

Default: 7

The amount of time, in days, to retain Performance Insights data.



105
106
107
# File 'rds/instance_props.rb', line 105

def performance_insight_retention
  @performance_insight_retention
end

#preferred_maintenance_windowString? (readonly)

Note:

Default: - 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.

A preferred maintenance window day/time range. Should be specified as a range ddd:hh24:mi-ddd:hh24:mi (24H Clock UTC).

Example: 'Sun:23:45-Mon:00:15'



113
114
115
# File 'rds/instance_props.rb', line 113

def preferred_maintenance_window
  @preferred_maintenance_window
end

#publicly_accessibleBoolean? (readonly)

Note:

Default: - true if vpcSubnets is subnetType: SubnetType.PUBLIC, false otherwise

Indicates whether the DB instance is an internet-facing instance.

Returns:

  • (Boolean, nil)


118
119
120
# File 'rds/instance_props.rb', line 118

def publicly_accessible
  @publicly_accessible
end

#security_groupsArray<AWSCDK::EC2::ISecurityGroup>? (readonly)

Note:

Default: a new security group is created.

Security group.

Returns:



123
124
125
# File 'rds/instance_props.rb', line 123

def security_groups
  @security_groups
end

#vpcAWSCDK::EC2::IVPC (readonly)

What subnets to run the RDS instances in.

Must be at least 2 subnets in two different AZs.

Returns:



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

def vpc
  @vpc
end

#vpc_subnetsAWSCDK::EC2::SubnetSelection? (readonly)

Note:

Default: - the Vpc default strategy if not specified.

Where to place the instances within the VPC.



128
129
130
# File 'rds/instance_props.rb', line 128

def vpc_subnets
  @vpc_subnets
end

Class Method Details

.jsii_propertiesObject



130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# File 'rds/instance_props.rb', line 130

def self.jsii_properties
  {
    :vpc => "vpc",
    :allow_major_version_upgrade => "allowMajorVersionUpgrade",
    :auto_minor_version_upgrade => "autoMinorVersionUpgrade",
    :delete_automated_backups => "deleteAutomatedBackups",
    :enable_performance_insights => "enablePerformanceInsights",
    :instance_type => "instanceType",
    :parameter_group => "parameterGroup",
    :parameters => "parameters",
    :performance_insight_encryption_key => "performanceInsightEncryptionKey",
    :performance_insight_retention => "performanceInsightRetention",
    :preferred_maintenance_window => "preferredMaintenanceWindow",
    :publicly_accessible => "publiclyAccessible",
    :security_groups => "securityGroups",
    :vpc_subnets => "vpcSubnets",
  }
end

Instance Method Details

#to_jsiiObject



149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
# File 'rds/instance_props.rb', line 149

def to_jsii
  result = {}
  result.merge!({
    "vpc" => @vpc,
    "allowMajorVersionUpgrade" => @allow_major_version_upgrade,
    "autoMinorVersionUpgrade" => @auto_minor_version_upgrade,
    "deleteAutomatedBackups" => @delete_automated_backups,
    "enablePerformanceInsights" => @enable_performance_insights,
    "instanceType" => @instance_type,
    "parameterGroup" => @parameter_group,
    "parameters" => @parameters,
    "performanceInsightEncryptionKey" => @performance_insight_encryption_key,
    "performanceInsightRetention" => @performance_insight_retention,
    "preferredMaintenanceWindow" => @preferred_maintenance_window,
    "publiclyAccessible" => @publicly_accessible,
    "securityGroups" => @security_groups,
    "vpcSubnets" => @vpc_subnets,
  })
  result.compact
end