DatabaseClusterFromSnapshotProps¶
-
class
aws_cdk.aws_rds.
DatabaseClusterFromSnapshotProps
(*, engine, instance_props, snapshot_identifier, backtrack_window=None, backup=None, cloudwatch_logs_exports=None, cloudwatch_logs_retention=None, cloudwatch_logs_retention_role=None, cluster_identifier=None, copy_tags_to_snapshot=None, credentials=None, default_database_name=None, deletion_protection=None, iam_authentication=None, instance_identifier_base=None, instances=None, monitoring_interval=None, monitoring_role=None, parameter_group=None, parameters=None, port=None, preferred_maintenance_window=None, removal_policy=None, s3_export_buckets=None, s3_export_role=None, s3_import_buckets=None, s3_import_role=None, storage_encrypted=None, storage_encryption_key=None, subnet_group=None)¶ Bases:
object
Properties for
DatabaseClusterFromSnapshot
.- Parameters
engine (
IClusterEngine
) – What kind of database to start.instance_props (
InstanceProps
) – Settings for the individual instances that are launched.snapshot_identifier (
str
) – The identifier for the DB instance snapshot or DB cluster snapshot to restore from. You can use either the name or the Amazon Resource Name (ARN) to specify a DB cluster snapshot. However, you can use only the ARN to specify a DB instance snapshot.backtrack_window (
Optional
[Duration
]) – The number of seconds to set a cluster’s target backtrack window to. This feature is only supported by the Aurora MySQL database engine and cannot be enabled on existing clusters. Default: 0 seconds (no backtrack)backup (
Optional
[BackupProps
]) – Backup settings. Default: - Backup retention period for automated backups is 1 day. Backup preferred window is set to 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.cloudwatch_logs_exports (
Optional
[Sequence
[str
]]) – The list of log types that need to be enabled for exporting to CloudWatch Logs. Default: - no log exportscloudwatch_logs_retention (
Optional
[RetentionDays
]) – 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 toInfinity
. Default: - logs never expirecloudwatch_logs_retention_role (
Optional
[IRole
]) – The IAM role for the Lambda function associated with the custom resource that sets the retention policy. Default: - a new role is created.cluster_identifier (
Optional
[str
]) – An optional identifier for the cluster. Default: - A name is automatically generated.copy_tags_to_snapshot (
Optional
[bool
]) – Whether to copy tags to the snapshot when a snapshot is created. Default: - truecredentials (
Optional
[Credentials
]) – Credentials for the administrative user. Default: - A username of ‘admin’ (or ‘postgres’ for PostgreSQL) and SecretsManager-generated passworddefault_database_name (
Optional
[str
]) – Name of a database which is automatically created inside the cluster. Default: - Database is not created in cluster.deletion_protection (
Optional
[bool
]) – Indicates whether the DB cluster should have deletion protection enabled. Default: - true ifremovalPolicy
is RETAIN, false otherwiseiam_authentication (
Optional
[bool
]) – Whether to enable mapping of AWS Identity and Access Management (IAM) accounts to database accounts. Default: falseinstance_identifier_base (
Optional
[str
]) – Base identifier for instances. Every replica is named by appending the replica number to this string, 1-based. Default: - clusterIdentifier is used with the word “Instance” appended. If clusterIdentifier is not provided, the identifier is automatically generated.instances (
Union
[int
,float
,None
]) – How many replicas/instances to create. Has to be at least 1. Default: 2monitoring_interval (
Optional
[Duration
]) – The interval, in seconds, between points when Amazon RDS collects enhanced monitoring metrics for the DB instances. Default: no enhanced monitoringmonitoring_role (
Optional
[IRole
]) – Role that will be used to manage DB instances monitoring. Default: - A role is automatically created for youparameter_group (
Optional
[IParameterGroup
]) – Additional parameters to pass to the database engine. Default: - No parameter group.parameters (
Optional
[Mapping
[str
,str
]]) – The parameters in the DBClusterParameterGroup to create automatically. You can only specify parameterGroup or parameters but not both. You need to use a versioned engine to auto-generate a DBClusterParameterGroup. Default: - Noneport (
Union
[int
,float
,None
]) – What port to listen on. Default: - The default for the engine is used.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.removal_policy (
Optional
[RemovalPolicy
]) – The removal policy to apply when the cluster and its instances are removed from the stack or replaced during an update. Default: - RemovalPolicy.SNAPSHOT (remove the cluster and instances, but retain a snapshot of the data)s3_export_buckets (
Optional
[Sequence
[IBucket
]]) – S3 buckets that you want to load data into. This feature is only supported by the Aurora database engine. This property must not be used ifs3ExportRole
is used. For MySQL: Default: - Nones3_export_role (
Optional
[IRole
]) – Role that will be associated with this DB cluster to enable S3 export. This feature is only supported by the Aurora database engine. This property must not be used ifs3ExportBuckets
is used. For MySQL: Default: - New role is created ifs3ExportBuckets
is set, no role is defined otherwises3_import_buckets (
Optional
[Sequence
[IBucket
]]) – S3 buckets that you want to load data from. This feature is only supported by the Aurora database engine. This property must not be used ifs3ImportRole
is used. For MySQL: Default: - Nones3_import_role (
Optional
[IRole
]) – Role that will be associated with this DB cluster to enable S3 import. This feature is only supported by the Aurora database engine. This property must not be used ifs3ImportBuckets
is used. For MySQL: Default: - New role is created ifs3ImportBuckets
is set, no role is defined otherwisestorage_encrypted (
Optional
[bool
]) – Whether to enable storage encryption. Default: - true if storageEncryptionKey is provided, false otherwisestorage_encryption_key (
Optional
[IKey
]) – The KMS key for storage encryption. If specified, {@link storageEncrypted} will be set totrue
. Default: - if storageEncrypted is true then the default master key, no key otherwisesubnet_group (
Optional
[ISubnetGroup
]) – Existing subnet group for the cluster. Default: - a new subnet group will be created.
- ExampleMetadata
infused
Example:
# vpc: ec2.Vpc rds.DatabaseClusterFromSnapshot(self, "Database", engine=rds.DatabaseClusterEngine.aurora(version=rds.AuroraEngineVersion.VER_1_22_2), instance_props=rds.InstanceProps( vpc=vpc ), snapshot_identifier="mySnapshot" )
Attributes
-
backtrack_window
¶ The number of seconds to set a cluster’s target backtrack window to.
This feature is only supported by the Aurora MySQL database engine and cannot be enabled on existing clusters.
- Default
0 seconds (no backtrack)
- See
https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraMySQL.Managing.Backtrack.html
- Return type
Optional
[Duration
]
-
backup
¶ Backup settings.
- Default
Backup retention period for automated backups is 1 day.
Backup preferred window is set to 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.
-
cloudwatch_logs_exports
¶ The list of log types that need to be enabled for exporting to CloudWatch Logs.
- Default
no log exports
- Return type
Optional
[List
[str
]]
-
cloudwatch_logs_retention
¶ 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
.- Default
logs never expire
- Return type
Optional
[RetentionDays
]
-
cloudwatch_logs_retention_role
¶ The IAM role for the Lambda function associated with the custom resource that sets the retention policy.
- Default
a new role is created.
- Return type
Optional
[IRole
]
-
cluster_identifier
¶ An optional identifier for the cluster.
- Default
A name is automatically generated.
- Return type
Optional
[str
]
Whether to copy tags to the snapshot when a snapshot is created.
- Default
true
- Return type
Optional
[bool
]
-
credentials
¶ Credentials for the administrative user.
- Default
A username of ‘admin’ (or ‘postgres’ for PostgreSQL) and SecretsManager-generated password
- Return type
Optional
[Credentials
]
-
default_database_name
¶ Name of a database which is automatically created inside the cluster.
- Default
Database is not created in cluster.
- Return type
Optional
[str
]
-
deletion_protection
¶ Indicates whether the DB cluster should have deletion protection enabled.
- Default
true if
removalPolicy
is RETAIN, false otherwise
- Return type
Optional
[bool
]
-
engine
¶ What kind of database to start.
- Return type
-
iam_authentication
¶ Whether to enable mapping of AWS Identity and Access Management (IAM) accounts to database accounts.
- Default
false
- Return type
Optional
[bool
]
-
instance_identifier_base
¶ Base identifier for instances.
Every replica is named by appending the replica number to this string, 1-based.
- Default
clusterIdentifier is used with the word “Instance” appended.
If clusterIdentifier is not provided, the identifier is automatically generated.
- Return type
Optional
[str
]
-
instance_props
¶ Settings for the individual instances that are launched.
- Return type
-
instances
¶ How many replicas/instances to create.
Has to be at least 1.
- Default
2
- Return type
Union
[int
,float
,None
]
-
monitoring_interval
¶ The interval, in seconds, between points when Amazon RDS collects enhanced monitoring metrics for the DB instances.
- Default
no enhanced monitoring
- Return type
Optional
[Duration
]
-
monitoring_role
¶ Role that will be used to manage DB instances monitoring.
- Default
A role is automatically created for you
- Return type
Optional
[IRole
]
-
parameter_group
¶ Additional parameters to pass to the database engine.
- Default
No parameter group.
- Return type
Optional
[IParameterGroup
]
-
parameters
¶ The parameters in the DBClusterParameterGroup to create automatically.
You can only specify parameterGroup or parameters but not both. You need to use a versioned engine to auto-generate a DBClusterParameterGroup.
- Default
None
- Return type
Optional
[Mapping
[str
,str
]]
-
port
¶ What port to listen on.
- Default
The default for the engine is used.
- Return type
Union
[int
,float
,None
]
-
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
- Type
A preferred maintenance window day/time range. Should be specified as a range ddd
- Type
hh24
- Return type
Optional
[str
]
-
removal_policy
¶ The removal policy to apply when the cluster and its instances are removed from the stack or replaced during an update.
- Default
RemovalPolicy.SNAPSHOT (remove the cluster and instances, but retain a snapshot of the data)
- Return type
Optional
[RemovalPolicy
]
-
s3_export_buckets
¶ S3 buckets that you want to load data into. This feature is only supported by the Aurora database engine.
This property must not be used if
s3ExportRole
is used.For MySQL:
- Default
None
- See
https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/postgresql-s3-export.html
- Return type
Optional
[List
[IBucket
]]
-
s3_export_role
¶ Role that will be associated with this DB cluster to enable S3 export.
This feature is only supported by the Aurora database engine.
This property must not be used if
s3ExportBuckets
is used.For MySQL:
- Default
New role is created if
s3ExportBuckets
is set, no role is defined otherwise
- See
https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/postgresql-s3-export.html
- Return type
Optional
[IRole
]
-
s3_import_buckets
¶ S3 buckets that you want to load data from. This feature is only supported by the Aurora database engine.
This property must not be used if
s3ImportRole
is used.For MySQL:
- Default
None
- See
https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraPostgreSQL.Migrating.html
- Return type
Optional
[List
[IBucket
]]
-
s3_import_role
¶ Role that will be associated with this DB cluster to enable S3 import.
This feature is only supported by the Aurora database engine.
This property must not be used if
s3ImportBuckets
is used.For MySQL:
- Default
New role is created if
s3ImportBuckets
is set, no role is defined otherwise
- See
https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraPostgreSQL.Migrating.html
- Return type
Optional
[IRole
]
-
snapshot_identifier
¶ The identifier for the DB instance snapshot or DB cluster snapshot to restore from.
You can use either the name or the Amazon Resource Name (ARN) to specify a DB cluster snapshot. However, you can use only the ARN to specify a DB instance snapshot.
- Return type
str
-
storage_encrypted
¶ Whether to enable storage encryption.
- Default
true if storageEncryptionKey is provided, false otherwise
- Return type
Optional
[bool
]
-
storage_encryption_key
¶ The KMS key for storage encryption.
If specified, {@link storageEncrypted} will be set to
true
.- Default
if storageEncrypted is true then the default master key, no key otherwise
- Return type
Optional
[IKey
]
-
subnet_group
¶ Existing subnet group for the cluster.
- Default
a new subnet group will be created.
- Return type
Optional
[ISubnetGroup
]