Skip to content
v2.273.0

DatabaseInstanceReadReplica L2 construct ​

A read replica database instance.

Example ​

ts
declare const vpc: ec2.Vpc;
new rds.DatabaseInstanceFromSnapshot(this, 'Instance', {
  snapshotIdentifier: 'my-snapshot',
  engine: rds.DatabaseInstanceEngine.postgres({ version: rds.PostgresEngineVersion.VER_16_3 }),
  // optional, defaults to m5.large
  instanceType: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.LARGE),
  vpc,
});

declare const sourceInstance: rds.DatabaseInstance;
new rds.DatabaseInstanceReadReplica(this, 'ReadReplica', {
  sourceDatabaseInstance: sourceInstance,
  instanceType: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.LARGE),
  vpc,
});
python
# vpc: ec2.Vpc

# source_instance: rds.DatabaseInstance

rds.DatabaseInstanceFromSnapshot(self, "Instance",
    snapshot_identifier="my-snapshot",
    engine=rds.DatabaseInstanceEngine.postgres(version=rds.PostgresEngineVersion.VER_16_3),
    # optional, defaults to m5.large
    instance_type=ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.LARGE),
    vpc=vpc
)
rds.DatabaseInstanceReadReplica(self, "ReadReplica",
    source_database_instance=source_instance,
    instance_type=ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.LARGE),
    vpc=vpc
)
java
Vpc vpc;

DatabaseInstance sourceInstance;

DatabaseInstanceFromSnapshot.Builder.create(this, "Instance")
        .snapshotIdentifier("my-snapshot")
        .engine(DatabaseInstanceEngine.postgres(PostgresInstanceEngineProps.builder().version(PostgresEngineVersion.VER_16_3).build()))
        // optional, defaults to m5.large
        .instanceType(InstanceType.of(InstanceClass.BURSTABLE2, InstanceSize.LARGE))
        .vpc(vpc)
        .build();
DatabaseInstanceReadReplica.Builder.create(this, "ReadReplica")
        .sourceDatabaseInstance(sourceInstance)
        .instanceType(InstanceType.of(InstanceClass.BURSTABLE2, InstanceSize.LARGE))
        .vpc(vpc)
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
Vpc vpc;

DatabaseInstance sourceInstance;

