CfnDBInstance

class aws_cdk.aws_rds.CfnDBInstance(scope, id, *, db_instance_class, allocated_storage=None, allow_major_version_upgrade=None, associated_roles=None, auto_minor_version_upgrade=None, availability_zone=None, backup_retention_period=None, ca_certificate_identifier=None, character_set_name=None, copy_tags_to_snapshot=None, db_cluster_identifier=None, db_instance_identifier=None, db_name=None, db_parameter_group_name=None, db_security_groups=None, db_snapshot_identifier=None, db_subnet_group_name=None, delete_automated_backups=None, deletion_protection=None, domain=None, domain_iam_role_name=None, enable_cloudwatch_logs_exports=None, enable_iam_database_authentication=None, enable_performance_insights=None, engine=None, engine_version=None, iops=None, kms_key_id=None, license_model=None, master_username=None, master_user_password=None, max_allocated_storage=None, monitoring_interval=None, monitoring_role_arn=None, multi_az=None, option_group_name=None, performance_insights_kms_key_id=None, performance_insights_retention_period=None, port=None, preferred_backup_window=None, preferred_maintenance_window=None, processor_features=None, promotion_tier=None, publicly_accessible=None, source_db_instance_identifier=None, source_region=None, storage_encrypted=None, storage_type=None, tags=None, timezone=None, use_default_processor_features=None, vpc_security_groups=None)

Bases: aws_cdk.core.CfnResource

A CloudFormation AWS::RDS::DBInstance.

The AWS::RDS::DBInstance resource creates an Amazon RDS DB instance.

If you import an existing DB instance, and the template configuration doesn’t match the actual configuration of the DB instance, AWS CloudFormation applies the changes in the template during the import operation. .. epigraph:

If a DB instance is deleted or replaced during an update, AWS CloudFormation deletes all automated snapshots. However, it retains manual DB snapshots. During an update that requires replacement, you can apply a stack policy to prevent DB instances from being replaced. For more information, see `Prevent Updates to Stack Resources <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/protect-stack-resources.html>`_ .

This topic covers the resource for Amazon RDS DB instances. For the documentation on the resource for Amazon Aurora DB clusters, see AWS::RDS::DBCluster .

Updating DB instances

When properties labeled ” Update requires: Replacement ” are updated, AWS CloudFormation first creates a replacement DB instance, then changes references from other dependent resources to point to the replacement DB instance, and finally deletes the old DB instance. .. epigraph:

We highly recommend that you take a snapshot of the database before updating the stack. If you don't, you lose the data when AWS CloudFormation replaces your DB instance. To preserve your data, perform the following procedure:

- Deactivate any applications that are using the DB instance so that there's no activity on the DB instance.
- Create a snapshot of the DB instance. For more information about creating DB snapshots, see `Creating a DB Snapshot <https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_CreateSnapshot.html>`_ .
- If you want to restore your instance using a DB snapshot, modify the updated template with your DB instance changes and add the ``DBSnapshotIdentifier`` property with the ID of the DB snapshot that you want to use.

After you restore a DB instance with a ``DBSnapshotIdentifier`` property, you must specify the same ``DBSnapshotIdentifier`` property for any future updates to the DB instance. When you specify this property for an update, the DB instance is not restored from the DB snapshot again, and the data in the database is not changed. However, if you don't specify the ``DBSnapshotIdentifier`` property, an empty DB instance is created, and the original DB instance is deleted. If you specify a property that is different from the previous snapshot restore property, a new DB instance is restored from the specified ``DBSnapshotIdentifier`` property, and the original DB instance is deleted.

- Update the stack.

