CfnDatabaseProps

class aws_cdk.aws_lightsail.CfnDatabaseProps(*, master_database_name, master_username, relational_database_blueprint_id, relational_database_bundle_id, relational_database_name, availability_zone=None, backup_retention=None, ca_certificate_identifier=None, master_user_password=None, preferred_backup_window=None, preferred_maintenance_window=None, publicly_accessible=None, relational_database_parameters=None, rotate_master_user_password=None, tags=None)

Bases: object

Properties for defining a CfnDatabase.

Parameters:
  • master_database_name (str) – 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 .

  • master_username (str) –

    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 .

  • relational_database_blueprint_id (str) – The blueprint ID for the database (for example, mysql_8_0 ).

  • relational_database_bundle_id (str) – The bundle ID for the database (for example, medium_1_0 ).

  • relational_database_name (str) – The name of the instance.

  • availability_zone (Optional[str]) – The Availability Zone for the database.

  • backup_retention (Union[bool, IResolvable, None]) – 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 .

  • ca_certificate_identifier (Optional[str]) – The certificate associated with the database.

  • master_user_password (Optional[str]) – The password for the primary user of the database. The password can include any printable ASCII character except the following: /, “, or

  • preferred_backup_window (Optional[str]) – The daily time range during which automated backups are created for the database (for example, 16:00-16:30 ).

  • preferred_maintenance_window (Optional[str]) – 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 .

  • publicly_accessible (Union[bool, IResolvable, None]) – A Boolean value indicating whether the database is accessible to anyone on the internet.

  • relational_database_parameters (Union[IResolvable, Sequence[Union[IResolvable, RelationalDatabaseParameterProperty, Dict[str, Any]]], None]) – An array of parameters for the database.

  • rotate_master_user_password (Union[bool, IResolvable, None]) – A Boolean value indicating whether to change the primary user password to a new, strong password generated by Lightsail . .. epigraph:: The RotateMasterUserPassword and MasterUserPassword parameters cannot be used together in the same template.

  • tags (Optional[Sequence[Union[CfnTag, Dict[str, Any]]]]) – An array of key-value pairs to apply to this resource. For more information, see Tag in the AWS CloudFormation User Guide . .. epigraph:: The Value of Tags is optional for Lightsail resources.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-database.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_lightsail as lightsail

cfn_database_props = lightsail.CfnDatabaseProps(
    master_database_name="masterDatabaseName",
    master_username="masterUsername",
    relational_database_blueprint_id="relationalDatabaseBlueprintId",
    relational_database_bundle_id="relationalDatabaseBundleId",
    relational_database_name="relationalDatabaseName",

    # the properties below are optional
    availability_zone="availabilityZone",
    backup_retention=False,
    ca_certificate_identifier="caCertificateIdentifier",
    master_user_password="masterUserPassword",
    preferred_backup_window="preferredBackupWindow",
    preferred_maintenance_window="preferredMaintenanceWindow",
    publicly_accessible=False,
    relational_database_parameters=[lightsail.CfnDatabase.RelationalDatabaseParameterProperty(
        allowed_values="allowedValues",
        apply_method="applyMethod",
        apply_type="applyType",
        data_type="dataType",
        description="description",
        is_modifiable=False,
        parameter_name="parameterName",
        parameter_value="parameterValue"
    )],
    rotate_master_user_password=False,
    tags=[CfnTag(
        key="key",
        value="value"
    )]
)

Attributes

availability_zone

The Availability Zone for the database.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-database.html#cfn-lightsail-database-availabilityzone

backup_retention

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 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-database.html#cfn-lightsail-database-backupretention

ca_certificate_identifier

The certificate associated with the database.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-database.html#cfn-lightsail-database-cacertificateidentifier

master_database_name

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 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-database.html#cfn-lightsail-database-masterdatabasename

master_user_password

The password for the primary user of the database.

The password can include any printable ASCII character except the following: /, “, or

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-database.html#cfn-lightsail-database-masteruserpassword

. It cannot contain spaces.
.. epigraph::

The MasterUserPassword and RotateMasterUserPassword parameters cannot be used together in the same template.

MySQL

Constraints: Must contain 8-41 characters.

PostgreSQL

Constraints: Must contain 8-128 characters.

master_username

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 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-database.html#cfn-lightsail-database-masterusername

preferred_backup_window

The daily time range during which automated backups are created for the database (for example, 16:00-16:30 ).

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-database.html#cfn-lightsail-database-preferredbackupwindow

preferred_maintenance_window

ddd:hh24:mi-ddd:hh24:mi .

For example, Tue:17:00-Tue:17:30 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-database.html#cfn-lightsail-database-preferredmaintenancewindow

Type:

The weekly time range during which system maintenance can occur for the database, formatted as follows

publicly_accessible

A Boolean value indicating whether the database is accessible to anyone on the internet.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-database.html#cfn-lightsail-database-publiclyaccessible

relational_database_blueprint_id

The blueprint ID for the database (for example, mysql_8_0 ).

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-database.html#cfn-lightsail-database-relationaldatabaseblueprintid

relational_database_bundle_id

The bundle ID for the database (for example, medium_1_0 ).

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-database.html#cfn-lightsail-database-relationaldatabasebundleid

relational_database_name

The name of the instance.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-database.html#cfn-lightsail-database-relationaldatabasename

relational_database_parameters

An array of parameters for the database.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-database.html#cfn-lightsail-database-relationaldatabaseparameters

rotate_master_user_password

A Boolean value indicating whether to change the primary user password to a new, strong password generated by Lightsail .

The RotateMasterUserPassword and MasterUserPassword parameters cannot be used together in the same template.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-database.html#cfn-lightsail-database-rotatemasteruserpassword

tags

An array of key-value pairs to apply to this resource.

For more information, see Tag in the AWS CloudFormation User Guide . .. epigraph:

The ``Value`` of ``Tags`` is optional for Lightsail resources.
See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-database.html#cfn-lightsail-database-tags