Class: AWSCDK::RDS::InstanceProps
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::RDS::InstanceProps
- Defined in:
- rds/instance_props.rb
Overview
Instance properties for database instances.
Instance Attribute Summary collapse
-
#allow_major_version_upgrade ⇒ Boolean?
readonly
Whether to allow upgrade of major version for the DB instance.
-
#auto_minor_version_upgrade ⇒ Boolean?
readonly
Whether to enable automatic upgrade of minor version for the DB instance.
-
#delete_automated_backups ⇒ Boolean?
readonly
Whether to remove automated backups immediately after the DB instance is deleted for the DB instance.
-
#enable_performance_insights ⇒ Boolean?
readonly
Whether to enable Performance Insights for the DB instance.
-
#instance_type ⇒ AWSCDK::EC2::InstanceType?
readonly
What type of instance to start for the replicas.
-
#parameter_group ⇒ AWSCDK::RDS::IParameterGroup?
readonly
The DB parameter group to associate with the instance.
-
#parameters ⇒ Hash{String => String}?
readonly
The parameters in the DBParameterGroup to create automatically.
-
#performance_insight_encryption_key ⇒ AWSCDK::KMS::IKey?
readonly
The AWS KMS key for encryption of Performance Insights data.
-
#performance_insight_retention ⇒ AWSCDK::RDS::PerformanceInsightRetention?
readonly
The amount of time, in days, to retain Performance Insights data.
-
#preferred_maintenance_window ⇒ String?
readonly
A preferred maintenance window day/time range.
-
#publicly_accessible ⇒ Boolean?
readonly
Indicates whether the DB instance is an internet-facing instance.
-
#security_groups ⇒ Array<AWSCDK::EC2::ISecurityGroup>?
readonly
Security group.
-
#vpc ⇒ AWSCDK::EC2::IVPC
readonly
What subnets to run the RDS instances in.
-
#vpc_subnets ⇒ AWSCDK::EC2::SubnetSelection?
readonly
Where to place the instances within the VPC.
Class Method Summary collapse
Instance Method Summary collapse
-
#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
constructor
A new instance of InstanceProps.
- #to_jsii ⇒ Object
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.
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_upgrade ⇒ Boolean? (readonly)
Default: - false
Whether to allow upgrade of major version for the DB instance.
62 63 64 |
# File 'rds/instance_props.rb', line 62 def allow_major_version_upgrade @allow_major_version_upgrade end |
#auto_minor_version_upgrade ⇒ Boolean? (readonly)
Default: - true
Whether to enable automatic upgrade of minor version for the DB instance.
67 68 69 |
# File 'rds/instance_props.rb', line 67 def auto_minor_version_upgrade @auto_minor_version_upgrade end |
#delete_automated_backups ⇒ Boolean? (readonly)
Default: - true
Whether to remove automated backups immediately after the DB instance is deleted for the DB instance.
72 73 74 |
# File 'rds/instance_props.rb', line 72 def delete_automated_backups @delete_automated_backups end |
#enable_performance_insights ⇒ Boolean? (readonly)
Default: - false, unless performanceInsightRetention or performanceInsightEncryptionKey is set.
Whether to enable Performance Insights for the DB instance.
77 78 79 |
# File 'rds/instance_props.rb', line 77 def enable_performance_insights @enable_performance_insights end |
#instance_type ⇒ AWSCDK::EC2::InstanceType? (readonly)
Default: - t3.medium (or, more precisely, db.t3.medium)
What type of instance to start for the replicas.
82 83 84 |
# File 'rds/instance_props.rb', line 82 def instance_type @instance_type end |
#parameter_group ⇒ AWSCDK::RDS::IParameterGroup? (readonly)
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 |
#parameters ⇒ Hash{String => String}? (readonly)
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.
95 96 97 |
# File 'rds/instance_props.rb', line 95 def parameters @parameters end |
#performance_insight_encryption_key ⇒ AWSCDK::KMS::IKey? (readonly)
Default: - default master key
The AWS KMS key for encryption of Performance Insights data.
100 101 102 |
# File 'rds/instance_props.rb', line 100 def performance_insight_encryption_key @performance_insight_encryption_key end |
#performance_insight_retention ⇒ AWSCDK::RDS::PerformanceInsightRetention? (readonly)
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_window ⇒ String? (readonly)
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_accessible ⇒ Boolean? (readonly)
Default: - true if vpcSubnets is subnetType: SubnetType.PUBLIC, false otherwise
Indicates whether the DB instance is an internet-facing instance.
118 119 120 |
# File 'rds/instance_props.rb', line 118 def publicly_accessible @publicly_accessible end |
#security_groups ⇒ Array<AWSCDK::EC2::ISecurityGroup>? (readonly)
Default: a new security group is created.
Security group.
123 124 125 |
# File 'rds/instance_props.rb', line 123 def security_groups @security_groups end |
#vpc ⇒ AWSCDK::EC2::IVPC (readonly)
What subnets to run the RDS instances in.
Must be at least 2 subnets in two different AZs.
57 58 59 |
# File 'rds/instance_props.rb', line 57 def vpc @vpc end |
#vpc_subnets ⇒ AWSCDK::EC2::SubnetSelection? (readonly)
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_properties ⇒ Object
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_jsii ⇒ Object
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 |