For more information about updating other properties of this resource, see [ModifyDBInstance](https://docs.aws.amazon.com//AmazonRDS/latest/APIReference/API_ModifyDBInstance.html) . For more information about updating stacks, see AWS CloudFormation Stacks Updates .

Deleting DB instances

For DB instances that are part of an Aurora DB cluster, you can set a deletion policy for your DB instance to control how AWS CloudFormation handles the DB instance when the stack is deleted. For Amazon RDS DB instances, you can choose to retain the DB instance, to delete the DB instance, or to create a snapshot of the DB instance. The default AWS CloudFormation behavior depends on the DBClusterIdentifier property:

  • For AWS::RDS::DBInstance resources that don’t specify the DBClusterIdentifier property, AWS CloudFormation saves a snapshot of the DB instance.

  • For AWS::RDS::DBInstance resources that do specify the DBClusterIdentifier property, AWS CloudFormation deletes the DB instance.

For more information, see DeletionPolicy Attribute .

CloudformationResource

AWS::RDS::DBInstance

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html

ExampleMetadata

fixture=_generated

Example:

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

cfn_dBInstance = rds.CfnDBInstance(self, "MyCfnDBInstance",
    db_instance_class="dbInstanceClass",

    # the properties below are optional
    allocated_storage="allocatedStorage",
    allow_major_version_upgrade=False,
    associated_roles=[rds.CfnDBInstance.DBInstanceRoleProperty(
        feature_name="featureName",
        role_arn="roleArn"
    )],
    auto_minor_version_upgrade=False,
    availability_zone="availabilityZone",
    backup_retention_period=123,
    ca_certificate_identifier="caCertificateIdentifier",
    character_set_name="characterSetName",
    copy_tags_to_snapshot=False,
    db_cluster_identifier="dbClusterIdentifier",
    db_instance_identifier="dbInstanceIdentifier",
    db_name="dbName",
    db_parameter_group_name="dbParameterGroupName",
    db_security_groups=["dbSecurityGroups"],
    db_snapshot_identifier="dbSnapshotIdentifier",
    db_subnet_group_name="dbSubnetGroupName",
    delete_automated_backups=False,
    deletion_protection=False,
    domain="domain",
    domain_iam_role_name="domainIamRoleName",
    enable_cloudwatch_logs_exports=["enableCloudwatchLogsExports"],
    enable_iam_database_authentication=False,
    enable_performance_insights=False,
    engine="engine",
    engine_version="engineVersion",
    iops=123,
    kms_key_id="kmsKeyId",
    license_model="licenseModel",
    master_username="masterUsername",
    master_user_password="masterUserPassword",
    max_allocated_storage=123,
    monitoring_interval=123,
    monitoring_role_arn="monitoringRoleArn",
    multi_az=False,
    option_group_name="optionGroupName",
    performance_insights_kms_key_id="performanceInsightsKmsKeyId",
    performance_insights_retention_period=123,
    port="port",
    preferred_backup_window="preferredBackupWindow",
    preferred_maintenance_window="preferredMaintenanceWindow",
    processor_features=[rds.CfnDBInstance.ProcessorFeatureProperty(
        name="name",
        value="value"
    )],
    promotion_tier=123,
    publicly_accessible=False,
    source_db_instance_identifier="sourceDbInstanceIdentifier",
    source_region="sourceRegion",
    storage_encrypted=False,
    storage_type="storageType",
    tags=[CfnTag(
        key="key",
        value="value"
    )],
    timezone="timezone",
    use_default_processor_features=False,
    vpc_security_groups=["vpcSecurityGroups"]
)

Create a new AWS::RDS::DBInstance.

Parameters
  • scope (Construct) –

    • scope in which this resource is defined.

  • id (str) –

    • scoped id of the resource.

  • db_instance_class (str) – The compute and memory capacity of the DB instance, for example, db.m4.large . Not all DB instance classes are available in all AWS Regions, or for all database engines. For the full list of DB instance classes, and availability for your engine, see DB Instance Class in the Amazon RDS User Guide. For more information about DB instance class pricing and AWS Region support for DB instance classes, see Amazon RDS Pricing .

  • allocated_storage (Optional[str]) – The amount of storage (in gigabytes) to be initially allocated for the database instance. .. epigraph:: If any value is set in the Iops parameter, AllocatedStorage must be at least 100 GiB, which corresponds to the minimum Iops value of 1,000. If you increase the Iops value (in 1,000 IOPS increments), then you must also increase the AllocatedStorage value (in 100-GiB increments). Amazon Aurora Not applicable. Aurora cluster volumes automatically grow as the amount of data in your database increases, though you are only charged for the space that you use in an Aurora cluster volume. MySQL Constraints to the amount of storage for each storage type are the following: - General Purpose (SSD) storage (gp2): Must be an integer from 20 to 65536. - Provisioned IOPS storage (io1): Must be an integer from 100 to 65536. - Magnetic storage (standard): Must be an integer from 5 to 3072. MariaDB Constraints to the amount of storage for each storage type are the following: - General Purpose (SSD) storage (gp2): Must be an integer from 20 to 65536. - Provisioned IOPS storage (io1): Must be an integer from 100 to 65536. - Magnetic storage (standard): Must be an integer from 5 to 3072. PostgreSQL Constraints to the amount of storage for each storage type are the following: - General Purpose (SSD) storage (gp2): Must be an integer from 20 to 65536. - Provisioned IOPS storage (io1): Must be an integer from 100 to 65536. - Magnetic storage (standard): Must be an integer from 5 to 3072. Oracle Constraints to the amount of storage for each storage type are the following: - General Purpose (SSD) storage (gp2): Must be an integer from 20 to 65536. - Provisioned IOPS storage (io1): Must be an integer from 100 to 65536. - Magnetic storage (standard): Must be an integer from 10 to 3072. SQL Server Constraints to the amount of storage for each storage type are the following: - General Purpose (SSD) storage (gp2): - Enterprise and Standard editions: Must be an integer from 20 to 16384. - Web and Express editions: Must be an integer from 20 to 16384. - Provisioned IOPS storage (io1): - Enterprise and Standard editions: Must be an integer from 20 to 16384. - Web and Express editions: Must be an integer from 20 to 16384. - Magnetic storage (standard): - Enterprise and Standard editions: Must be an integer from 20 to 1024. - Web and Express editions: Must be an integer from 20 to 1024.

  • allow_major_version_upgrade (Union[bool, IResolvable, None]) – A value that indicates whether major version upgrades are allowed. Changing this parameter doesn’t result in an outage and the change is asynchronously applied as soon as possible. Constraints: Major version upgrades must be allowed when specifying a value for the EngineVersion parameter that is a different major version than the DB instance’s current version.

  • associated_roles (Union[IResolvable, Sequence[Union[IResolvable, DBInstanceRoleProperty]], None]) – The AWS Identity and Access Management (IAM) roles associated with the DB instance.

  • auto_minor_version_upgrade (Union[bool, IResolvable, None]) – A value that indicates whether minor engine upgrades are applied automatically to the DB instance during the maintenance window. By default, minor engine upgrades are applied automatically.

  • availability_zone (Optional[str]) – The Availability Zone that the database instance will be created in. Default: A random, system-chosen Availability Zone in the endpoint’s region. Example: us-east-1d Constraint: The AvailabilityZone parameter cannot be specified if the MultiAZ parameter is set to true . The specified Availability Zone must be in the same region as the current endpoint.

  • backup_retention_period (Union[int, float, None]) – The number of days for which automated backups are retained. Setting this parameter to a positive number enables backups. Setting this parameter to 0 disables automated backups. Amazon Aurora Not applicable. The retention period for automated backups is managed by the DB cluster. Default: 1 Constraints: - Must be a value from 0 to 35 - Can’t be set to 0 if the DB instance is a source to read replicas

  • ca_certificate_identifier (Optional[str]) –

    The identifier of the CA certificate for this DB instance. .. epigraph:: Specifying or updating this property triggers a reboot. For more information about CA certificate identifiers for RDS DB engines, see Rotating Your SSL/TLS Certificate in the Amazon RDS User Guide . For more information about CA certificate identifiers for Aurora DB engines, see Rotating Your SSL/TLS Certificate in the Amazon Aurora User Guide .

  • character_set_name (Optional[str]) –

    For supported engines, indicates that the DB instance should be associated with the specified character set. Amazon Aurora Not applicable. The character set is managed by the DB cluster. For more information, see AWS::RDS::DBCluster .

  • copy_tags_to_snapshot (Union[bool, IResolvable, None]) – A value that indicates whether to copy tags from the DB instance to snapshots of the DB instance. By default, tags are not copied. Amazon Aurora Not applicable. Copying tags to snapshots is managed by the DB cluster. Setting this value for an Aurora DB instance has no effect on the DB cluster setting.

  • db_cluster_identifier (Optional[str]) – The identifier of the DB cluster that the instance will belong to.

  • db_instance_identifier (Optional[str]) – A name for the DB instance. If you specify a name, AWS CloudFormation converts it to lowercase. If you don’t specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the DB instance. For more information, see Name Type . .. epigraph:: If you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name.

  • db_name (Optional[str]) – The meaning of this parameter differs according to the database engine you use. .. epigraph:: If you specify the [DBSnapshotIdentifier](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-dbsnapshotidentifier) property, AWS CloudFormation ignores this property. If you restore DB instances from snapshots, this property doesn’t apply to the MySQL, PostgreSQL, or MariaDB engines. MySQL The name of the database to create when the DB instance is created. If this parameter is not specified, no database is created in the DB instance. Constraints: - Must contain 1 to 64 letters or numbers. - Can’t be a word reserved by the specified database engine MariaDB The name of the database to create when the DB instance is created. If this parameter is not specified, no database is created in the DB instance. Constraints: - Must contain 1 to 64 letters or numbers. - Can’t be a word reserved by the specified database engine PostgreSQL The name of the database to create when the DB instance is created. If this parameter is not specified, the default postgres database is created in the DB instance. Constraints: - Must contain 1 to 63 letters, numbers, or underscores. - Must begin with a letter or an underscore. Subsequent characters can be letters, underscores, or digits (0-9). - Can’t be a word reserved by the specified database engine Oracle The Oracle System ID (SID) of the created DB instance. If you specify null , the default value ORCL is used. You can’t specify the string NULL, or any other reserved word, for DBName . Default: ORCL Constraints: - Can’t be longer than 8 characters SQL Server Not applicable. Must be null. Amazon Aurora MySQL The name of the database to create when the primary DB instance of the Aurora MySQL DB cluster is created. If this parameter isn’t specified for an Aurora MySQL DB cluster, no database is created in the DB cluster. Constraints: - It must contain 1 to 64 alphanumeric characters. - It can’t be a word reserved by the database engine. Amazon Aurora PostgreSQL The name of the database to create when the primary DB instance of the Aurora PostgreSQL DB cluster is created. If this parameter isn’t specified for an Aurora PostgreSQL DB cluster, a database named postgres is created in the DB cluster. Constraints: - It must contain 1 to 63 alphanumeric characters. - It must begin with a letter or an underscore. Subsequent characters can be letters, underscores, or digits (0 to 9). - It can’t be a word reserved by the database engine.

  • db_parameter_group_name (Optional[str]) – The name of an existing DB parameter group or a reference to an AWS::RDS::DBParameterGroup resource created in the template. To list all of the available DB parameter group names, use the following command: aws rds describe-db-parameter-groups --query "DBParameterGroups[].DBParameterGroupName" --output text .. epigraph:: If any of the data members of the referenced parameter group are changed during an update, the DB instance might need to be restarted, which causes some interruption. If the parameter group contains static parameters, whether they were changed or not, an update triggers a reboot. If you don’t specify a value for the DBParameterGroupName property, the default DB parameter group for the specified engine and engine version is used.

  • db_security_groups (Optional[Sequence[str]]) – A list of the DB security groups to assign to the DB instance. The list can include both the name of existing DB security groups or references to AWS::RDS::DBSecurityGroup resources created in the template. If you set DBSecurityGroups, you must not set VPCSecurityGroups, and vice versa. Also, note that the DBSecurityGroups property exists only for backwards compatibility with older regions and is no longer recommended for providing security information to an RDS DB instance. Instead, use VPCSecurityGroups. .. epigraph:: If you specify this property, AWS CloudFormation sends only the following properties (if specified) to Amazon RDS during create operations: - AllocatedStorage - AutoMinorVersionUpgrade - AvailabilityZone - BackupRetentionPeriod - CharacterSetName - DBInstanceClass - DBName - DBParameterGroupName - DBSecurityGroups - DBSubnetGroupName - Engine - EngineVersion - Iops - LicenseModel - MasterUsername - MasterUserPassword - MultiAZ - OptionGroupName - PreferredBackupWindow - PreferredMaintenanceWindow All other properties are ignored. Specify a virtual private cloud (VPC) security group if you want to submit other properties, such as StorageType , StorageEncrypted , or KmsKeyId . If you’re already using the DBSecurityGroups property, you can’t use these other properties by updating your DB instance to use a VPC security group. You must recreate the DB instance.

  • db_snapshot_identifier (Optional[str]) – The name or Amazon Resource Name (ARN) of the DB snapshot that’s used to restore the DB instance. If you’re restoring from a shared manual DB snapshot, you must specify the ARN of the snapshot. By specifying this property, you can create a DB instance from the specified DB snapshot. If the DBSnapshotIdentifier property is an empty string or the AWS::RDS::DBInstance declaration has no DBSnapshotIdentifier property, AWS CloudFormation creates a new database. If the property contains a value (other than an empty string), AWS CloudFormation creates a database from the specified snapshot. If a snapshot with the specified name doesn’t exist, AWS CloudFormation can’t create the database and it rolls back the stack. Some DB instance properties aren’t valid when you restore from a snapshot, such as the MasterUsername and MasterUserPassword properties. For information about the properties that you can specify, see the RestoreDBInstanceFromDBSnapshot action in the Amazon RDS API Reference . After you restore a DB instance with a DBSnapshotIdentifier property, you must specify the same DBSnapshotIdentifier property for any future updates to the DB instance. When you specify this property for an update, the DB instance is not restored from the DB snapshot again, and the data in the database is not changed. However, if you don’t specify the DBSnapshotIdentifier property, an empty DB instance is created, and the original DB instance is deleted. If you specify a property that is different from the previous snapshot restore property, a new DB instance is restored from the specified DBSnapshotIdentifier property, and the original DB instance is deleted. If you specify the DBSnapshotIdentifier property to restore a DB instance (as opposed to specifying it for DB instance updates), then don’t specify the following properties: - CharacterSetName - DBClusterIdentifier - DBName - DeleteAutomatedBackups - EnablePerformanceInsights - KmsKeyId - MasterUsername - MonitoringInterval - MonitoringRoleArn - PerformanceInsightsKMSKeyId - PerformanceInsightsRetentionPeriod - PromotionTier - SourceDBInstanceIdentifier - SourceRegion - StorageEncrypted - Timezone

  • db_subnet_group_name (Optional[str]) – A DB subnet group to associate with the DB instance. If you update this value, the new subnet group must be a subnet group in a new VPC. If there’s no DB subnet group, then the DB instance isn’t a VPC DB instance. For more information about using Amazon RDS in a VPC, see Using Amazon RDS with Amazon Virtual Private Cloud (VPC) in the Amazon Relational Database Service Developer Guide . Amazon Aurora Not applicable. The DB subnet group is managed by the DB cluster. If specified, the setting must match the DB cluster setting.

  • delete_automated_backups (Union[bool, IResolvable, None]) – A value that indicates whether to remove automated backups immediately after the DB instance is deleted. This parameter isn’t case-sensitive. The default is to remove automated backups immediately after the DB instance is deleted.

  • deletion_protection (Union[bool, IResolvable, None]) – A value that indicates whether the DB instance has deletion protection enabled. The database can’t be deleted when deletion protection is enabled. By default, deletion protection is disabled. For more information, see Deleting a DB Instance . Amazon Aurora Not applicable. You can enable or disable deletion protection for the DB cluster. For more information, see CreateDBCluster . DB instances in a DB cluster can be deleted even when deletion protection is enabled for the DB cluster.

  • domain (Optional[str]) – The Active Directory directory ID to create the DB instance in. Currently, only Microsoft SQL Server, Oracle, and PostgreSQL DB instances can be created in an Active Directory Domain. For more information, see Kerberos Authentication in the Amazon RDS User Guide .

  • domain_iam_role_name (Optional[str]) – Specify the name of the IAM role to be used when making API calls to the Directory Service. This setting doesn’t apply to RDS Custom.

  • enable_cloudwatch_logs_exports (Optional[Sequence[str]]) – The list of log types that need to be enabled for exporting to CloudWatch Logs. The values in the list depend on the DB engine being used. For more information, see Publishing Database Logs to Amazon CloudWatch Logs in the Amazon Relational Database Service User Guide . Amazon Aurora Not applicable. CloudWatch Logs exports are managed by the DB cluster. MariaDB Valid values: audit , error , general , slowquery Microsoft SQL Server Valid values: agent , error MySQL Valid values: audit , error , general , slowquery Oracle Valid values: alert , audit , listener , trace PostgreSQL Valid values: postgresql , upgrade

  • enable_iam_database_authentication (Union[bool, IResolvable, None]) – A value that indicates whether to enable mapping of AWS Identity and Access Management (IAM) accounts to database accounts. By default, mapping is disabled. For more information, see IAM Database Authentication for MySQL and PostgreSQL in the Amazon RDS User Guide. Amazon Aurora Not applicable. Mapping AWS IAM accounts to database accounts is managed by the DB cluster.

  • enable_performance_insights (Union[bool, IResolvable, None]) – A value that indicates whether to enable Performance Insights for the DB instance. For more information, see Using Amazon Performance Insights in the Amazon Relational Database Service User Guide . This setting doesn’t apply to RDS Custom.

  • engine (Optional[str]) – The name of the database engine that you want to use for this DB instance. .. epigraph:: When you are creating a DB instance, the Engine property is required. Valid Values: - aurora (for MySQL 5.6-compatible Aurora) - aurora-mysql (for MySQL 5.7-compatible Aurora) - aurora-postgresql - mariadb - mysql - oracle-ee - oracle-se2 - oracle-se1 - oracle-se - postgres - sqlserver-ee - sqlserver-se - sqlserver-ex - sqlserver-web

  • engine_version (Optional[str]) – The version number of the database engine to use. For a list of valid engine versions, use the DescribeDBEngineVersions action. The following are the database engines and links to information about the major and minor versions that are available with Amazon RDS. Not every database engine is available for every AWS Region. Amazon Aurora Not applicable. The version number of the database engine to be used by the DB instance is managed by the DB cluster. MariaDB See MariaDB on Amazon RDS Versions in the Amazon RDS User Guide. Microsoft SQL Server See Microsoft SQL Server Versions on Amazon RDS in the Amazon RDS User Guide. MySQL See MySQL on Amazon RDS Versions in the Amazon RDS User Guide. Oracle See Oracle Database Engine Release Notes in the Amazon RDS User Guide. PostgreSQL See Supported PostgreSQL Database Versions in the Amazon RDS User Guide.

  • iops (Union[int, float, None]) – The number of I/O operations per second (IOPS) that the database provisions. The value must be equal to or greater than 1000. If you specify this property, you must follow the range of allowed ratios of your requested IOPS rate to the amount of storage that you allocate (IOPS to allocated storage). For example, you can provision an Oracle database instance with 1000 IOPS and 200 GiB of storage (a ratio of 5:1), or specify 2000 IOPS with 200 GiB of storage (a ratio of 10:1). For more information, see Amazon RDS Provisioned IOPS Storage to Improve Performance in the Amazon RDS User Guide . .. epigraph:: If you specify io1 for the StorageType property, then you must also specify the Iops property.

  • kms_key_id (Optional[str]) – The ARN of the AWS Key Management Service ( AWS KMS) master key that’s used to encrypt the DB instance, such as arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef . If you enable the StorageEncrypted property but don’t specify this property, AWS CloudFormation uses the default master key. If you specify this property, you must set the StorageEncrypted property to true. If you specify the SourceDBInstanceIdentifier property, the value is inherited from the source DB instance if the read replica is created in the same region. If you create an encrypted read replica in a different AWS Region, then you must specify a KMS key for the destination AWS Region. KMS encryption keys are specific to the region that they’re created in, and you can’t use encryption keys from one region in another region. If you specify the SnapshotIdentifier property, the StorageEncrypted property value is inherited from the snapshot, and if the DB instance is encrypted, the specified KmsKeyId property is used. If you specify DBSecurityGroups , AWS CloudFormation ignores this property. To specify both a security group and this property, you must use a VPC security group. For more information about Amazon RDS and VPC, see Using Amazon RDS with Amazon VPC in the Amazon RDS User Guide . Amazon Aurora Not applicable. The KMS key identifier is managed by the DB cluster.

  • license_model (Optional[str]) – License model information for this DB instance. Valid values: - Aurora MySQL - general-public-license - Aurora PostgreSQL - postgresql-license - MariaDB - general-public-license - Microsoft SQL Server - license-included - MySQL - general-public-license - Oracle - bring-your-own-license or license-included - PostgreSQL - postgresql-license .. epigraph:: If you’ve specified DBSecurityGroups and then you update the license model, AWS CloudFormation replaces the underlying DB instance. This will incur some interruptions to database availability.

  • master_username (Optional[str]) – The master user name for the DB instance. .. epigraph:: If you specify the SourceDBInstanceIdentifier or DBSnapshotIdentifier property, don’t specify this property. The value is inherited from the source DB instance or snapshot. Amazon Aurora Not applicable. The name for the master user is managed by the DB cluster. MariaDB Constraints: - Required for MariaDB. - Must be 1 to 16 letters or numbers. - Can’t be a reserved word for the chosen database engine. Microsoft SQL Server Constraints: - Required for SQL Server. - Must be 1 to 128 letters or numbers. - The first character must be a letter. - Can’t be a reserved word for the chosen database engine. MySQL Constraints: - Required for MySQL. - Must be 1 to 16 letters or numbers. - First character must be a letter. - Can’t be a reserved word for the chosen database engine. Oracle Constraints: - Required for Oracle. - Must be 1 to 30 letters or numbers. - First character must be a letter. - Can’t be a reserved word for the chosen database engine. PostgreSQL Constraints: - Required for PostgreSQL. - Must be 1 to 63 letters or numbers. - First character must be a letter. - Can’t be a reserved word for the chosen database engine.

  • master_user_password (Optional[str]) – The password for the master user. The password can include any printable ASCII character except “/”, “””, or “@”. Amazon Aurora Not applicable. The password for the master user is managed by the DB cluster. MariaDB Constraints: Must contain from 8 to 41 characters. Microsoft SQL Server Constraints: Must contain from 8 to 128 characters. MySQL Constraints: Must contain from 8 to 41 characters. Oracle Constraints: Must contain from 8 to 30 characters. PostgreSQL Constraints: Must contain from 8 to 128 characters.

  • max_allocated_storage (Union[int, float, None]) – The upper limit in gibibytes (GiB) to which Amazon RDS can automatically scale the storage of the DB instance. For more information about this setting, including limitations that apply to it, see Managing capacity automatically with Amazon RDS storage autoscaling in the Amazon RDS User Guide . This setting doesn’t apply to RDS Custom.

  • monitoring_interval (Union[int, float, None]) – The interval, in seconds, between points when Enhanced Monitoring metrics are collected for the DB instance. To disable collection of Enhanced Monitoring metrics, specify 0. The default is 0. If MonitoringRoleArn is specified, then you must set MonitoringInterval to a value other than 0. This setting doesn’t apply to RDS Custom. Valid Values: 0, 1, 5, 10, 15, 30, 60

  • monitoring_role_arn (Optional[str]) – The ARN for the IAM role that permits RDS to send enhanced monitoring metrics to Amazon CloudWatch Logs. For example, arn:aws:iam:123456789012:role/emaccess . For information on creating a monitoring role, see Setting Up and Enabling Enhanced Monitoring in the Amazon RDS User Guide . If MonitoringInterval is set to a value other than 0, then you must supply a MonitoringRoleArn value. This setting doesn’t apply to RDS Custom.

  • multi_az (Union[bool, IResolvable, None]) – Specifies whether the database instance is a multiple Availability Zone deployment. You can’t set the AvailabilityZone parameter if the MultiAZ parameter is set to true. Amazon Aurora Not applicable. Amazon Aurora storage is replicated across all of the Availability Zones and doesn’t require the MultiAZ option to be set.

  • option_group_name (Optional[str]) – Indicates that the DB instance should be associated with the specified option group. Permanent options, such as the TDE option for Oracle Advanced Security TDE, can’t be removed from an option group. Also, that option group can’t be removed from a DB instance once it is associated with a DB instance.

  • performance_insights_kms_key_id (Optional[str]) – The AWS KMS key identifier for encryption of Performance Insights data. The AWS KMS key identifier is the key ARN, key ID, alias ARN, or alias name for the AWS KMS customer master key (CMK). If you do not specify a value for PerformanceInsightsKMSKeyId , then Amazon RDS uses your default CMK. There is a default CMK for your AWS account. Your AWS account has a different default CMK for each AWS Region. For information about enabling Performance Insights, see EnablePerformanceInsights .

  • performance_insights_retention_period (Union[int, float, None]) –

    The amount of time, in days, to retain Performance Insights data. Valid values are 7 or 731 (2 years). For information about enabling Performance Insights, see EnablePerformanceInsights .

  • port (Optional[str]) – The port number on which the database accepts connections.

  • preferred_backup_window (Optional[str]) – The daily time range during which automated backups are created if automated backups are enabled, using the BackupRetentionPeriod parameter. For more information, see Backup Window in the Amazon RDS User Guide. Constraints: - Must be in the format hh24:mi-hh24:mi . - Must be in Universal Coordinated Time (UTC). - Must not conflict with the preferred maintenance window. - Must be at least 30 minutes. Amazon Aurora Not applicable. The daily time range for creating automated backups is managed by the DB cluster.

  • preferred_maintenance_window (Optional[str]) – The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC). Format: ddd:hh24:mi-ddd:hh24:mi The default is a 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. To see the time blocks available, see Adjusting the Preferred DB Instance Maintenance Window in the Amazon RDS User Guide. .. epigraph:: This property applies when AWS CloudFormation initially creates the DB instance. If you use AWS CloudFormation to update the DB instance, those updates are applied immediately. Constraints: Minimum 30-minute window.

  • processor_features (Union[IResolvable, Sequence[Union[IResolvable, ProcessorFeatureProperty]], None]) – The number of CPU cores and the number of threads per core for the DB instance class of the DB instance. This setting doesn’t apply to RDS Custom.

  • promotion_tier (Union[int, float, None]) – A value that specifies the order in which an Aurora Replica is promoted to the primary instance after a failure of the existing primary instance. For more information, see Fault Tolerance for an Aurora DB Cluster in the Amazon Aurora User Guide . This setting doesn’t apply to RDS Custom. Default: 1 Valid Values: 0 - 15

  • publicly_accessible (Union[bool, IResolvable, None]) –

    Indicates whether the DB instance is an internet-facing instance. If you specify true , AWS CloudFormation creates an instance with a publicly resolvable DNS name, which resolves to a public IP address. If you specify false, AWS CloudFormation creates an internal instance with a DNS name that resolves to a private IP address. The default behavior value depends on your VPC setup and the database subnet group. For more information, see the PubliclyAccessible parameter in `CreateDBInstance <https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CreateDBInstance.html>`_ in the Amazon RDS API Reference . If this resource has a public IP address and is also in a VPC that is defined in the same template, you must use the DependsOn attribute to declare a dependency on the VPC-gateway attachment. For more information, see DependsOn Attribute . .. epigraph:: If you specify DBSecurityGroups, AWS CloudFormation ignores this property. To specify a security group and this property, you must use a VPC security group. For more information about Amazon RDS and VPC, see Using Amazon RDS with Amazon VPC in the Amazon RDS User Guide .

  • source_db_instance_identifier (Optional[str]) – If you want to create a read replica DB instance, specify the ID of the source DB instance. Each DB instance can have a limited number of read replicas. For more information, see Working with Read Replicas in the Amazon Relational Database Service Developer Guide . The SourceDBInstanceIdentifier property determines whether a DB instance is a read replica. If you remove the SourceDBInstanceIdentifier property from your template and then update your stack, AWS CloudFormation deletes the Read Replica and creates a new DB instance (not a read replica). .. epigraph:: - If you specify a source DB instance that uses VPC security groups, we recommend that you specify the VPCSecurityGroups property. If you don’t specify the property, the read replica inherits the value of the VPCSecurityGroups property from the source DB when you create the replica. However, if you update the stack, AWS CloudFormation reverts the replica’s VPCSecurityGroups property to the default value because it’s not defined in the stack’s template. This change might cause unexpected issues. - Read replicas don’t support deletion policies. AWS CloudFormation ignores any deletion policy that’s associated with a read replica. - If you specify SourceDBInstanceIdentifier , don’t specify the DBSnapshotIdentifier property. You can’t create a read replica from a snapshot. - Don’t set the BackupRetentionPeriod , DBName , MasterUsername , MasterUserPassword , and PreferredBackupWindow properties. The database attributes are inherited from the source DB instance, and backups are disabled for read replicas. - If the source DB instance is in a different region than the read replica, specify the source region in SourceRegion , and specify an ARN for a valid DB instance in SourceDBInstanceIdentifier . For more information, see Constructing a Amazon RDS Amazon Resource Name (ARN) in the Amazon RDS User Guide . - For DB instances in Amazon Aurora clusters, don’t specify this property. Amazon RDS automatically assigns writer and reader DB instances.

  • source_region (Optional[str]) – The ID of the region that contains the source DB instance for the read replica.

  • storage_encrypted (Union[bool, IResolvable, None]) – A value that indicates whether the DB instance is encrypted. By default, it isn’t encrypted. If you specify the KmsKeyId property, then you must enable encryption. If you specify the SnapshotIdentifier or SourceDBInstanceIdentifier property, don’t specify this property. The value is inherited from the snapshot or source DB instance, and if the DB instance is encrypted, the specified KmsKeyId property is used. Amazon Aurora Not applicable. The encryption for DB instances is managed by the DB cluster.

  • storage_type (Optional[str]) – Specifies the storage type to be associated with the DB instance. Valid values: standard | gp2 | io1 The standard value is also known as magnetic. If you specify io1 , you must also include a value for the Iops parameter. Default: io1 if the Iops parameter is specified, otherwise standard For more information, see Amazon RDS DB Instance Storage in the Amazon RDS User Guide . Amazon Aurora Not applicable. Aurora data is stored in the cluster volume, which is a single, virtual volume that uses solid state drives (SSDs).

  • tags (Optional[Sequence[CfnTag]]) – Tags to assign to the DB instance.

  • timezone (Optional[str]) – The time zone of the DB instance. The time zone parameter is currently supported only by Microsoft SQL Server .

  • use_default_processor_features (Union[bool, IResolvable, None]) – A value that indicates whether the DB instance class of the DB instance uses its default processor features. This setting doesn’t apply to RDS Custom.

  • vpc_security_groups (Optional[Sequence[str]]) – A list of the VPC security group IDs to assign to the DB instance. The list can include both the physical IDs of existing VPC security groups and references to AWS::EC2::SecurityGroup resources created in the template. If you plan to update the resource, don’t specify VPC security groups in a shared VPC. If you set VPCSecurityGroups , you must not set `DBSecurityGroups <https://docs.aws.amazon.com//AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-dbsecuritygroups>`_ , and vice versa. .. epigraph:: You can migrate a DB instance in your stack from an RDS DB security group to a VPC security group, but keep the following in mind: - You can’t revert to using an RDS security group after you establish a VPC security group membership. - When you migrate your DB instance to VPC security groups, if your stack update rolls back because the DB instance update fails or because an update fails in another AWS CloudFormation resource, the rollback fails because it can’t revert to an RDS security group. - To use the properties that are available when you use a VPC security group, you must recreate the DB instance. If you don’t, AWS CloudFormation submits only the property values that are listed in the `DBSecurityGroups <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-dbsecuritygroups>`_ property. To avoid this situation, migrate your DB instance to using VPC security groups only when that is the only change in your stack template. Amazon Aurora Not applicable. The associated list of EC2 VPC security groups is managed by the DB cluster. If specified, the setting must match the DB cluster setting.

