interface DatabaseInstanceSourceProps
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.RDS.DatabaseInstanceSourceProps |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awsrds#DatabaseInstanceSourceProps |
![]() | software.amazon.awscdk.services.rds.DatabaseInstanceSourceProps |
![]() | aws_cdk.aws_rds.DatabaseInstanceSourceProps |
![]() | aws-cdk-lib » aws_rds » DatabaseInstanceSourceProps |
Construction properties for a DatabaseInstanceSource.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
import { aws_ec2 as ec2 } from 'aws-cdk-lib';
import { aws_iam as iam } from 'aws-cdk-lib';
import { aws_kms as kms } from 'aws-cdk-lib';
import { aws_logs as logs } from 'aws-cdk-lib';
import { aws_rds as rds } from 'aws-cdk-lib';
import { aws_s3 as s3 } from 'aws-cdk-lib';
declare const bucket: s3.Bucket;
declare const caCertificate: rds.CaCertificate;
declare const instanceEngine: rds.IInstanceEngine;
declare const instanceType: ec2.InstanceType;
declare const key: kms.Key;
declare const optionGroup: rds.OptionGroup;
declare const parameterGroup: rds.ParameterGroup;
declare const role: iam.Role;
declare const securityGroup: ec2.SecurityGroup;
declare const subnet: ec2.Subnet;
declare const subnetFilter: ec2.SubnetFilter;
declare const subnetGroup: rds.SubnetGroup;
declare const vpc: ec2.Vpc;
const databaseInstanceSourceProps: rds.DatabaseInstanceSourceProps = {
engine: instanceEngine,
vpc: vpc,
// the properties below are optional
allocatedStorage: 123,
allowMajorVersionUpgrade: false,
autoMinorVersionUpgrade: false,
availabilityZone: 'availabilityZone',
backupRetention: cdk.Duration.minutes(30),
caCertificate: caCertificate,
cloudwatchLogsExports: ['cloudwatchLogsExports'],
cloudwatchLogsRetention: logs.RetentionDays.ONE_DAY,
cloudwatchLogsRetentionRole: role,
copyTagsToSnapshot: false,
databaseName: 'databaseName',
deleteAutomatedBackups: false,
deletionProtection: false,
domain: 'domain',
domainRole: role,
enablePerformanceInsights: false,
iamAuthentication: false,
instanceIdentifier: 'instanceIdentifier',
instanceType: instanceType,
iops: 123,
licenseModel: rds.LicenseModel.LICENSE_INCLUDED,
maxAllocatedStorage: 123,
monitoringInterval: cdk.Duration.minutes(30),
monitoringRole: role,
multiAz: false,
networkType: rds.NetworkType.IPV4,
optionGroup: optionGroup,
parameterGroup: parameterGroup,
parameters: {
parametersKey: 'parameters',
},
performanceInsightEncryptionKey: key,
performanceInsightRetention: rds.PerformanceInsightRetention.DEFAULT,
port: 123,
preferredBackupWindow: 'preferredBackupWindow',
preferredMaintenanceWindow: 'preferredMaintenanceWindow',
processorFeatures: {
coreCount: 123,
threadsPerCore: 123,
},
publiclyAccessible: false,
removalPolicy: cdk.RemovalPolicy.DESTROY,
s3ExportBuckets: [bucket],
s3ExportRole: role,
s3ImportBuckets: [bucket],
s3ImportRole: role,
securityGroups: [securityGroup],
storageThroughput: 123,
storageType: rds.StorageType.STANDARD,
subnetGroup: subnetGroup,
timezone: 'timezone',
vpcSubnets: {
availabilityZones: ['availabilityZones'],
onePerAz: false,
subnetFilters: [subnetFilter],
subnetGroupName: 'subnetGroupName',
subnets: [subnet],
subnetType: ec2.SubnetType.PRIVATE_ISOLATED,
},
};
Properties
Name | Type | Description |
---|---|---|
engine | IInstance | The database engine. |
vpc | IVpc | The VPC network where the DB subnet group should be created. |
allocated | number | The allocated storage size, specified in gibibytes (GiB). |
allow | boolean | Whether to allow major version upgrades. |
auto | boolean | Indicates that minor engine upgrades are applied automatically to the DB instance during the maintenance window. |
availability | string | The name of the Availability Zone where the DB instance will be located. |
backup | Duration | The number of days during which automatic DB snapshots are retained. |
ca | Ca | The identifier of the CA certificate for this DB instance. |
cloudwatch | string[] | The list of log types that need to be enabled for exporting to CloudWatch Logs. |
cloudwatch | Retention | The number of days log events are kept in CloudWatch Logs. |
cloudwatch | IRole | The IAM role for the Lambda function associated with the custom resource that sets the retention policy. |
copy | boolean | Indicates whether to copy all of the user-defined tags from the DB instance to snapshots of the DB instance. |
database | string | The name of the database. |
delete | boolean | Indicates whether automated backups should be deleted or retained when you delete a DB instance. |
deletion | boolean | Indicates whether the DB instance should have deletion protection enabled. |
domain? | string | The Active Directory directory ID to create the DB instance in. |
domain | IRole | The IAM role to be used when making API calls to the Directory Service. |
enable | boolean | Whether to enable Performance Insights for the DB instance. |
iam | boolean | Whether to enable mapping of AWS Identity and Access Management (IAM) accounts to database accounts. |
instance | string | A name for the DB instance. |
instance | Instance | The name of the compute and memory capacity for the instance. |
iops? | number | The number of I/O operations per second (IOPS) that the database provisions. |
license | License | The license model. |
max | number | Upper limit to which RDS can scale the storage in GiB(Gibibyte). |
monitoring | Duration | The interval, in seconds, between points when Amazon RDS collects enhanced monitoring metrics for the DB instance. |
monitoring | IRole | Role that will be used to manage DB instance monitoring. |
multi | boolean | Specifies if the database instance is a multiple Availability Zone deployment. |
network | Network | The network type of the DB instance. |
option | IOption | The option group to associate with the instance. |
parameter | IParameter | The DB parameter group to associate with the instance. |
parameters? | { [string]: string } | The parameters in the DBParameterGroup to create automatically. |
performance | IKey | The AWS KMS key for encryption of Performance Insights data. |
performance | Performance | The amount of time, in days, to retain Performance Insights data. |
port? | number | The port for the instance. |
preferred | string | The daily time range during which automated backups are performed. |
preferred | string | The weekly time range (in UTC) during which system maintenance can occur. |
processor | Processor | The number of CPU cores and the number of threads per core. |
publicly | boolean | Indicates whether the DB instance is an internet-facing instance. |
removal | Removal | The CloudFormation policy to apply when the instance is removed from the stack or replaced during an update. |
s3 | IBucket [] | S3 buckets that you want to load data into. |
s3 | IRole | Role that will be associated with this DB instance to enable S3 export. |
s3 | IBucket [] | S3 buckets that you want to load data from. |
s3 | IRole | Role that will be associated with this DB instance to enable S3 import. |
security | ISecurity [] | The security groups to assign to the DB instance. |
storage | number | The storage throughput, specified in mebibytes per second (MiBps). |
storage | Storage | The storage type. |
subnet | ISubnet | Existing subnet group for the instance. |
timezone? | string | The time zone of the instance. |
vpc | Subnet | The type of subnets to add to the created DB subnet group. |
engine
Type:
IInstance
The database engine.
vpc
Type:
IVpc
The VPC network where the DB subnet group should be created.
allocatedStorage?
Type:
number
(optional, default: 100)
The allocated storage size, specified in gibibytes (GiB).
allowMajorVersionUpgrade?
Type:
boolean
(optional, default: false)
Whether to allow major version upgrades.
autoMinorVersionUpgrade?
Type:
boolean
(optional, default: true)
Indicates that minor engine upgrades are applied automatically to the DB instance during the maintenance window.
availabilityZone?
Type:
string
(optional, default: no preference)
The name of the Availability Zone where the DB instance will be located.
backupRetention?
Type:
Duration
(optional, default: Duration.days(1) for source instances, disabled for read replicas)
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.
caCertificate?
Type:
Ca
(optional, default: RDS will choose a certificate authority)
The identifier of the CA certificate for this DB instance.
Specifying or updating this property triggers a reboot.
For RDS DB engines:
cloudwatchLogsExports?
Type:
string[]
(optional, default: no log exports)
The list of log types that need to be enabled for exporting to CloudWatch Logs.
cloudwatchLogsRetention?
Type:
Retention
(optional, default: 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
.
cloudwatchLogsRetentionRole?
Type:
IRole
(optional, default: a new role is created.)
The IAM role for the Lambda function associated with the custom resource that sets the retention policy.
copyTagsToSnapshot?
Type:
boolean
(optional, default: true)
Indicates whether to copy all of the user-defined tags from the DB instance to snapshots of the DB instance.
databaseName?
Type:
string
(optional, default: no name)
The name of the database.
deleteAutomatedBackups?
Type:
boolean
(optional, default: true)
Indicates whether automated backups should be deleted or retained when you delete a DB instance.
deletionProtection?
Type:
boolean
(optional, default: true if removalPolicy
is RETAIN, false otherwise)
Indicates whether the DB instance should have deletion protection enabled.
domain?
Type:
string
(optional, default: Do not join domain)
The Active Directory directory ID to create the DB instance in.
domainRole?
Type:
IRole
(optional, default: The role will be created for you if DatabaseInstanceNewProps#domain
is specified)
The IAM role to be used when making API calls to the Directory Service.
The role needs the AWS-managed policy AmazonRDSDirectoryServiceAccess or equivalent.
enablePerformanceInsights?
Type:
boolean
(optional, default: false, unless performanceInsightRetention
or performanceInsightEncryptionKey
is set.)
Whether to enable Performance Insights for the DB instance.
iamAuthentication?
Type:
boolean
(optional, default: false)
Whether to enable mapping of AWS Identity and Access Management (IAM) accounts to database accounts.
instanceIdentifier?
Type:
string
(optional, default: a CloudFormation generated name)
A name for the DB instance.
If you specify a name, AWS CloudFormation converts it to lowercase.
instanceType?
Type:
Instance
(optional, default: m5.large (or, more specifically, db.m5.large))
The name of the compute and memory capacity for the instance.
iops?
Type:
number
(optional, 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).)
The number of I/O operations per second (IOPS) that the database provisions.
The value must be equal to or greater than 1000.
licenseModel?
Type:
License
(optional, default: RDS default license model)
The license model.
maxAllocatedStorage?
Type:
number
(optional, default: No autoscaling of RDS instance)
Upper limit to which RDS can scale the storage in GiB(Gibibyte).
monitoringInterval?
Type:
Duration
(optional, default: no enhanced monitoring)
The interval, in seconds, between points when Amazon RDS collects enhanced monitoring metrics for the DB instance.
monitoringRole?
Type:
IRole
(optional, default: A role is automatically created for you)
Role that will be used to manage DB instance monitoring.
multiAz?
Type:
boolean
(optional, default: false)
Specifies if the database instance is a multiple Availability Zone deployment.
networkType?
Type:
Network
(optional, default: IPV4)
The network type of the DB instance.
optionGroup?
Type:
IOption
(optional, default: no option group)
The option group to associate with the instance.
parameterGroup?
Type:
IParameter
(optional, default: no parameter group)
The DB parameter group to associate with the instance.
parameters?
Type:
{ [string]: string }
(optional, default: None)
The parameters in the DBParameterGroup to create automatically.
You can only specify parameterGroup or parameters but not both. You need to use a versioned engine to auto-generate a DBParameterGroup.
performanceInsightEncryptionKey?
Type:
IKey
(optional, default: default master key)
The AWS KMS key for encryption of Performance Insights data.
performanceInsightRetention?
Type:
Performance
(optional, default: 7 this is the free tier)
The amount of time, in days, to retain Performance Insights data.
port?
Type:
number
(optional, default: the default port for the chosen engine.)
The port for the instance.
preferredBackupWindow?
Type:
string
(optional, 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)
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.
preferredMaintenanceWindow?
Type:
string
(optional, 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)
The weekly time range (in UTC) during which system maintenance can occur.
Format: ddd:hh24:mi-ddd:hh24:mi
Constraint: Minimum 30-minute window
processorFeatures?
Type:
Processor
*(optional, default: the default number of CPU cores and threads per core for the
chosen instance class.
The number of CPU cores and the number of threads per core.
publiclyAccessible?
Type:
boolean
(optional, default: true
if the instance's vpcSubnets
is subnetType: SubnetType.PUBLIC
, false
otherwise)
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.
removalPolicy?
Type:
Removal
(optional, default: RemovalPolicy.SNAPSHOT (remove the resource, but retain a snapshot of the data))
The CloudFormation policy to apply when the instance is removed from the stack or replaced during an update.
s3ExportBuckets?
Type:
IBucket
[]
(optional, default: None)
S3 buckets that you want to load data into.
This property must not be used if s3ExportRole
is used.
For Microsoft SQL Server:
s3ExportRole?
Type:
IRole
(optional, default: New role is created if s3ExportBuckets
is set, no role is defined otherwise)
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:
s3ImportBuckets?
Type:
IBucket
[]
(optional, default: 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:
s3ImportRole?
Type:
IRole
(optional, default: New role is created if s3ImportBuckets
is set, no role is defined otherwise)
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:
securityGroups?
Type:
ISecurity
[]
(optional, default: a new security group is created)
The security groups to assign to the DB instance.
storageThroughput?
Type:
number
(optional, 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).)
The storage throughput, specified in mebibytes per second (MiBps).
Only applicable for GP3.
storageType?
Type:
Storage
(optional, default: GP2)
The storage type.
Storage types supported are gp2, io1, standard.
subnetGroup?
Type:
ISubnet
(optional, default: a new subnet group will be created.)
Existing subnet group for the instance.
timezone?
Type:
string
(optional, default: RDS default timezone)
The time zone of the instance.
This is currently supported only by Microsoft Sql Server.
vpcSubnets?
Type:
Subnet
(optional, default: private subnets)
The type of subnets to add to the created DB subnet group.