interface InstanceProps
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.RDS.InstanceProps |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awsrds#InstanceProps |
![]() | software.amazon.awscdk.services.rds.InstanceProps |
![]() | aws_cdk.aws_rds.InstanceProps |
![]() | aws-cdk-lib » aws_rds » InstanceProps |
Instance properties for database instances.
Example
const cluster = new rds.DatabaseCluster(stack, 'Database', {
engine: rds.DatabaseClusterEngine.AURORA,
instanceProps: {
instanceType: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE3, ec2.InstanceSize.SMALL),
vpc,
},
});
cluster.addRotationSingleUser();
const clusterWithCustomRotationOptions = new rds.DatabaseCluster(stack, 'CustomRotationOptions', {
engine: rds.DatabaseClusterEngine.AURORA,
instanceProps: {
instanceType: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE3, ec2.InstanceSize.SMALL),
vpc,
},
});
clusterWithCustomRotationOptions.addRotationSingleUser({
automaticallyAfter: cdk.Duration.days(7),
excludeCharacters: '!@#$%^&*',
securityGroup,
vpcSubnets: { subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS },
endpoint: endpoint,
});
Properties
Name | Type | Description |
---|---|---|
vpc | IVpc | What subnets to run the RDS instances in. |
allow | boolean | Whether to allow upgrade of major version for the DB instance. |
auto | boolean | Whether to enable automatic upgrade of minor version for the DB instance. |
delete | boolean | Whether to remove automated backups immediately after the DB instance is deleted for the DB instance. |
enable | boolean | Whether to enable Performance Insights for the DB instance. |
instance | Instance | What type of instance to start for the replicas. |
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. |
preferred | string | A preferred maintenance window day/time range. Should be specified as a range ddd:hh24:mi-ddd:hh24:mi (24H Clock UTC). |
publicly | boolean | Indicates whether the DB instance is an internet-facing instance. |
security | ISecurity [] | Security group. |
vpc | Subnet | Where to place the instances within the VPC. |
vpc
Type:
IVpc
What subnets to run the RDS instances in.
Must be at least 2 subnets in two different AZs.
allowMajorVersionUpgrade?
Type:
boolean
(optional, default: false)
Whether to allow upgrade of major version for the DB instance.
autoMinorVersionUpgrade?
Type:
boolean
(optional, default: true)
Whether to enable automatic upgrade of minor version for the DB instance.
deleteAutomatedBackups?
Type:
boolean
(optional, default: true)
Whether to remove automated backups immediately after the DB instance is deleted for the DB instance.
enablePerformanceInsights?
Type:
boolean
(optional, default: false, unless performanceInsightRetention
or performanceInsightEncryptionKey
is set.)
Whether to enable Performance Insights for the DB instance.
instanceType?
Type:
Instance
(optional, default: t3.medium (or, more precisely, db.t3.medium))
What type of instance to start for the replicas.
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)
The amount of time, in days, to retain Performance Insights data.
preferredMaintenanceWindow?
Type:
string
(optional, default: 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.)
A preferred maintenance window day/time range. Should be specified as a range ddd:hh24:mi-ddd:hh24:mi (24H Clock UTC).
Example: 'Sun:23:45-Mon:00:15'
publiclyAccessible?
Type:
boolean
(optional, default: true
if vpcSubnets
is subnetType: SubnetType.PUBLIC
, false
otherwise)
Indicates whether the DB instance is an internet-facing instance.
securityGroups?
Type:
ISecurity
[]
(optional, default: a new security group is created.)
Security group.
vpcSubnets?
Type:
Subnet
(optional, default: the Vpc default strategy if not specified.)
Where to place the instances within the VPC.