Methods

add_deletion_override(path)

Syntactic sugar for addOverride(path, undefined).

Parameters

path (str) – The path of the value to delete.

Return type

None

add_depends_on(target)

Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.

This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.

Parameters

target (CfnResource) –

Return type

None

add_metadata(key, value)

Add a value to the CloudFormation Resource Metadata.

Parameters
  • key (str) –

  • value (Any) –

See

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.

Return type

None

add_override(path, value)

Adds an override to the synthesized CloudFormation resource.

To add a property override, either use addPropertyOverride or prefix path with “Properties.” (i.e. Properties.TopicName).

If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.

To include a literal . in the property name, prefix with a \. In most programming languages you will need to write this as "\\." because the \ itself will need to be escaped.

For example:

cfn_resource.add_override("Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes", ["myattribute"])
cfn_resource.add_override("Properties.GlobalSecondaryIndexes.1.ProjectionType", "INCLUDE")

would add the overrides Example:

"Properties": {
   "GlobalSecondaryIndexes": [
     {
       "Projection": {
         "NonKeyAttributes": [ "myattribute" ]
         ...
       }
       ...
     },
     {
       "ProjectionType": "INCLUDE"
       ...
     },
   ]
   ...
}
Parameters
  • path (str) –

    • The path of the property, you can use dot notation to override values in complex types. Any intermdediate keys will be created as needed.

  • value (Any) –

    • The value. Could be primitive or complex.

