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, preferred_maintenance_window=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: - false

  • auto_minor_version_upgrade (Optional[bool]) – Whether to enable automatic upgrade of minor version for the DB instance. Default: - true

  • delete_automated_backups (Optional[bool]) – Whether to remove automated backups immediately after the DB instance is deleted for the DB instance. Default: - true

  • enable_performance_insights (Optional[bool]) – Whether to enable Performance Insights for the DB instance. Default: - false, unless performanceInsightRetention or performanceInsightEncryptionKey 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 group

  • parameters (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: - None

  • performance_insight_encryption_key (Optional[IKey]) – The AWS KMS key for encryption of Performance Insights data. Default: - default master key

  • performance_insight_retention (Optional[PerformanceInsightRetention]) – The amount of time, in days, to retain Performance Insights data. Default: 7

  • preferred_maintenance_window (Optional[str]) – 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’ 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.

  • publicly_accessible (Optional[bool]) – Indicates whether the DB instance is an internet-facing instance. Default: - true if vpcSubnets is subnetType: SubnetType.PUBLIC, false otherwise

  • security_groups (Optional[Sequence[ISecurityGroup]]) – Security group. Default: a new security group is created.

  • vpc_subnets (Union[SubnetSelection, Dict[str, Any], None]) – Where to place the instances within the VPC. Default: - the Vpc default strategy if not specified.

ExampleMetadata:

lit=aws-rds/test/integ.cluster-rotation.lit.ts infused

Example:

cluster = rds.DatabaseCluster(stack, "Database",
    engine=rds.DatabaseClusterEngine.AURORA,
    instance_props=cdk.aws_rds.InstanceProps(
        instance_type=ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE3, ec2.InstanceSize.SMALL),
        vpc=vpc
    )
)

cluster.add_rotation_single_user()

cluster_with_custom_rotation_options = rds.DatabaseCluster(stack, "CustomRotationOptions",
    engine=rds.DatabaseClusterEngine.AURORA,
    instance_props=cdk.aws_rds.InstanceProps(
        instance_type=ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE3, ec2.InstanceSize.SMALL),
        vpc=vpc
    )
)
cluster_with_custom_rotation_options.add_rotation_single_user(
    automatically_after=cdk.Duration.days(7),
    exclude_characters="!@#$%^&*",
    security_group=security_group,
    vpc_subnets=ec2.SubnetSelection(subnet_type=ec2.SubnetType.PRIVATE_WITH_EGRESS),
    endpoint=endpoint
)

Attributes

allow_major_version_upgrade

Whether to allow upgrade of major version for the DB instance.

Default:
  • false

auto_minor_version_upgrade

Whether to enable automatic upgrade of minor version for the DB instance.

Default:
  • true

delete_automated_backups

Whether to remove automated backups immediately after the DB instance is deleted for the DB instance.

Default:
  • true

enable_performance_insights

Whether to enable Performance Insights for the DB instance.

Default:
  • false, unless performanceInsightRetention or performanceInsightEncryptionKey is set.

instance_type

What type of instance to start for the replicas.

Default:
  • t3.medium (or, more precisely, db.t3.medium)

parameter_group

The DB parameter group to associate with the instance.

Default:

no parameter group

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

performance_insight_encryption_key

The AWS KMS key for encryption of Performance Insights data.

Default:
  • default master key

performance_insight_retention

The amount of time, in days, to retain Performance Insights data.

Default:

7

preferred_maintenance_window

mi-ddd:hh24:mi (24H Clock UTC).

Example: ‘Sun:23:45-Mon:00:15’

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.

See:

https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_UpgradeDBInstance.Maintenance.html#Concepts.DBMaintenance

Type:

A preferred maintenance window day/time range. Should be specified as a range ddd

Type:

hh24

publicly_accessible

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

Default:
  • true if vpcSubnets is subnetType: SubnetType.PUBLIC, false otherwise

security_groups

Security group.

Default:

a new security group is created.

vpc

What subnets to run the RDS instances in.

Must be at least 2 subnets in two different AZs.

vpc_subnets

Where to place the instances within the VPC.

Default:
  • the Vpc default strategy if not specified.