new DatabaseInstanceFromSnapshot(this, "Instance", new DatabaseInstanceFromSnapshotProps {
    SnapshotIdentifier = "my-snapshot",
    Engine = DatabaseInstanceEngine.Postgres(new PostgresInstanceEngineProps { Version = PostgresEngineVersion.VER_16_3 }),
    // optional, defaults to m5.large
    InstanceType = InstanceType.Of(InstanceClass.BURSTABLE2, InstanceSize.LARGE),
    Vpc = vpc
});
new DatabaseInstanceReadReplica(this, "ReadReplica", new DatabaseInstanceReadReplicaProps {
    SourceDatabaseInstance = sourceInstance,
    InstanceType = InstanceType.Of(InstanceClass.BURSTABLE2, InstanceSize.LARGE),
    Vpc = vpc
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var vpc Vpc

var sourceInstance DatabaseInstance

rds.NewDatabaseInstanceFromSnapshot(this, jsii.String("Instance"), &DatabaseInstanceFromSnapshotProps{
	SnapshotIdentifier: jsii.String("my-snapshot"),
	Engine: rds.DatabaseInstanceEngine_Postgres(&PostgresInstanceEngineProps{
		Version: rds.PostgresEngineVersion_VER_16_3(),
	}),
	// optional, defaults to m5.large
	InstanceType: ec2.InstanceType_Of(ec2.InstanceClass_BURSTABLE2, ec2.InstanceSize_LARGE),
	Vpc: Vpc,
})
rds.NewDatabaseInstanceReadReplica(this, jsii.String("ReadReplica"), &DatabaseInstanceReadReplicaProps{
	SourceDatabaseInstance: sourceInstance,
	InstanceType: ec2.InstanceType_*Of(ec2.InstanceClass_BURSTABLE2, ec2.InstanceSize_LARGE),
	Vpc: Vpc,
})

Initializer ​

ts
new DatabaseInstanceReadReplica(scope: Construct, id: string, props: DatabaseInstanceReadReplicaProps)
python
DatabaseInstanceReadReplica(scope: Construct, id: str, props: DatabaseInstanceReadReplicaProps)
java
new DatabaseInstanceReadReplica(Construct scope, String id, DatabaseInstanceReadReplicaProps props)
csharp
new DatabaseInstanceReadReplica(Construct scope, string id, DatabaseInstanceReadReplicaProps props)
go
NewDatabaseInstanceReadReplica(Scope Construct, Id *string, Props DatabaseInstanceReadReplicaProps)

Construct Props ​

allocatedStoragenumberallocated_storageint | floatallocatedStorageNumberAllocatedStoragedoubleAllocatedStorage*float64= The replica will inherit the all…#
The allocated storage size, specified in gibibytes (GiB).
default

Default: The replica will inherit the allocated storage of the source database instance

applyImmediatelybooleanapply_immediatelyboolapplyImmediatelyBooleanApplyImmediatelyboolApplyImmediately*bool= Changes will be applied immediat…#
Specifies whether changes to the DB instance and any pending modifications are applied immediately, regardless of the `preferredMaintenanceWindow` setting.
notes · default

If set to false, changes are applied during the next maintenance window.

Until RDS applies the changes, the DB instance remains in a drift state. As a result, the configuration doesn't fully reflect the requested modifications and temporarily diverges from the intended state.

This property also determines whether the DB instance reboots when a static parameter is modified in the associated DB parameter group.

Default: Changes will be applied immediately

autoMinorVersionUpgradebooleanauto_minor_version_upgradeboolautoMinorVersionUpgradeBooleanAutoMinorVersionUpgradeboolAutoMinorVersionUpgrade*bool= true#
Indicates that minor engine upgrades are applied automatically to the DB instance during the maintenance window.
availabilityZonestringavailability_zonestravailabilityZoneStringAvailabilityZonestringAvailabilityZone*string= no preference#
The name of the Availability Zone where the DB instance will be located.
backupRetentionDurationbackup_retentionDurationbackupRetentionDurationBackupRetentionDurationBackupRetentionDuration= Duration.days(1) for source inst…#
The number of days during which automatic DB snapshots are retained.

Set to zero to disable backups. When creating a read replica, you must enable automatic backups on the source database instance by setting the backup retention to a value other than zero.

default

Default: Duration.days(1) for source instances, disabled for read replicas

caCertificateCaCertificateca_certificateCaCertificatecaCertificateCaCertificateCaCertificateCaCertificateCaCertificateCaCertificate= RDS will choose a certificate au…#
The identifier of the CA certificate for this DB instance.

Specifying or updating this property triggers a reboot.

For RDS DB engines:

default

Default: RDS will choose a certificate authority

cloudwatchLogsExportsstring[]cloudwatch_logs_exportstyping.List[str]cloudwatchLogsExportsList<String>CloudwatchLogsExportsstring[]CloudwatchLogsExports*[]*string= no log exports#
The list of log types that need to be enabled for exporting to CloudWatch Logs.
cloudwatchLogsRetentionRetentionDayscloudwatch_logs_retentionRetentionDayscloudwatchLogsRetentionRetentionDaysCloudwatchLogsRetentionRetentionDaysCloudwatchLogsRetentionRetentionDays= logs never expire#
The number of days log events are kept in CloudWatch Logs.

When updating this property, unsetting it doesn't remove the log retention policy. To remove the retention policy, set the value to Infinity.

cloudwatchLogsRetentionRoleIRolecloudwatch_logs_retention_roleIRolecloudwatchLogsRetentionRoleIRoleCloudwatchLogsRetentionRoleIRoleCloudwatchLogsRetentionRoleIRole= a new role is created.#
The IAM role for the Lambda function associated with the custom resource that sets the retention policy.
copyTagsToSnapshotbooleancopy_tags_to_snapshotboolcopyTagsToSnapshotBooleanCopyTagsToSnapshotboolCopyTagsToSnapshot*bool= true#
Indicates whether to copy all of the user-defined tags from the DB instance to snapshots of the DB instance.
databaseInsightsModeDatabaseInsightsModedatabase_insights_modeDatabaseInsightsModedatabaseInsightsModeDatabaseInsightsModeDatabaseInsightsModeDatabaseInsightsModeDatabaseInsightsModeDatabaseInsightsMode= DatabaseInsightsMode.STANDARD wh…#
The database insights mode.
default

Default: DatabaseInsightsMode.STANDARD when performance insights are enabled, otherwise not set.

deleteAutomatedBackupsbooleandelete_automated_backupsbooldeleteAutomatedBackupsBooleanDeleteAutomatedBackupsboolDeleteAutomatedBackups*bool= true#
Indicates whether automated backups should be deleted or retained when you delete a DB instance.
deletionProtectionbooleandeletion_protectionbooldeletionProtectionBooleanDeletionProtectionboolDeletionProtection*bool= true if ``removalPolicy`` is RET…#
Indicates whether the DB instance should have deletion protection enabled.
default

Default: true if removalPolicy is RETAIN, false otherwise

domainstringdomainstrdomainStringDomainstringDomain*string= Do not join domain#
The Active Directory directory ID to create the DB instance in.
domainRoleIRoleRefdomain_roleIRoleRefdomainRoleIRoleRefDomainRoleIRoleRefDomainRoleIRoleRef= The role will be created for you…#
The IAM role to be used when making API calls to the Directory Service.

The role needs the AWS-managed policy AmazonRDSDirectoryServiceAccess or equivalent.

default

Default: The role will be created for you if DatabaseInstanceNewProps#domain is specified

enablePerformanceInsightsbooleanenable_performance_insightsboolenablePerformanceInsightsBooleanEnablePerformanceInsightsboolEnablePerformanceInsights*bool= false, unless ``performanceInsig…#
Whether to enable Performance Insights for the DB instance.
default

Default: false, unless performanceInsightRetention or performanceInsightEncryptionKey is set.

engineLifecycleSupportEngineLifecycleSupportengine_lifecycle_supportEngineLifecycleSupportengineLifecycleSupportEngineLifecycleSupportEngineLifecycleSupportEngineLifecycleSupportEngineLifecycleSupportEngineLifecycleSupport= undefined - AWS RDS default sett…#
The life cycle type for this DB instance.

This setting applies only to RDS for MySQL and RDS for PostgreSQL.

default

Default: undefined - AWS RDS default setting is EngineLifecycleSupport.OPEN_SOURCE_RDS_EXTENDED_SUPPORT

iamAuthenticationbooleaniam_authenticationbooliamAuthenticationBooleanIamAuthenticationboolIamAuthentication*bool= false#
Whether to enable mapping of AWS Identity and Access Management (IAM) accounts to database accounts.
instanceIdentifierstringinstance_identifierstrinstanceIdentifierStringInstanceIdentifierstringInstanceIdentifier*string= a CloudFormation generated name#
A name for the DB instance.

If you specify a name, AWS CloudFormation converts it to lowercase.

instanceTypeInstanceTypeinstance_typeInstanceTypeinstanceTypeInstanceTypeInstanceTypeInstanceTypeInstanceTypeInstanceTyperequired#
The name of the compute and memory capacity classes.
iopsnumberiopsint | floatiopsNumberIopsdoubleIops*float64= no provisioned iops if storage t…#
The number of I/O operations per second (IOPS) that the database provisions.

The value must be equal to or greater than 1000.

default

Default: no provisioned iops if storage type is not specified. For GP3: 3,000 IOPS if allocated storage is less than 400 GiB for MariaDB, MySQL, and PostgreSQL, less than 200 GiB for Oracle and less than 20 GiB for SQL Server. 12,000 IOPS otherwise (except for SQL Server where the default is always 3,000 IOPS).

maxAllocatedStoragenumbermax_allocated_storageint | floatmaxAllocatedStorageNumberMaxAllocatedStoragedoubleMaxAllocatedStorage*float64= No autoscaling of RDS instance#
Upper limit to which RDS can scale the storage in GiB(Gibibyte).
monitoringIntervalDurationmonitoring_intervalDurationmonitoringIntervalDurationMonitoringIntervalDurationMonitoringIntervalDuration= no enhanced monitoring#
The interval, in seconds, between points when Amazon RDS collects enhanced monitoring metrics for the DB instance.
monitoringRoleIRoleRefmonitoring_roleIRoleRefmonitoringRoleIRoleRefMonitoringRoleIRoleRefMonitoringRoleIRoleRef= A role is automatically created …#
Role that will be used to manage DB instance monitoring.
default

Default: A role is automatically created for you

multiAzbooleanmulti_azboolmultiAzBooleanMultiAzboolMultiAz*bool= false#
Specifies if the database instance is a multiple Availability Zone deployment.
networkTypeNetworkTypenetwork_typeNetworkTypenetworkTypeNetworkTypeNetworkTypeNetworkTypeNetworkTypeNetworkType= IPV4#
The network type of the DB instance.
optionGroupIOptionGroupoption_groupIOptionGroupoptionGroupIOptionGroupOptionGroupIOptionGroupOptionGroupIOptionGroup= no option group#
The option group to associate with the instance.
parameterGroupIParameterGroupparameter_groupIParameterGroupparameterGroupIParameterGroupParameterGroupIParameterGroupParameterGroupIParameterGroup= no parameter group#
The DB parameter group to associate with the instance.
performanceInsightEncryptionKeyIKeyRefperformance_insight_encryption_keyIKeyRefperformanceInsightEncryptionKeyIKeyRefPerformanceInsightEncryptionKeyIKeyRefPerformanceInsightEncryptionKeyIKeyRef= default master key#
The AWS KMS key for encryption of Performance Insights data.
performanceInsightRetentionPerformanceInsightRetentionperformance_insight_retentionPerformanceInsightRetentionperformanceInsightRetentionPerformanceInsightRetentionPerformanceInsightRetentionPerformanceInsightRetentionPerformanceInsightRetentionPerformanceInsightRetention= 7 this is the free tier#
The amount of time, in days, to retain Performance Insights data.

If you set databaseInsightsMode to DatabaseInsightsMode.ADVANCED, you must set this property to PerformanceInsightRetention.MONTHS_15.

portnumberportint | floatportNumberPortdoublePort*float64= the default port for the chosen …#
The port for the instance.
default

Default: the default port for the chosen engine.

preferredBackupWindowstringpreferred_backup_windowstrpreferredBackupWindowStringPreferredBackupWindowstringPreferredBackupWindow*string= a 30-minute window selected at r…#
The daily time range during which automated backups are performed.

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.
default

Default: a 30-minute window selected at random from an 8-hour block of time for each AWS Region. To see the time blocks available, see https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_WorkingWithAutomatedBackups.html#USER_WorkingWithAutomatedBackups.BackupWindow

preferredMaintenanceWindowstringpreferred_maintenance_windowstrpreferredMaintenanceWindowStringPreferredMaintenanceWindowstringPreferredMaintenanceWindow*string= a 30-minute window selected at r…#
The weekly time range (in UTC) during which system maintenance can occur.

Format: ddd:hh24:mi-ddd:hh24:mi Constraint: Minimum 30-minute window

default

Default: 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 https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_UpgradeDBInstance.Maintenance.html#Concepts.DBMaintenance

processorFeaturesProcessorFeaturesprocessor_featuresProcessorFeaturesprocessorFeaturesProcessorFeaturesProcessorFeaturesProcessorFeaturesProcessorFeaturesProcessorFeatures= the default number of CPU cores …#
The number of CPU cores and the number of threads per core.
default

Default: the default number of CPU cores and threads per core for the chosen instance class. See https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.DBInstanceClass.html#USER_ConfigureProcessor

publiclyAccessiblebooleanpublicly_accessibleboolpubliclyAccessibleBooleanPubliclyAccessibleboolPubliclyAccessible*bool= `true` if the instance's `vpcSub…#
Indicates whether the DB instance is an internet-facing instance.

If not specified, the instance's vpcSubnets will be used to determine if the instance is internet-facing or not.

default

Default: true if the instance's vpcSubnets is subnetType: SubnetType.PUBLIC, false otherwise

removalPolicyRemovalPolicyremoval_policyRemovalPolicyremovalPolicyRemovalPolicyRemovalPolicyRemovalPolicyRemovalPolicyRemovalPolicy= RemovalPolicy.SNAPSHOT (remove t…#
The CloudFormation policy to apply when the instance is removed from the stack or replaced during an update.
default

Default: RemovalPolicy.SNAPSHOT (remove the resource, but retain a snapshot of the data)

s3ExportBucketsIBucket[]s3_export_bucketstyping.List[IBucket]s3ExportBucketsList<IBucket>S3ExportBucketsIBucket[]S3ExportBuckets*[]IBucket= None#
S3 buckets that you want to load data into.

This property must not be used if s3ExportRole is used.

For Microsoft SQL Server:

s3ExportRoleIRoles3_export_roleIRoles3ExportRoleIRoleS3ExportRoleIRoleS3ExportRoleIRole= New role is created if `s3Export…#
Role that will be associated with this DB instance to enable S3 export.

This property must not be used if s3ExportBuckets is used.

For Microsoft SQL Server:

default

Default: New role is created if s3ExportBuckets is set, no role is defined otherwise

s3ImportBucketsIBucket[]s3_import_bucketstyping.List[IBucket]s3ImportBucketsList<IBucket>S3ImportBucketsIBucket[]S3ImportBuckets*[]IBucket= None#
S3 buckets that you want to load data from.

This feature is only supported by the Microsoft SQL Server, Oracle, and PostgreSQL engines.

This property must not be used if s3ImportRole is used.

For Microsoft SQL Server:

s3ImportRoleIRoles3_import_roleIRoles3ImportRoleIRoleS3ImportRoleIRoleS3ImportRoleIRole= New role is created if `s3Import…#
Role that will be associated with this DB instance to enable S3 import.

This feature is only supported by the Microsoft SQL Server, Oracle, and PostgreSQL engines.

This property must not be used if s3ImportBuckets is used.

For Microsoft SQL Server:

default

Default: New role is created if s3ImportBuckets is set, no role is defined otherwise

securityGroupsISecurityGroup[]security_groupstyping.List[ISecurityGroup]securityGroupsList<ISecurityGroup>SecurityGroupsISecurityGroup[]SecurityGroups*[]ISecurityGroup= a new security group is created#
The security groups to assign to the DB instance.
sourceDatabaseInstanceIDatabaseInstancesource_database_instanceIDatabaseInstancesourceDatabaseInstanceIDatabaseInstanceSourceDatabaseInstanceIDatabaseInstanceSourceDatabaseInstanceIDatabaseInstancerequired#
The source database instance.

Each DB instance can have a limited number of read replicas. For more information, see https://docs.aws.amazon.com/AmazonRDS/latest/DeveloperGuide/USER_ReadRepl.html.

storageEncryptedbooleanstorage_encryptedboolstorageEncryptedBooleanStorageEncryptedboolStorageEncrypted*bool= true if storageEncryptionKey has…#
Indicates whether the DB instance is encrypted.
default

Default: true if storageEncryptionKey has been provided, false otherwise

storageEncryptionKeyIKeyRefstorage_encryption_keyIKeyRefstorageEncryptionKeyIKeyRefStorageEncryptionKeyIKeyRefStorageEncryptionKeyIKeyRef= default master key if storageEnc…#
The KMS key that's used to encrypt the DB instance.
default

Default: default master key if storageEncrypted is true, no key otherwise

storageThroughputnumberstorage_throughputint | floatstorageThroughputNumberStorageThroughputdoubleStorageThroughput*float64= 125 MiBps if allocated storage i…#
The storage throughput, specified in mebibytes per second (MiBps).

Only applicable for GP3.

default

Default: 125 MiBps if allocated storage is less than 400 GiB for MariaDB, MySQL, and PostgreSQL, less than 200 GiB for Oracle and less than 20 GiB for SQL Server. 500 MiBps otherwise (except for SQL Server where the default is always 125 MiBps).

storageTypeStorageTypestorage_typeStorageTypestorageTypeStorageTypeStorageTypeStorageTypeStorageTypeStorageType= StorageType.GP2#
The storage type to associate with the DB instance.

Storage types supported are gp2, gp3, io1, io2, and standard.

subnetGroupIDBSubnetGroupRefsubnet_groupIDBSubnetGroupRefsubnetGroupIDBSubnetGroupRefSubnetGroupIDBSubnetGroupRefSubnetGroupIDBSubnetGroupRef= a new subnet group will be creat…#
Existing subnet group for the instance.
default

Default: a new subnet group will be created.

vpcIVpcvpcIVpcvpcIVpcVpcIVpcVpcIVpcrequired#
The VPC network where the DB subnet group should be created.
vpcSubnetsSubnetSelectionvpc_subnetsSubnetSelectionvpcSubnetsSubnetSelectionVpcSubnetsSubnetSelectionVpcSubnetsSubnetSelection= private subnets#
The type of subnets to add to the created DB subnet group.

Properties ​

cloudwatchLogGroups{ [key: string]: ILogGroup }cloudwatch_log_groupstyping.Mapping[str, ILogGroup]cloudwatchLogGroupsMap<String, ILogGroup>CloudwatchLogGroupsIDictionary<string, ILogGroup>CloudwatchLogGroups*map[string]ILogGrouprequired#
The log group is created when `cloudwatchLogsExports` is set.

Each export value will create a separate log group.

connectionsConnectionsconnectionsConnectionsconnectionsConnectionsConnectionsConnectionsConnectionsConnectionsrequired#
Access to network connections.
dbInstanceEndpointAddressstringdb_instance_endpoint_addressstrdbInstanceEndpointAddressStringDbInstanceEndpointAddressstringDbInstanceEndpointAddress*stringrequired#
The instance endpoint address.
dbInstanceEndpointPortstringdb_instance_endpoint_portstrdbInstanceEndpointPortStringDbInstanceEndpointPortstringDbInstanceEndpointPort*stringrequired#
The instance endpoint port.
dbInstanceRefDBInstanceReferencedb_instance_refDBInstanceReferencedbInstanceRefDBInstanceReferenceDbInstanceRefDBInstanceReferenceDbInstanceRefDBInstanceReferencerequired#
A reference to this database instance.
The engine of this database Instance.

May be not known for imported Instances if it wasn't provided explicitly, or for read replicas.

The environment this resource belongs to.
notes

For resources that are created and managed in a Stack (those created by creating new class instances like new Role(), new Bucket(), etc.), this is always the same as the environment of the stack they belong to.

For referenced resources (those obtained from referencing methods like Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be different than the stack they were imported into.

instanceArnstringinstance_arnstrinstanceArnStringInstanceArnstringInstanceArn*stringrequired#
The instance arn.
instanceEndpointEndpointinstance_endpointEndpointinstanceEndpointEndpointInstanceEndpointEndpointInstanceEndpointEndpointrequired#
The instance endpoint.
instanceIdentifierstringinstance_identifierstrinstanceIdentifierStringInstanceIdentifierstringInstanceIdentifier*stringrequired#
The instance identifier.
instanceResourceIdstringinstance_resource_idstrinstanceResourceIdStringInstanceResourceIdstringInstanceResourceId*string#
The AWS Region-unique, immutable identifier for the DB instance.

This identifier is found in AWS CloudTrail log entries whenever the AWS KMS key for the DB instance is accessed.

nodeNodenodeNodenodeNodeNodeNodeNodeNoderequired#
The tree node.
PROPERTY_INJECTION_IDstringproperty_injection_idstrPROPERTY_INJECTION_IDStringPROPERTY_INJECTION_IDstringPROPERTY_INJECTION_ID*stringrequiredstatic#
Uniquely identifies this class.
stackStackstackStackstackStackStackStackStackStackrequired#
The stack in which this resource is defined.
vpcIVpcvpcIVpcvpcIVpcVpcIVpcVpcIVpcrequired#
The VPC where this database instance is deployed.

Methods ​

addProxy(id: string, options: DatabaseProxyOptions): DatabaseProxydef add_proxy(self, id: str, options: DatabaseProxyOptions) -> DatabaseProxypublic DatabaseProxy addProxy(String id, DatabaseProxyOptions options)public DatabaseProxy AddProxy(string id, DatabaseProxyOptions options)func AddProxy(Id *string, Options DatabaseProxyOptions) DatabaseProxy#
Add a new db proxy to this instance.
applyCrossStackReferenceStrength(strength: ReferenceStrength): voiddef apply_cross_stack_reference_strength(self, strength: ReferenceStrength) -> Nonepublic void applyCrossStackReferenceStrength(ReferenceStrength strength)public void ApplyCrossStackReferenceStrength(ReferenceStrength strength)func ApplyCrossStackReferenceStrength(Strength ReferenceStrength)#
Override the cross-stack reference strength for this resource.
notes · 1 parameter

When set, any cross-stack reference to this resource will use the specified mechanism instead of the global default determined by the @aws-cdk/core:defaultCrossStackReferences context key. This is useful for selectively weakening specific references to avoid the "deadly embrace" problem without changing the app-wide default.

Parameters

  • strengthstrengthstrengthstrengthStrength — - The reference strength to use for this resource.
applyRemovalPolicy(policy: RemovalPolicy): voiddef apply_removal_policy(self, policy: RemovalPolicy) -> Nonepublic void applyRemovalPolicy(RemovalPolicy policy)public void ApplyRemovalPolicy(RemovalPolicy policy)func ApplyRemovalPolicy(Policy RemovalPolicy)#
Apply the given removal policy to this resource.
notes

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).

asSecretAttachmentTarget(): SecretAttachmentTargetPropsdef as_secret_attachment_target(self, ) -> SecretAttachmentTargetPropspublic SecretAttachmentTargetProps asSecretAttachmentTarget()public SecretAttachmentTargetProps AsSecretAttachmentTarget()func AsSecretAttachmentTarget() SecretAttachmentTargetProps#
Renders the secret attachment target specifications.
fromDatabaseInstanceAttributes(scope: Construct, id: string, attrs: DatabaseInstanceAttributes): IDatabaseInstance@staticmethod def from_database_instance_attributes(scope: Construct, id: str, attrs: DatabaseInstanceAttributes) -> IDatabaseInstancepublic static IDatabaseInstance fromDatabaseInstanceAttributes(Construct scope, String id, DatabaseInstanceAttributes attrs)public static IDatabaseInstance FromDatabaseInstanceAttributes(Construct scope, string id, DatabaseInstanceAttributes attrs)func FromDatabaseInstanceAttributes(Scope Construct, Id *string, Attrs DatabaseInstanceAttributes) IDatabaseInstancestatic#
Import an existing database instance.
fromLookup(scope: Construct, id: string, options: DatabaseInstanceLookupOptions): IDatabaseInstance@staticmethod def from_lookup(scope: Construct, id: str, options: DatabaseInstanceLookupOptions) -> IDatabaseInstancepublic static IDatabaseInstance fromLookup(Construct scope, String id, DatabaseInstanceLookupOptions options)public static IDatabaseInstance FromLookup(Construct scope, string id, DatabaseInstanceLookupOptions options)func FromLookup(Scope Construct, Id *string, Options DatabaseInstanceLookupOptions) IDatabaseInstancestatic#
Lookup an existing DatabaseInstance using instanceIdentifier.
grantConnect(grantee: IGrantable, dbUser?: string): Grantdef grant_connect(self, grantee: IGrantable, db_user: typing.Optional[str] = None) -> Grantpublic Grant grantConnect(IGrantable grantee, String dbUser)public Grant GrantConnect(IGrantable grantee, string? dbUser = null)func GrantConnect(Grantee IGrantable, DbUser *string) Grant#
[disable-awslint:no-grants].
isConstruct(x: any): boolean@staticmethod def is_construct(x: Any) -> boolpublic static Boolean isConstruct(Object x)public static bool IsConstruct(object x)func IsConstruct(X interface{}) *boolstatic#
Checks if `x` is a construct.
notes · 1 parameter · returns

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

Parameters

  • xxxxX — Any object.

Returns: true if x is an object created from a class which extends Construct.

isOwnedResource(construct: IConstruct): boolean@staticmethod def is_owned_resource(construct: IConstruct) -> boolpublic static Boolean isOwnedResource(IConstruct construct)public static bool IsOwnedResource(IConstruct construct)func IsOwnedResource(Construct IConstruct) *boolstatic#
Returns true if the construct was created by CDK, and false otherwise.
isResource(construct: IConstruct): boolean@staticmethod def is_resource(construct: IConstruct) -> boolpublic static Boolean isResource(IConstruct construct)public static bool IsResource(IConstruct construct)func IsResource(Construct IConstruct) *boolstatic#
Check whether the given construct is a Resource.
metric(metricName: string, props?: MetricOptions): Metricdef metric(self, metric_name: str, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metric(String metricName, MetricOptions props)public Metric Metric(string metricName, MetricOptions? props = null)func Metric(MetricName *string, Props MetricOptions) Metric#
Return the given named metric for this DBInstance.
metricCPUUtilization(props?: MetricOptions): Metricdef metric_cpu_utilization(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricCPUUtilization(MetricOptions props)public Metric MetricCPUUtilization(MetricOptions? props = null)func MetricCPUUtilization(Props MetricOptions) Metric#
The percentage of CPU utilization.

Average over 5 minutes

metricDatabaseConnections(props?: MetricOptions): Metricdef metric_database_connections(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricDatabaseConnections(MetricOptions props)public Metric MetricDatabaseConnections(MetricOptions? props = null)func MetricDatabaseConnections(Props MetricOptions) Metric#
The number of database connections in use.

Average over 5 minutes

metricFreeableMemory(props?: MetricOptions): Metricdef metric_freeable_memory(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricFreeableMemory(MetricOptions props)public Metric MetricFreeableMemory(MetricOptions? props = null)func MetricFreeableMemory(Props MetricOptions) Metric#
The amount of available random access memory.

Average over 5 minutes

metricFreeStorageSpace(props?: MetricOptions): Metricdef metric_free_storage_space(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricFreeStorageSpace(MetricOptions props)public Metric MetricFreeStorageSpace(MetricOptions? props = null)func MetricFreeStorageSpace(Props MetricOptions) Metric#
The amount of available storage space.

Average over 5 minutes

metricReadIOPS(props?: MetricOptions): Metricdef metric_read_iops(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricReadIOPS(MetricOptions props)public Metric MetricReadIOPS(MetricOptions? props = null)func MetricReadIOPS(Props MetricOptions) Metric#
The average number of disk read I/O operations per second. The average number of disk write I/O operations per second.

Average over 5 minutes

metricWriteIOPS(props?: MetricOptions): Metricdef metric_write_iops(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricWriteIOPS(MetricOptions props)public Metric MetricWriteIOPS(MetricOptions? props = null)func MetricWriteIOPS(Props MetricOptions) Metric#
The average number of disk write I/O operations per second. The average number of disk read I/O operations per second.

Average over 5 minutes

onEvent(id: string, options?: OnEventOptions): Ruledef on_event(self, id: str, options: typing.Optional[OnEventOptions] = None) -> Rulepublic Rule onEvent(String id, OnEventOptions options)public Rule OnEvent(string id, OnEventOptions? options = null)func OnEvent(Id *string, Options OnEventOptions) Rule#
Defines a CloudWatch event rule which triggers for instance events.

Use rule.addEventPattern(pattern) to specify a filter.

toString(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string#
Returns a string representation of this construct.
with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) IConstruct#
Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.