Return type

None

add_property_deletion_override(property_path)

Adds an override that deletes the value of a property from the resource definition.

Parameters

property_path (str) – The path to the property.

Return type

None

add_property_override(property_path, value)

Adds an override to a resource property.

Syntactic sugar for addOverride("Properties.<...>", value).

Parameters
  • property_path (str) – The path of the property.

  • value (Any) – The value.

Return type

None

apply_removal_policy(policy=None, *, apply_to_update_replace_policy=None, default=None)

Sets the deletion policy of the resource based on the removal policy specified.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you’ve removed it from the CDK application or because you’ve made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

Parameters
  • policy (Optional[RemovalPolicy]) –

  • apply_to_update_replace_policy (Optional[bool]) – Apply the same deletion policy to the resource’s “UpdateReplacePolicy”. Default: true

  • default (Optional[RemovalPolicy]) – The default policy to apply in case the removal policy is not defined. Default: - Default value is resource specific. To determine the default value for a resoure, please consult that specific resource’s documentation.

Return type

None

get_att(attribute_name)

Returns a token for an runtime attribute of this resource.

Ideally, use generated attribute accessors (e.g. resource.arn), but this can be used for future compatibility in case there is no generated attribute.

Parameters

attribute_name (str) – The name of the attribute.

Return type

