InstanceProps¶
-
class
aws_cdk.aws_rds.
InstanceProps
(*, vpc, allow_major_version_upgrade=None, auto_minor_version_upgrade=None, delete_automated_backups=None, enable_performance_insights=None, instance_type=None, parameter_group=None, parameters=None, performance_insight_encryption_key=None, performance_insight_retention=None, publicly_accessible=None, security_groups=None, vpc_subnets=None)¶ Bases:
object
Instance properties for database instances.
- Parameters
vpc (
IVpc
) – What subnets to run the RDS instances in. Must be at least 2 subnets in two different AZs.allow_major_version_upgrade (
Optional
[bool
]) – Whether to allow upgrade of major version for the DB instance. Default: - falseauto_minor_version_upgrade (
Optional
[bool
]) – Whether to enable automatic upgrade of minor version for the DB instance. Default: - truedelete_automated_backups (
Optional
[bool
]) – Whether to remove automated backups immediately after the DB instance is deleted for the DB instance. Default: - trueenable_performance_insights (
Optional
[bool
]) – Whether to enable Performance Insights for the DB instance. Default: - false, unlessperformanceInsightRentention
orperformanceInsightEncryptionKey
is set.instance_type (
Optional
[InstanceType
]) – What type of instance to start for the replicas. Default: - t3.medium (or, more precisely, db.t3.medium)parameter_group (
Optional
[IParameterGroup
]) – The DB parameter group to associate with the instance. Default: no parameter groupparameters (
Optional
[Mapping
[str
,str
]]) – 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. Default: - Noneperformance_insight_encryption_key (
Optional
[IKey
]) – The AWS KMS key for encryption of Performance Insights data. Default: - default master keyperformance_insight_retention (
Optional
[PerformanceInsightRetention
]) – The amount of time, in days, to retain Performance Insights data. Default: 7publicly_accessible (
Optional
[bool
]) – Indicates whether the DB instance is an internet-facing instance. Default: -true
ifvpcSubnets
issubnetType: SubnetType.PUBLIC
,false
otherwisesecurity_groups (
Optional
[Sequence
[ISecurityGroup
]]) – Security group. Default: a new security group is created.vpc_subnets (
Optional
[SubnetSelection
]) – Where to place the instances within the VPC. Default: - the Vpc default strategy if not specified.
- ExampleMetadata
infused
Example:
# vpc: ec2.Vpc cluster = rds.DatabaseCluster(self, "Database", engine=rds.DatabaseClusterEngine.AURORA, instance_props=rds.InstanceProps(vpc=vpc) ) proxy = rds.DatabaseProxy(self, "Proxy", proxy_target=rds.ProxyTarget.from_cluster(cluster), secrets=[cluster.secret], vpc=vpc ) role = iam.Role(self, "DBProxyRole", assumed_by=iam.AccountPrincipal(self.account)) proxy.grant_connect(role, "admin")
Attributes
-
allow_major_version_upgrade
¶ Whether to allow upgrade of major version for the DB instance.
- Default
false
- Return type
Optional
[bool
]
-
auto_minor_version_upgrade
¶ Whether to enable automatic upgrade of minor version for the DB instance.
- Default
true
- Return type
Optional
[bool
]
-
delete_automated_backups
¶ Whether to remove automated backups immediately after the DB instance is deleted for the DB instance.
- Default
true
- Return type
Optional
[bool
]
-
enable_performance_insights
¶ Whether to enable Performance Insights for the DB instance.
- Default
false, unless
performanceInsightRentention
orperformanceInsightEncryptionKey
is set.
- Return type
Optional
[bool
]
-
instance_type
¶ What type of instance to start for the replicas.
- Default
t3.medium (or, more precisely, db.t3.medium)
- Return type
Optional
[InstanceType
]
-
parameter_group
¶ The DB parameter group to associate with the instance.
- Default
no parameter group
- Return type
Optional
[IParameterGroup
]
-
parameters
¶ 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.
- Default
None
- Return type
Optional
[Mapping
[str
,str
]]
-
performance_insight_encryption_key
¶ The AWS KMS key for encryption of Performance Insights data.
- Default
default master key
- Return type
Optional
[IKey
]
-
performance_insight_retention
¶ The amount of time, in days, to retain Performance Insights data.
- Default
7
- Return type
Optional
[PerformanceInsightRetention
]
-
publicly_accessible
¶ Indicates whether the DB instance is an internet-facing instance.
- Default
true
ifvpcSubnets
issubnetType: SubnetType.PUBLIC
,false
otherwise
- Return type
Optional
[bool
]
-
security_groups
¶ Security group.
- Default
a new security group is created.
- Return type
Optional
[List
[ISecurityGroup
]]
-
vpc
¶ What subnets to run the RDS instances in.
Must be at least 2 subnets in two different AZs.
- Return type
-
vpc_subnets
¶ Where to place the instances within the VPC.
- Default
the Vpc default strategy if not specified.
- Return type
Optional
[SubnetSelection
]