aws-cdk-lib.aws_lightsail.CfnDatabaseProps

interface CfnDatabaseProps

LanguageType name
.NETAmazon.CDK.AWS.Lightsail.CfnDatabaseProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awslightsail#CfnDatabaseProps
Javasoftware.amazon.awscdk.services.lightsail.CfnDatabaseProps
Pythonaws_cdk.aws_lightsail.CfnDatabaseProps
TypeScript aws-cdk-lib » aws_lightsail » CfnDatabaseProps

Properties for defining a CfnDatabase.

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_lightsail as lightsail } from 'aws-cdk-lib';
const cfnDatabaseProps: lightsail.CfnDatabaseProps = {
  masterDatabaseName: 'masterDatabaseName',
  masterUsername: 'masterUsername',
  relationalDatabaseBlueprintId: 'relationalDatabaseBlueprintId',
  relationalDatabaseBundleId: 'relationalDatabaseBundleId',
  relationalDatabaseName: 'relationalDatabaseName',

  // the properties below are optional
  availabilityZone: 'availabilityZone',
  backupRetention: false,
  caCertificateIdentifier: 'caCertificateIdentifier',
  masterUserPassword: 'masterUserPassword',
  preferredBackupWindow: 'preferredBackupWindow',
  preferredMaintenanceWindow: 'preferredMaintenanceWindow',
  publiclyAccessible: false,
  relationalDatabaseParameters: [{
    allowedValues: 'allowedValues',
    applyMethod: 'applyMethod',
    applyType: 'applyType',
    dataType: 'dataType',
    description: 'description',
    isModifiable: false,
    parameterName: 'parameterName',
    parameterValue: 'parameterValue',
  }],
  rotateMasterUserPassword: false,
  tags: [{
    key: 'key',
    value: 'value',
  }],
};

Properties

NameTypeDescription
masterDatabaseNamestringThe meaning of this parameter differs according to the database engine you use.
masterUsernamestringThe name for the primary user.
relationalDatabaseBlueprintIdstringThe blueprint ID for the database (for example, mysql_8_0 ).
relationalDatabaseBundleIdstringThe bundle ID for the database (for example, medium_1_0 ).
relationalDatabaseNamestringThe name of the instance.
availabilityZone?stringThe Availability Zone for the database.
backupRetention?boolean | IResolvableA Boolean value indicating whether automated backup retention is enabled for the database.
caCertificateIdentifier?stringThe certificate associated with the database.
masterUserPassword?stringThe password for the primary user of the database.
preferredBackupWindow?stringThe daily time range during which automated backups are created for the database (for example, 16:00-16:30 ).
preferredMaintenanceWindow?stringThe weekly time range during which system maintenance can occur for the database, formatted as follows: ddd:hh24:mi-ddd:hh24:mi .
publiclyAccessible?boolean | IResolvableA Boolean value indicating whether the database is accessible to anyone on the internet.
relationalDatabaseParameters?IResolvable | IResolvable | RelationalDatabaseParameterProperty[]An array of parameters for the database.
rotateMasterUserPassword?boolean | IResolvableA Boolean value indicating whether to change the primary user password to a new, strong password generated by Lightsail .
tags?CfnTag[]An array of key-value pairs to apply to this resource.

masterDatabaseName

Type: string

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 .


masterUsername

Type: string

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 .


relationalDatabaseBlueprintId

Type: string

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


relationalDatabaseBundleId

Type: string

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


relationalDatabaseName

Type: string

The name of the instance.


availabilityZone?

Type: string (optional)

The Availability Zone for the database.


backupRetention?

Type: boolean | IResolvable (optional)

A Boolean value indicating whether automated backup retention is enabled for the database.


caCertificateIdentifier?

Type: string (optional)

The certificate associated with the database.


masterUserPassword?

Type: string (optional)

The password for the primary user of the database.

The password can include any printable ASCII character except the following: /, ", or @. It cannot contain spaces.

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.


preferredBackupWindow?

Type: string (optional)

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


preferredMaintenanceWindow?

Type: string (optional)

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 .


publiclyAccessible?

Type: boolean | IResolvable (optional)

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


relationalDatabaseParameters?

Type: IResolvable | IResolvable | RelationalDatabaseParameterProperty[] (optional)

An array of parameters for the database.


rotateMasterUserPassword?

Type: boolean | IResolvable (optional)

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.


tags?

Type: CfnTag[] (optional)

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

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

The Value of Tags is optional for Lightsail resources.