Reference

get_metadata(key)

Retrieve a value value from the CloudFormation Resource Metadata.

Parameters

key (str) –

See

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.

Return type

Any

inspect(inspector)

Examines the CloudFormation resource and discloses attributes.

Parameters

inspector (TreeInspector) –

  • tree inspector to collect and process attributes.

Return type

None

override_logical_id(new_logical_id)

Overrides the auto-generated logical ID with a specific ID.

Parameters

new_logical_id (str) – The new logical ID to use for this stack element.

Return type

None

to_string()

Returns a string representation of this construct.

Return type

str

Returns

a string representation of this resource

Attributes

CFN_RESOURCE_TYPE_NAME = 'AWS::RDS::DBInstance'
allocated_storage

The amount of storage (in gigabytes) to be initially allocated for the database instance.

If any value is set in the Iops parameter, AllocatedStorage must be at least 100 GiB, which corresponds to the minimum Iops value of 1,000. If you increase the Iops value (in 1,000 IOPS increments), then you must also increase the AllocatedStorage value (in 100-GiB increments).

Amazon Aurora

Not applicable. Aurora cluster volumes automatically grow as the amount of data in your database increases, though you are only charged for the space that you use in an Aurora cluster volume.

MySQL

Constraints to the amount of storage for each storage type are the following:

  • General Purpose (SSD) storage (gp2): Must be an integer from 20 to 65536.

  • Provisioned IOPS storage (io1): Must be an integer from 100 to 65536.

  • Magnetic storage (standard): Must be an integer from 5 to 3072.

MariaDB

Constraints to the amount of storage for each storage type are the following:

  • General Purpose (SSD) storage (gp2): Must be an integer from 20 to 65536.

  • Provisioned IOPS storage (io1): Must be an integer from 100 to 65536.

  • Magnetic storage (standard): Must be an integer from 5 to 3072.

PostgreSQL

Constraints to the amount of storage for each storage type are the following:

  • General Purpose (SSD) storage (gp2): Must be an integer from 20 to 65536.

  • Provisioned IOPS storage (io1): Must be an integer from 100 to 65536.

  • Magnetic storage (standard): Must be an integer from 5 to 3072.

Oracle

Constraints to the amount of storage for each storage type are the following:

  • General Purpose (SSD) storage (gp2): Must be an integer from 20 to 65536.

  • Provisioned IOPS storage (io1): Must be an integer from 100 to 65536.

  • Magnetic storage (standard): Must be an integer from 10 to 3072.

SQL Server

Constraints to the amount of storage for each storage type are the following:

  • General Purpose (SSD) storage (gp2):

  • Enterprise and Standard editions: Must be an integer from 20 to 16384.

  • Web and Express editions: Must be an integer from 20 to 16384.

  • Provisioned IOPS storage (io1):

  • Enterprise and Standard editions: Must be an integer from 20 to 16384.

  • Web and Express editions: Must be an integer from 20 to 16384.

  • Magnetic storage (standard):

  • Enterprise and Standard editions: Must be an integer from 20 to 1024.

  • Web and Express editions: Must be an integer from 20 to 1024.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-allocatedstorage

Return type

Optional[str]

allow_major_version_upgrade

A value that indicates whether major version upgrades are allowed.

Changing this parameter doesn’t result in an outage and the change is asynchronously applied as soon as possible.

Constraints: Major version upgrades must be allowed when specifying a value for the EngineVersion parameter that is a different major version than the DB instance’s current version.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-allowmajorversionupgrade

Return type

Union[bool, IResolvable, None]

associated_roles

The AWS Identity and Access Management (IAM) roles associated with the DB instance.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-associatedroles

Return type

Union[IResolvable, List[Union[IResolvable, DBInstanceRoleProperty]], None]

attr_endpoint_address

The connection endpoint for the database.

For example: mystack-mydb-1apw1j4phylrk.cg034hpkmmjt.us-east-2.rds.amazonaws.com

CloudformationAttribute

Endpoint.Address

Return type

str

attr_endpoint_port

The port number on which the database accepts connections.

For example: 3306

CloudformationAttribute

Endpoint.Port

Return type

str

auto_minor_version_upgrade

A value that indicates whether minor engine upgrades are applied automatically to the DB instance during the maintenance window.

By default, minor engine upgrades are applied automatically.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-autominorversionupgrade

Return type

Union[bool, IResolvable, None]

availability_zone

The Availability Zone that the database instance will be created in.

Default: A random, system-chosen Availability Zone in the endpoint’s region.

Example: us-east-1d

Constraint: The AvailabilityZone parameter cannot be specified if the MultiAZ parameter is set to true . The specified Availability Zone must be in the same region as the current endpoint.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-availabilityzone

Return type

Optional[str]

backup_retention_period

The number of days for which automated backups are retained.

Setting this parameter to a positive number enables backups. Setting this parameter to 0 disables automated backups.

Amazon Aurora

Not applicable. The retention period for automated backups is managed by the DB cluster.

Default: 1

Constraints:

  • Must be a value from 0 to 35

  • Can’t be set to 0 if the DB instance is a source to read replicas

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-backupretentionperiod

Return type

Union[int, float, None]

ca_certificate_identifier

The identifier of the CA certificate for this DB instance.

Specifying or updating this property triggers a reboot.

For more information about CA certificate identifiers for RDS DB engines, see Rotating Your SSL/TLS Certificate in the Amazon RDS User Guide .

For more information about CA certificate identifiers for Aurora DB engines, see Rotating Your SSL/TLS Certificate in the Amazon Aurora User Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-cacertificateidentifier

Return type

Optional[str]

cfn_options

Options for this resource, such as condition, update policy etc.

Return type

ICfnResourceOptions

cfn_resource_type

AWS resource type.

Return type

str

character_set_name

For supported engines, indicates that the DB instance should be associated with the specified character set.

Amazon Aurora

Not applicable. The character set is managed by the DB cluster. For more information, see AWS::RDS::DBCluster .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-charactersetname

Return type

Optional[str]

copy_tags_to_snapshot

A value that indicates whether to copy tags from the DB instance to snapshots of the DB instance.

By default, tags are not copied.

Amazon Aurora

Not applicable. Copying tags to snapshots is managed by the DB cluster. Setting this value for an Aurora DB instance has no effect on the DB cluster setting.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-copytagstosnapshot

Return type

Union[bool, IResolvable, None]

creation_stack

return:

the stack trace of the point where this Resource was created from, sourced from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most node +internal+ entries filtered.

Return type

List[str]

db_cluster_identifier

The identifier of the DB cluster that the instance will belong to.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-dbclusteridentifier

Return type

Optional[str]

db_instance_class

The compute and memory capacity of the DB instance, for example, db.m4.large . Not all DB instance classes are available in all AWS Regions, or for all database engines.

For the full list of DB instance classes, and availability for your engine, see DB Instance Class in the Amazon RDS User Guide. For more information about DB instance class pricing and AWS Region support for DB instance classes, see Amazon RDS Pricing .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-dbinstanceclass

Return type

str

db_instance_identifier

A name for the DB instance.

If you specify a name, AWS CloudFormation converts it to lowercase. If you don’t specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the DB instance. For more information, see Name Type . .. epigraph:

If you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name.
Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-dbinstanceidentifier

Return type

Optional[str]

db_name

The meaning of this parameter differs according to the database engine you use.

If you specify the [DBSnapshotIdentifier](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-dbsnapshotidentifier) property, AWS CloudFormation ignores this property.

If you restore DB instances from snapshots, this property doesn’t apply to the MySQL, PostgreSQL, or MariaDB engines.

MySQL

The name of the database to create when the DB instance is created. If this parameter is not specified, no database is created in the DB instance.

Constraints:

  • Must contain 1 to 64 letters or numbers.

  • Can’t be a word reserved by the specified database engine

MariaDB

The name of the database to create when the DB instance is created. If this parameter is not specified, no database is created in the DB instance.

Constraints:

  • Must contain 1 to 64 letters or numbers.

  • Can’t be a word reserved by the specified database engine

PostgreSQL

The name of the database to create when the DB instance is created. If this parameter is not specified, the default postgres database is created in the DB instance.

Constraints:

  • Must contain 1 to 63 letters, numbers, or underscores.

  • Must begin with a letter or an underscore. Subsequent characters can be letters, underscores, or digits (0-9).

  • Can’t be a word reserved by the specified database engine

