Class: AWSCDK::Lightsail::CfnDatabaseProps
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::Lightsail::CfnDatabaseProps
- Defined in:
- lightsail/cfn_database_props.rb
Overview
Properties for defining a CfnDatabase.
Instance Attribute Summary collapse
-
#availability_zone ⇒ String?
readonly
The Availability Zone for the database.
-
#backup_retention ⇒ Boolean, ...
readonly
A Boolean value indicating whether automated backup retention is enabled for the database.
-
#ca_certificate_identifier ⇒ String?
readonly
The certificate associated with the database.
-
#master_database_name ⇒ String
readonly
The meaning of this parameter differs according to the database engine you use.
-
#master_user_password ⇒ String?
readonly
The password for the primary user of the database.
-
#master_username ⇒ String
readonly
The name for the primary user.
-
#preferred_backup_window ⇒ String?
readonly
The daily time range during which automated backups are created for the database (for example,
16:00-16:30). -
#preferred_maintenance_window ⇒ String?
readonly
The weekly time range during which system maintenance can occur for the database, formatted as follows:
ddd:hh24:mi-ddd:hh24:mi. -
#publicly_accessible ⇒ Boolean, ...
readonly
A Boolean value indicating whether the database is accessible to anyone on the internet.
-
#relational_database_blueprint_id ⇒ String
readonly
The blueprint ID for the database (for example,
mysql_8_0). -
#relational_database_bundle_id ⇒ String
readonly
The bundle ID for the database (for example,
medium_1_0). -
#relational_database_name ⇒ String
readonly
The name of the instance.
-
#relational_database_parameters ⇒ AWSCDK::IResolvable, ...
readonly
An array of parameters for the database.
-
#rotate_master_user_password ⇒ Boolean, ...
readonly
A Boolean value indicating whether to change the primary user password to a new, strong password generated by Lightsail .
-
#tags ⇒ Array<AWSCDK::CfnTag>?
readonly
An array of key-value pairs to apply to this resource.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(master_database_name:, master_username:, relational_database_blueprint_id:, relational_database_bundle_id:, relational_database_name:, availability_zone: nil, backup_retention: nil, ca_certificate_identifier: nil, master_user_password: nil, preferred_backup_window: nil, preferred_maintenance_window: nil, publicly_accessible: nil, relational_database_parameters: nil, rotate_master_user_password: nil, tags: nil) ⇒ CfnDatabaseProps
constructor
A new instance of CfnDatabaseProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(master_database_name:, master_username:, relational_database_blueprint_id:, relational_database_bundle_id:, relational_database_name:, availability_zone: nil, backup_retention: nil, ca_certificate_identifier: nil, master_user_password: nil, preferred_backup_window: nil, preferred_maintenance_window: nil, publicly_accessible: nil, relational_database_parameters: nil, rotate_master_user_password: nil, tags: nil) ⇒ CfnDatabaseProps
Returns a new instance of CfnDatabaseProps.
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 51 52 53 54 55 |
# File 'lightsail/cfn_database_props.rb', line 24 def initialize(master_database_name:, master_username:, relational_database_blueprint_id:, relational_database_bundle_id:, relational_database_name:, availability_zone: nil, backup_retention: nil, ca_certificate_identifier: nil, master_user_password: nil, preferred_backup_window: nil, preferred_maintenance_window: nil, publicly_accessible: nil, relational_database_parameters: nil, rotate_master_user_password: nil, tags: nil) @master_database_name = master_database_name Jsii::Type.check_type(@master_database_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "masterDatabaseName") @master_username = master_username Jsii::Type.check_type(@master_username, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "masterUsername") @relational_database_blueprint_id = relational_database_blueprint_id Jsii::Type.check_type(@relational_database_blueprint_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "relationalDatabaseBlueprintId") @relational_database_bundle_id = relational_database_bundle_id Jsii::Type.check_type(@relational_database_bundle_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "relationalDatabaseBundleId") @relational_database_name = relational_database_name Jsii::Type.check_type(@relational_database_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "relationalDatabaseName") @availability_zone = availability_zone Jsii::Type.check_type(@availability_zone, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "availabilityZone") unless @availability_zone.nil? @backup_retention = backup_retention Jsii::Type.check_type(@backup_retention, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "backupRetention") unless @backup_retention.nil? @ca_certificate_identifier = ca_certificate_identifier Jsii::Type.check_type(@ca_certificate_identifier, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "caCertificateIdentifier") unless @ca_certificate_identifier.nil? @master_user_password = master_user_password Jsii::Type.check_type(@master_user_password, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "masterUserPassword") unless @master_user_password.nil? @preferred_backup_window = preferred_backup_window Jsii::Type.check_type(@preferred_backup_window, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "preferredBackupWindow") unless @preferred_backup_window.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("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "publiclyAccessible") unless @publicly_accessible.nil? @relational_database_parameters = relational_database_parameters Jsii::Type.check_type(@relational_database_parameters, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbGlnaHRzYWlsLkNmbkRhdGFiYXNlLlJlbGF0aW9uYWxEYXRhYmFzZVBhcmFtZXRlclByb3BlcnR5In1dfX0sImtpbmQiOiJhcnJheSJ9fV19fQ==")), "relationalDatabaseParameters") unless @relational_database_parameters.nil? @rotate_master_user_password = rotate_master_user_password Jsii::Type.check_type(@rotate_master_user_password, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "rotateMasterUserPassword") unless @rotate_master_user_password.nil? @tags = .is_a?(Array) ? .map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CfnTag.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLkNmblRhZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "tags") unless @tags.nil? end |
Instance Attribute Details
#availability_zone ⇒ String? (readonly)
The Availability Zone for the database.
132 133 134 |
# File 'lightsail/cfn_database_props.rb', line 132 def availability_zone @availability_zone end |
#backup_retention ⇒ Boolean, ... (readonly)
A Boolean value indicating whether automated backup retention is enabled for the database.
Data Import Mode is enabled when BackupRetention is set to false , and is disabled when BackupRetention is set to true .
139 140 141 |
# File 'lightsail/cfn_database_props.rb', line 139 def backup_retention @backup_retention end |
#ca_certificate_identifier ⇒ String? (readonly)
The certificate associated with the database.
144 145 146 |
# File 'lightsail/cfn_database_props.rb', line 144 def ca_certificate_identifier @ca_certificate_identifier end |
#master_database_name ⇒ String (readonly)
The meaning of this parameter differs according to the database engine you use.
MySQL
The name of the database to create when the Lightsail database resource is created. If this parameter isn't specified, no database is created in the database resource.
Constraints:
- Must contain 1-64 letters or numbers.
- Must begin with a letter. Subsequent characters can be letters, underscores, or numbers (0-9).
- Can't be a word reserved by the specified database engine.
For more information about reserved words in MySQL, see the Keywords and Reserved Words articles for MySQL 5.6 , MySQL 5.7 , and MySQL 8.0 .
PostgreSQL
The name of the database to create when the Lightsail database resource is created. If this parameter isn't specified, a database named postgres is created in the database resource.
Constraints:
- Must contain 1-63 letters or numbers.
- Must begin with a letter. Subsequent characters can be letters, underscores, or numbers (0-9).
- Can't be a word reserved by the specified database engine.
For more information about reserved words in PostgreSQL, see the SQL Key Words articles for PostgreSQL 9.6 , PostgreSQL 10 , PostgreSQL 11 , and PostgreSQL 12 .
85 86 87 |
# File 'lightsail/cfn_database_props.rb', line 85 def master_database_name @master_database_name end |
#master_user_password ⇒ String? (readonly)
The password for the primary user of the database.
The password can include any printable ASCII character except the following: /, ", or
151 152 153 |
# File 'lightsail/cfn_database_props.rb', line 151 def master_user_password @master_user_password end |
#master_username ⇒ String (readonly)
The name for the primary user.
MySQL
Constraints:
- Required for MySQL.
- Must be 1-16 letters or numbers. Can contain underscores.
- First character must be a letter.
- Can't be a reserved word for the chosen database engine.
For more information about reserved words in MySQL 5.6 or 5.7, see the Keywords and Reserved Words articles for MySQL 5.6 , MySQL 5.7 , or MySQL 8.0 .
PostgreSQL
Constraints:
- Required for PostgreSQL.
- Must be 1-63 letters or numbers. Can contain underscores.
- First character must be a letter.
- Can't be a reserved word for the chosen database engine.
For more information about reserved words in MySQL 5.6 or 5.7, see the Keywords and Reserved Words articles for PostgreSQL 9.6 , PostgreSQL 10 , PostgreSQL 11 , and PostgreSQL 12 .
112 113 114 |
# File 'lightsail/cfn_database_props.rb', line 112 def master_username @master_username end |
#preferred_backup_window ⇒ String? (readonly)
The daily time range during which automated backups are created for the database (for example, 16:00-16:30 ).
156 157 158 |
# File 'lightsail/cfn_database_props.rb', line 156 def preferred_backup_window @preferred_backup_window end |
#preferred_maintenance_window ⇒ String? (readonly)
The weekly time range during which system maintenance can occur for the database, formatted as follows: ddd:hh24:mi-ddd:hh24:mi .
For example, Tue:17:00-Tue:17:30 .
163 164 165 |
# File 'lightsail/cfn_database_props.rb', line 163 def preferred_maintenance_window @preferred_maintenance_window end |
#publicly_accessible ⇒ Boolean, ... (readonly)
A Boolean value indicating whether the database is accessible to anyone on the internet.
168 169 170 |
# File 'lightsail/cfn_database_props.rb', line 168 def publicly_accessible @publicly_accessible end |
#relational_database_blueprint_id ⇒ String (readonly)
The blueprint ID for the database (for example, mysql_8_0 ).
117 118 119 |
# File 'lightsail/cfn_database_props.rb', line 117 def relational_database_blueprint_id @relational_database_blueprint_id end |
#relational_database_bundle_id ⇒ String (readonly)
The bundle ID for the database (for example, medium_1_0 ).
122 123 124 |
# File 'lightsail/cfn_database_props.rb', line 122 def relational_database_bundle_id @relational_database_bundle_id end |
#relational_database_name ⇒ String (readonly)
The name of the instance.
127 128 129 |
# File 'lightsail/cfn_database_props.rb', line 127 def relational_database_name @relational_database_name end |
#relational_database_parameters ⇒ AWSCDK::IResolvable, ... (readonly)
An array of parameters for the database.
173 174 175 |
# File 'lightsail/cfn_database_props.rb', line 173 def relational_database_parameters @relational_database_parameters end |
#rotate_master_user_password ⇒ Boolean, ... (readonly)
A Boolean value indicating whether to change the primary user password to a new, strong password generated by Lightsail .
The
RotateMasterUserPasswordandMasterUserPasswordparameters cannot be used together in the same template.
180 181 182 |
# File 'lightsail/cfn_database_props.rb', line 180 def rotate_master_user_password @rotate_master_user_password end |
#tags ⇒ Array<AWSCDK::CfnTag>? (readonly)
An array of key-value pairs to apply to this resource.
For more information, see Tag in the AWS CloudFormation User Guide .
The
ValueofTagsis optional for Lightsail resources.
189 190 191 |
# File 'lightsail/cfn_database_props.rb', line 189 def @tags end |
Class Method Details
.jsii_properties ⇒ Object
191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 |
# File 'lightsail/cfn_database_props.rb', line 191 def self.jsii_properties { :master_database_name => "masterDatabaseName", :master_username => "masterUsername", :relational_database_blueprint_id => "relationalDatabaseBlueprintId", :relational_database_bundle_id => "relationalDatabaseBundleId", :relational_database_name => "relationalDatabaseName", :availability_zone => "availabilityZone", :backup_retention => "backupRetention", :ca_certificate_identifier => "caCertificateIdentifier", :master_user_password => "masterUserPassword", :preferred_backup_window => "preferredBackupWindow", :preferred_maintenance_window => "preferredMaintenanceWindow", :publicly_accessible => "publiclyAccessible", :relational_database_parameters => "relationalDatabaseParameters", :rotate_master_user_password => "rotateMasterUserPassword", :tags => "tags", } end |
Instance Method Details
#to_jsii ⇒ Object
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 |
# File 'lightsail/cfn_database_props.rb', line 211 def to_jsii result = {} result.merge!({ "masterDatabaseName" => @master_database_name, "masterUsername" => @master_username, "relationalDatabaseBlueprintId" => @relational_database_blueprint_id, "relationalDatabaseBundleId" => @relational_database_bundle_id, "relationalDatabaseName" => @relational_database_name, "availabilityZone" => @availability_zone, "backupRetention" => @backup_retention, "caCertificateIdentifier" => @ca_certificate_identifier, "masterUserPassword" => @master_user_password, "preferredBackupWindow" => @preferred_backup_window, "preferredMaintenanceWindow" => @preferred_maintenance_window, "publiclyAccessible" => @publicly_accessible, "relationalDatabaseParameters" => @relational_database_parameters, "rotateMasterUserPassword" => @rotate_master_user_password, "tags" => @tags, }) result.compact end |