Oracle

The Oracle System ID (SID) of the created DB instance. If you specify null , the default value ORCL is used. You can’t specify the string NULL, or any other reserved word, for DBName .

Default: ORCL

Constraints:

  • Can’t be longer than 8 characters

SQL Server

Not applicable. Must be null.

Amazon Aurora MySQL

The name of the database to create when the primary DB instance of the Aurora MySQL DB cluster is created. If this parameter isn’t specified for an Aurora MySQL DB cluster, no database is created in the DB cluster.

Constraints:

  • It must contain 1 to 64 alphanumeric characters.

  • It can’t be a word reserved by the database engine.

Amazon Aurora PostgreSQL

The name of the database to create when the primary DB instance of the Aurora PostgreSQL DB cluster is created. If this parameter isn’t specified for an Aurora PostgreSQL DB cluster, a database named postgres is created in the DB cluster.

Constraints:

  • It must contain 1 to 63 alphanumeric characters.

  • It must begin with a letter or an underscore. Subsequent characters can be letters, underscores, or digits (0 to 9).

  • It can’t be a word reserved by the database engine.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-dbname

Return type

Optional[str]

db_parameter_group_name

//docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-dbparametergroup.html>`_ resource created in the template.

To list all of the available DB parameter group names, use the following command:

aws rds describe-db-parameter-groups --query "DBParameterGroups[].DBParameterGroupName" --output text .. epigraph:

If any of the data members of the referenced parameter group are changed during an update, the DB instance might need to be restarted, which causes some interruption. If the parameter group contains static parameters, whether they were changed or not, an update triggers a reboot.

If you don’t specify a value for the DBParameterGroupName property, the default DB parameter group for the specified engine and engine version is used.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-dbparametergroupname

Type

The name of an existing DB parameter group or a reference to an `AWS::RDS::DBParameterGroup <https

Return type

Optional[str]

db_security_groups

A list of the DB security groups to assign to the DB instance.

The list can include both the name of existing DB security groups or references to AWS::RDS::DBSecurityGroup resources created in the template.

If you set DBSecurityGroups, you must not set VPCSecurityGroups, and vice versa. Also, note that the DBSecurityGroups property exists only for backwards compatibility with older regions and is no longer recommended for providing security information to an RDS DB instance. Instead, use VPCSecurityGroups. .. epigraph:

If you specify this property, AWS CloudFormation sends only the following properties (if specified) to Amazon RDS during create operations:

- ``AllocatedStorage``
- ``AutoMinorVersionUpgrade``
- ``AvailabilityZone``
- ``BackupRetentionPeriod``
- ``CharacterSetName``
- ``DBInstanceClass``
- ``DBName``
- ``DBParameterGroupName``
- ``DBSecurityGroups``
- ``DBSubnetGroupName``
- ``Engine``
- ``EngineVersion``
- ``Iops``
- ``LicenseModel``
- ``MasterUsername``
- ``MasterUserPassword``
- ``MultiAZ``
- ``OptionGroupName``
- ``PreferredBackupWindow``
- ``PreferredMaintenanceWindow``

All other properties are ignored. Specify a virtual private cloud (VPC) security group if you want to submit other properties, such as ``StorageType`` , ``StorageEncrypted`` , or ``KmsKeyId`` . If you're already using the ``DBSecurityGroups`` property, you can't use these other properties by updating your DB instance to use a VPC security group. You must recreate the DB instance.
Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-dbsecuritygroups

Return type

Optional[List[str]]

db_snapshot_identifier

The name or Amazon Resource Name (ARN) of the DB snapshot that’s used to restore the DB instance.

If you’re restoring from a shared manual DB snapshot, you must specify the ARN of the snapshot.

By specifying this property, you can create a DB instance from the specified DB snapshot. If the DBSnapshotIdentifier property is an empty string or the AWS::RDS::DBInstance declaration has no DBSnapshotIdentifier property, AWS CloudFormation creates a new database. If the property contains a value (other than an empty string), AWS CloudFormation creates a database from the specified snapshot. If a snapshot with the specified name doesn’t exist, AWS CloudFormation can’t create the database and it rolls back the stack.

Some DB instance properties aren’t valid when you restore from a snapshot, such as the MasterUsername and MasterUserPassword properties. For information about the properties that you can specify, see the RestoreDBInstanceFromDBSnapshot action in the Amazon RDS API Reference .

After you restore a DB instance with a DBSnapshotIdentifier property, you must specify the same DBSnapshotIdentifier property for any future updates to the DB instance. When you specify this property for an update, the DB instance is not restored from the DB snapshot again, and the data in the database is not changed. However, if you don’t specify the DBSnapshotIdentifier property, an empty DB instance is created, and the original DB instance is deleted. If you specify a property that is different from the previous snapshot restore property, a new DB instance is restored from the specified DBSnapshotIdentifier property, and the original DB instance is deleted.

If you specify the DBSnapshotIdentifier property to restore a DB instance (as opposed to specifying it for DB instance updates), then don’t specify the following properties:

  • CharacterSetName

  • DBClusterIdentifier

  • DBName

  • DeleteAutomatedBackups

  • EnablePerformanceInsights

  • KmsKeyId

  • MasterUsername

  • MonitoringInterval

  • MonitoringRoleArn

  • PerformanceInsightsKMSKeyId

  • PerformanceInsightsRetentionPeriod

  • PromotionTier

  • SourceDBInstanceIdentifier

  • SourceRegion

  • StorageEncrypted

  • Timezone

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-dbsnapshotidentifier

Return type

Optional[str]

db_subnet_group_name

A DB subnet group to associate with the DB instance.

If you update this value, the new subnet group must be a subnet group in a new VPC.

If there’s no DB subnet group, then the DB instance isn’t a VPC DB instance.

For more information about using Amazon RDS in a VPC, see Using Amazon RDS with Amazon Virtual Private Cloud (VPC) in the Amazon Relational Database Service Developer Guide .

Amazon Aurora

Not applicable. The DB subnet group is managed by the DB cluster. If specified, the setting must match the DB cluster setting.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-dbsubnetgroupname

Return type

Optional[str]

delete_automated_backups

A value that indicates whether to remove automated backups immediately after the DB instance is deleted.

This parameter isn’t case-sensitive. The default is to remove automated backups immediately after the DB instance is deleted.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-deleteautomatedbackups

Return type

Union[bool, IResolvable, None]

deletion_protection

A value that indicates whether the DB instance has deletion protection enabled.

The database can’t be deleted when deletion protection is enabled. By default, deletion protection is disabled. For more information, see Deleting a DB Instance .

Amazon Aurora

Not applicable. You can enable or disable deletion protection for the DB cluster. For more information, see CreateDBCluster . DB instances in a DB cluster can be deleted even when deletion protection is enabled for the DB cluster.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-deletionprotection

Return type

Union[bool, IResolvable, None]

domain

The Active Directory directory ID to create the DB instance in.

Currently, only Microsoft SQL Server, Oracle, and PostgreSQL DB instances can be created in an Active Directory Domain.

For more information, see Kerberos Authentication in the Amazon RDS User Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-domain

Return type

Optional[str]

domain_iam_role_name

Specify the name of the IAM role to be used when making API calls to the Directory Service.

This setting doesn’t apply to RDS Custom.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-domainiamrolename

Return type

Optional[str]

enable_cloudwatch_logs_exports

The list of log types that need to be enabled for exporting to CloudWatch Logs.

The values in the list depend on the DB engine being used. For more information, see Publishing Database Logs to Amazon CloudWatch Logs in the Amazon Relational Database Service User Guide .

Amazon Aurora

Not applicable. CloudWatch Logs exports are managed by the DB cluster.

MariaDB

Valid values: audit , error , general , slowquery

Microsoft SQL Server

Valid values: agent , error

MySQL

Valid values: audit , error , general , slowquery

Oracle

Valid values: alert , audit , listener , trace

PostgreSQL

Valid values: postgresql , upgrade

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-enablecloudwatchlogsexports

Return type

Optional[List[str]]

enable_iam_database_authentication

A value that indicates whether to enable mapping of AWS Identity and Access Management (IAM) accounts to database accounts.

By default, mapping is disabled.

For more information, see IAM Database Authentication for MySQL and PostgreSQL in the Amazon RDS User Guide.

Amazon Aurora

Not applicable. Mapping AWS IAM accounts to database accounts is managed by the DB cluster.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-enableiamdatabaseauthentication

Return type

Union[bool, IResolvable, None]

enable_performance_insights

A value that indicates whether to enable Performance Insights for the DB instance.

For more information, see Using Amazon Performance Insights in the Amazon Relational Database Service User Guide .

This setting doesn’t apply to RDS Custom.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-enableperformanceinsights

Return type

Union[bool, IResolvable, None]

engine

The name of the database engine that you want to use for this DB instance.

When you are creating a DB instance, the Engine property is required.

Valid Values:

  • aurora (for MySQL 5.6-compatible Aurora)

  • aurora-mysql (for MySQL 5.7-compatible Aurora)

  • aurora-postgresql

  • mariadb

  • mysql

  • oracle-ee

  • oracle-se2

  • oracle-se1

  • oracle-se

  • postgres

  • sqlserver-ee

  • sqlserver-se

  • sqlserver-ex

  • sqlserver-web

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-engine

Return type

Optional[str]

engine_version

The version number of the database engine to use.

For a list of valid engine versions, use the DescribeDBEngineVersions action.

The following are the database engines and links to information about the major and minor versions that are available with Amazon RDS. Not every database engine is available for every AWS Region.

Amazon Aurora

Not applicable. The version number of the database engine to be used by the DB instance is managed by the DB cluster.

MariaDB

See MariaDB on Amazon RDS Versions in the Amazon RDS User Guide.

Microsoft SQL Server

See Microsoft SQL Server Versions on Amazon RDS in the Amazon RDS User Guide.

MySQL

See MySQL on Amazon RDS Versions in the Amazon RDS User Guide.

Oracle

See Oracle Database Engine Release Notes in the Amazon RDS User Guide.

PostgreSQL

See Supported PostgreSQL Database Versions in the Amazon RDS User Guide.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-engineversion

Return type

Optional[str]

iops

The number of I/O operations per second (IOPS) that the database provisions.

The value must be equal to or greater than 1000.

If you specify this property, you must follow the range of allowed ratios of your requested IOPS rate to the amount of storage that you allocate (IOPS to allocated storage). For example, you can provision an Oracle database instance with 1000 IOPS and 200 GiB of storage (a ratio of 5:1), or specify 2000 IOPS with 200 GiB of storage (a ratio of 10:1). For more information, see Amazon RDS Provisioned IOPS Storage to Improve Performance in the Amazon RDS User Guide . .. epigraph:

If you specify ``io1`` for the ``StorageType`` property, then you must also specify the ``Iops`` property.
Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-iops

Return type

Union[int, float, None]

kms_key_id

The ARN of the AWS Key Management Service ( AWS KMS) master key that’s used to encrypt the DB instance, such as arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef .

If you enable the StorageEncrypted property but don’t specify this property, AWS CloudFormation uses the default master key. If you specify this property, you must set the StorageEncrypted property to true.

If you specify the SourceDBInstanceIdentifier property, the value is inherited from the source DB instance if the read replica is created in the same region.

If you create an encrypted read replica in a different AWS Region, then you must specify a KMS key for the destination AWS Region. KMS encryption keys are specific to the region that they’re created in, and you can’t use encryption keys from one region in another region.

If you specify the SnapshotIdentifier property, the StorageEncrypted property value is inherited from the snapshot, and if the DB instance is encrypted, the specified KmsKeyId property is used.

If you specify DBSecurityGroups , AWS CloudFormation ignores this property. To specify both a security group and this property, you must use a VPC security group. For more information about Amazon RDS and VPC, see Using Amazon RDS with Amazon VPC in the Amazon RDS User Guide .

Amazon Aurora

Not applicable. The KMS key identifier is managed by the DB cluster.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-kmskeyid

Return type

Optional[str]

license_model

License model information for this DB instance.

Valid values:

  • Aurora MySQL - general-public-license

  • Aurora PostgreSQL - postgresql-license

  • MariaDB - general-public-license

  • Microsoft SQL Server - license-included

  • MySQL - general-public-license

  • Oracle - bring-your-own-license or license-included

  • PostgreSQL - postgresql-license

If you’ve specified DBSecurityGroups and then you update the license model, AWS CloudFormation replaces the underlying DB instance. This will incur some interruptions to database availability.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-licensemodel

Return type

Optional[str]

logical_id

The logical ID for this CloudFormation stack element.

The logical ID of the element is calculated from the path of the resource node in the construct tree.

To override this value, use overrideLogicalId(newLogicalId).

Return type

str

Returns

the logical ID as a stringified token. This value will only get resolved during synthesis.

master_user_password

The password for the master user. The password can include any printable ASCII character except “/”, “””, or “@”.

Amazon Aurora

Not applicable. The password for the master user is managed by the DB cluster.

MariaDB

Constraints: Must contain from 8 to 41 characters.

Microsoft SQL Server

Constraints: Must contain from 8 to 128 characters.

MySQL

Constraints: Must contain from 8 to 41 characters.

Oracle

Constraints: Must contain from 8 to 30 characters.

PostgreSQL

Constraints: Must contain from 8 to 128 characters.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-masteruserpassword

Return type

Optional[str]

master_username

The master user name for the DB instance.

If you specify the SourceDBInstanceIdentifier or DBSnapshotIdentifier property, don’t specify this property. The value is inherited from the source DB instance or snapshot.

Amazon Aurora

Not applicable. The name for the master user is managed by the DB cluster.

MariaDB

Constraints:

  • Required for MariaDB.

  • Must be 1 to 16 letters or numbers.

  • Can’t be a reserved word for the chosen database engine.

Microsoft SQL Server

Constraints:

  • Required for SQL Server.

  • Must be 1 to 128 letters or numbers.

  • The first character must be a letter.

  • Can’t be a reserved word for the chosen database engine.

MySQL

Constraints:

  • Required for MySQL.

  • Must be 1 to 16 letters or numbers.

  • First character must be a letter.

  • Can’t be a reserved word for the chosen database engine.

Oracle

Constraints:

  • Required for Oracle.

  • Must be 1 to 30 letters or numbers.

  • First character must be a letter.

  • Can’t be a reserved word for the chosen database engine.

PostgreSQL

Constraints:

  • Required for PostgreSQL.

  • Must be 1 to 63 letters or numbers.

  • First character must be a letter.

  • Can’t be a reserved word for the chosen database engine.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-masterusername

Return type

Optional[str]

max_allocated_storage

The upper limit in gibibytes (GiB) to which Amazon RDS can automatically scale the storage of the DB instance.

For more information about this setting, including limitations that apply to it, see Managing capacity automatically with Amazon RDS storage autoscaling in the Amazon RDS User Guide .

This setting doesn’t apply to RDS Custom.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-maxallocatedstorage

Return type

Union[int, float, None]

monitoring_interval

The interval, in seconds, between points when Enhanced Monitoring metrics are collected for the DB instance.

To disable collection of Enhanced Monitoring metrics, specify 0. The default is 0.

If MonitoringRoleArn is specified, then you must set MonitoringInterval to a value other than 0.

This setting doesn’t apply to RDS Custom.

Valid Values: 0, 1, 5, 10, 15, 30, 60

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-monitoringinterval

Return type

Union[int, float, None]

monitoring_role_arn

The ARN for the IAM role that permits RDS to send enhanced monitoring metrics to Amazon CloudWatch Logs.

For example, arn:aws:iam:123456789012:role/emaccess . For information on creating a monitoring role, see Setting Up and Enabling Enhanced Monitoring in the Amazon RDS User Guide .

If MonitoringInterval is set to a value other than 0, then you must supply a MonitoringRoleArn value.

This setting doesn’t apply to RDS Custom.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-monitoringrolearn

Return type

Optional[str]

multi_az

Specifies whether the database instance is a multiple Availability Zone deployment.

You can’t set the AvailabilityZone parameter if the MultiAZ parameter is set to true.

Amazon Aurora

Not applicable. Amazon Aurora storage is replicated across all of the Availability Zones and doesn’t require the MultiAZ option to be set.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-multiaz

Return type

Union[bool, IResolvable, None]

node

The construct tree node associated with this construct.

Return type

ConstructNode

option_group_name

Indicates that the DB instance should be associated with the specified option group.

Permanent options, such as the TDE option for Oracle Advanced Security TDE, can’t be removed from an option group. Also, that option group can’t be removed from a DB instance once it is associated with a DB instance.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-optiongroupname

Return type

Optional[str]

performance_insights_kms_key_id

The AWS KMS key identifier for encryption of Performance Insights data.

The AWS KMS key identifier is the key ARN, key ID, alias ARN, or alias name for the AWS KMS customer master key (CMK).

If you do not specify a value for PerformanceInsightsKMSKeyId , then Amazon RDS uses your default CMK. There is a default CMK for your AWS account. Your AWS account has a different default CMK for each AWS Region.

For information about enabling Performance Insights, see EnablePerformanceInsights .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-performanceinsightskmskeyid

Return type

Optional[str]

performance_insights_retention_period

The amount of time, in days, to retain Performance Insights data. Valid values are 7 or 731 (2 years).

For information about enabling Performance Insights, see EnablePerformanceInsights .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-performanceinsightsretentionperiod

Return type

Union[int, float, None]

port

The port number on which the database accepts connections.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-port

Return type

Optional[str]

preferred_backup_window

The daily time range during which automated backups are created if automated backups are enabled, using the BackupRetentionPeriod parameter.

For more information, see Backup Window in the Amazon RDS User Guide.

Constraints:

  • Must be in the format hh24:mi-hh24:mi .

  • Must be in Universal Coordinated Time (UTC).

  • Must not conflict with the preferred maintenance window.

  • Must be at least 30 minutes.

Amazon Aurora

Not applicable. The daily time range for creating automated backups is managed by the DB cluster.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-preferredbackupwindow

Return type

Optional[str]

preferred_maintenance_window

The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).

Format: ddd:hh24:mi-ddd:hh24:mi

The default is a 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. To see the time blocks available, see Adjusting the Preferred DB Instance Maintenance Window in the Amazon RDS User Guide. .. epigraph:

This property applies when AWS CloudFormation initially creates the DB instance. If you use AWS CloudFormation to update the DB instance, those updates are applied immediately.

Constraints: Minimum 30-minute window.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-preferredmaintenancewindow

Return type

Optional[str]

processor_features

The number of CPU cores and the number of threads per core for the DB instance class of the DB instance.

This setting doesn’t apply to RDS Custom.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-processorfeatures

Return type

Union[IResolvable, List[Union[IResolvable, ProcessorFeatureProperty]], None]

promotion_tier

A value that specifies the order in which an Aurora Replica is promoted to the primary instance after a failure of the existing primary instance.

For more information, see Fault Tolerance for an Aurora DB Cluster in the Amazon Aurora User Guide .

This setting doesn’t apply to RDS Custom.

Default: 1

Valid Values: 0 - 15

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-promotiontier

Return type

Union[int, float, None]

publicly_accessible

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

If you specify true , AWS CloudFormation creates an instance with a publicly resolvable DNS name, which resolves to a public IP address. If you specify false, AWS CloudFormation creates an internal instance with a DNS name that resolves to a private IP address.

The default behavior value depends on your VPC setup and the database subnet group. For more information, see the PubliclyAccessible parameter in `CreateDBInstance <https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CreateDBInstance.html>`_ in the Amazon RDS API Reference .

If this resource has a public IP address and is also in a VPC that is defined in the same template, you must use the DependsOn attribute to declare a dependency on the VPC-gateway attachment. For more information, see DependsOn Attribute . .. epigraph:

If you specify DBSecurityGroups, AWS CloudFormation ignores this property. To specify a security group and this property, you must use a VPC security group. For more information about Amazon RDS and VPC, see `Using Amazon RDS with Amazon VPC <https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.html>`_ in the *Amazon RDS User Guide* .
Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-publiclyaccessible

Return type

Union[bool, IResolvable, None]

ref

Return a string that will be resolved to a CloudFormation { Ref } for this element.

If, by any chance, the intrinsic reference of a resource is not a string, you could coerce it to an IResolvable through Lazy.any({ produce: resource.ref }).

Return type

str

source_db_instance_identifier

If you want to create a read replica DB instance, specify the ID of the source DB instance.

Each DB instance can have a limited number of read replicas. For more information, see Working with Read Replicas in the Amazon Relational Database Service Developer Guide .

The SourceDBInstanceIdentifier property determines whether a DB instance is a read replica. If you remove the SourceDBInstanceIdentifier property from your template and then update your stack, AWS CloudFormation deletes the Read Replica and creates a new DB instance (not a read replica). .. epigraph:

- If you specify a source DB instance that uses VPC security groups, we recommend that you specify the ``VPCSecurityGroups`` property. If you don't specify the property, the read replica inherits the value of the ``VPCSecurityGroups`` property from the source DB when you create the replica. However, if you update the stack, AWS CloudFormation reverts the replica's ``VPCSecurityGroups`` property to the default value because it's not defined in the stack's template. This change might cause unexpected issues.
- Read replicas don't support deletion policies. AWS CloudFormation ignores any deletion policy that's associated with a read replica.
- If you specify ``SourceDBInstanceIdentifier`` , don't specify the ``DBSnapshotIdentifier`` property. You can't create a read replica from a snapshot.
- Don't set the ``BackupRetentionPeriod`` , ``DBName`` , ``MasterUsername`` , ``MasterUserPassword`` , and ``PreferredBackupWindow`` properties. The database attributes are inherited from the source DB instance, and backups are disabled for read replicas.
- If the source DB instance is in a different region than the read replica, specify the source region in ``SourceRegion`` , and specify an ARN for a valid DB instance in ``SourceDBInstanceIdentifier`` . For more information, see `Constructing a Amazon RDS Amazon Resource Name (ARN) <https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html#USER_Tagging.ARN>`_ in the *Amazon RDS User Guide* .
- For DB instances in Amazon Aurora clusters, don't specify this property. Amazon RDS automatically assigns writer and reader DB instances.
Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-sourcedbinstanceidentifier

Return type

Optional[str]

source_region

The ID of the region that contains the source DB instance for the read replica.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-sourceregion

Return type

Optional[str]

stack

The stack in which this element is defined.

CfnElements must be defined within a stack scope (directly or indirectly).

Return type

Stack

storage_encrypted

A value that indicates whether the DB instance is encrypted. By default, it isn’t encrypted.

If you specify the KmsKeyId property, then you must enable encryption.

If you specify the SnapshotIdentifier or SourceDBInstanceIdentifier property, don’t specify this property. The value is inherited from the snapshot or source DB instance, and if the DB instance is encrypted, the specified KmsKeyId property is used.

Amazon Aurora

Not applicable. The encryption for DB instances is managed by the DB cluster.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-storageencrypted

Return type

Union[bool, IResolvable, None]

storage_type

Specifies the storage type to be associated with the DB instance.

Valid values: standard | gp2 | io1

The standard value is also known as magnetic.

If you specify io1 , you must also include a value for the Iops parameter.

Default: io1 if the Iops parameter is specified, otherwise standard

For more information, see Amazon RDS DB Instance Storage in the Amazon RDS User Guide .

Amazon Aurora

Not applicable. Aurora data is stored in the cluster volume, which is a single, virtual volume that uses solid state drives (SSDs).

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-storagetype

Return type

Optional[str]

tags

Tags to assign to the DB instance.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-tags

Return type

TagManager

timezone

The time zone of the DB instance.

The time zone parameter is currently supported only by Microsoft SQL Server .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-timezone

Return type

Optional[str]

use_default_processor_features

A value that indicates whether the DB instance class of the DB instance uses its default processor features.

This setting doesn’t apply to RDS Custom.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-usedefaultprocessorfeatures

Return type

Union[bool, IResolvable, None]

vpc_security_groups

A list of the VPC security group IDs to assign to the DB instance.

The list can include both the physical IDs of existing VPC security groups and references to AWS::EC2::SecurityGroup resources created in the template.

If you plan to update the resource, don’t specify VPC security groups in a shared VPC.

If you set VPCSecurityGroups , you must not set `DBSecurityGroups <https://docs.aws.amazon.com//AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-dbsecuritygroups>`_ , and vice versa. .. epigraph:

You can migrate a DB instance in your stack from an RDS DB security group to a VPC security group, but keep the following in mind:

- You can't revert to using an RDS security group after you establish a VPC security group membership.
- When you migrate your DB instance to VPC security groups, if your stack update rolls back because the DB instance update fails or because an update fails in another AWS CloudFormation resource, the rollback fails because it can't revert to an RDS security group.
- To use the properties that are available when you use a VPC security group, you must recreate the DB instance. If you don't, AWS CloudFormation submits only the property values that are listed in the ```DBSecurityGroups`` <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-dbsecuritygroups>`_ property.

To avoid this situation, migrate your DB instance to using VPC security groups only when that is the only change in your stack template.

Amazon Aurora

Not applicable. The associated list of EC2 VPC security groups is managed by the DB cluster. If specified, the setting must match the DB cluster setting.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-database-instance.html#cfn-rds-dbinstance-vpcsecuritygroups

Return type

Optional[List[str]]

Static Methods

classmethod is_cfn_element(x)

Returns true if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of instanceof to allow stack elements from different versions of this library to be included in the same stack.

Parameters

x (Any) –

Return type

bool

Returns

The construct as a stack element or undefined if it is not a stack element.

classmethod is_cfn_resource(construct)

Check whether the given construct is a CfnResource.

Parameters

construct (IConstruct) –

Return type

bool

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters

x (Any) –

Return type

bool

DBInstanceRoleProperty

class CfnDBInstance.DBInstanceRoleProperty(*, feature_name, role_arn)

Bases: object

Describes an AWS Identity and Access Management (IAM) role that is associated with a DB instance.

Parameters
  • feature_name (str) – The name of the feature associated with the AWS Identity and Access Management (IAM) role. IAM roles that are associated with a DB instance grant permission for the DB instance to access other AWS services on your behalf. For the list of supported feature names, see the SupportedFeatureNames description in DBEngineVersion in the Amazon RDS API Reference .

  • role_arn (str) – The Amazon Resource Name (ARN) of the IAM role that is associated with the DB instance.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-dbinstance-dbinstancerole.html

ExampleMetadata

fixture=_generated

Example:

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

d_bInstance_role_property = rds.CfnDBInstance.DBInstanceRoleProperty(
    feature_name="featureName",
    role_arn="roleArn"
)

Attributes

feature_name

The name of the feature associated with the AWS Identity and Access Management (IAM) role.

IAM roles that are associated with a DB instance grant permission for the DB instance to access other AWS services on your behalf. For the list of supported feature names, see the SupportedFeatureNames description in DBEngineVersion in the Amazon RDS API Reference .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-dbinstance-dbinstancerole.html#cfn-rds-dbinstance-dbinstancerole-featurename

Return type

str

role_arn

The Amazon Resource Name (ARN) of the IAM role that is associated with the DB instance.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-dbinstance-dbinstancerole.html#cfn-rds-dbinstance-dbinstancerole-rolearn

Return type

str

ProcessorFeatureProperty

class CfnDBInstance.ProcessorFeatureProperty(*, name=None, value=None)

Bases: object

The ProcessorFeature property type specifies the processor features of a DB instance class status.

Parameters
  • name (Optional[str]) – The name of the processor feature. Valid names are coreCount and threadsPerCore .

  • value (Optional[str]) – The value of a processor feature name.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-dbinstance-processorfeature.html

ExampleMetadata

fixture=_generated

Example:

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

processor_feature_property = rds.CfnDBInstance.ProcessorFeatureProperty(
    name="name",
    value="value"
)

Attributes

name

The name of the processor feature.

Valid names are coreCount and threadsPerCore .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-dbinstance-processorfeature.html#cfn-rds-dbinstance-processorfeature-name

Return type

Optional[str]

value

The value of a processor feature name.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-dbinstance-processorfeature.html#cfn-rds-dbinstance-processorfeature-value

Return type

Optional[str]