Interface IDatabaseClusterFromSnapshotProps
Properties for DatabaseClusterFromSnapshot
.
Namespace: Amazon.CDK.AWS.RDS
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IDatabaseClusterFromSnapshotProps
Syntax (vb)
Public Interface IDatabaseClusterFromSnapshotProps
Remarks
ExampleMetadata: infused
Examples
Vpc vpc;
new DatabaseClusterFromSnapshot(this, "Database", new DatabaseClusterFromSnapshotProps {
Engine = DatabaseClusterEngine.Aurora(new AuroraClusterEngineProps { Version = AuroraEngineVersion.VER_1_22_2 }),
Writer = ClusterInstance.Provisioned("writer"),
Vpc = vpc,
SnapshotIdentifier = "mySnapshot"
});
Synopsis
Properties
AutoMinorVersionUpgrade | Specifies whether minor engine upgrades are applied automatically to the DB cluster during the maintenance window. |
BacktrackWindow | The number of seconds to set a cluster's target backtrack window to. |
Backup | Backup settings. |
CloudwatchLogsExports | The list of log types that need to be enabled for exporting to CloudWatch Logs. |
CloudwatchLogsRetention | The number of days log events are kept in CloudWatch Logs. |
CloudwatchLogsRetentionRole | The IAM role for the Lambda function associated with the custom resource that sets the retention policy. |
ClusterIdentifier | An optional identifier for the cluster. |
ClusterScailabilityType | Specifies the scalability mode of the Aurora DB cluster. |
CopyTagsToSnapshot | Whether to copy tags to the snapshot when a snapshot is created. |
Credentials | (deprecated) Credentials for the administrative user. |
DefaultDatabaseName | Name of a database which is automatically created inside the cluster. |
DeletionProtection | Indicates whether the DB cluster should have deletion protection enabled. |
Domain | Directory ID for associating the DB cluster with a specific Active Directory. |
DomainRole | The IAM role to be used when making API calls to the Directory Service. |
EnableClusterLevelEnhancedMonitoring | Whether to enable enhanced monitoring at the cluster level. |
EnableDataApi | Whether to enable the Data API for the cluster. |
EnableLocalWriteForwarding | Whether read replicas can forward write operations to the writer DB instance in the DB cluster. |
EnablePerformanceInsights | Whether to enable Performance Insights for the DB cluster. |
Engine | What kind of database to start. |
IamAuthentication | Whether to enable mapping of AWS Identity and Access Management (IAM) accounts to database accounts. |
InstanceIdentifierBase | Base identifier for instances. |
InstanceProps | (deprecated) Settings for the individual instances that are launched. |
Instances | (deprecated) How many replicas/instances to create. |
InstanceUpdateBehaviour | The ordering of updates for instances. |
MonitoringInterval | The interval between points when Amazon RDS collects enhanced monitoring metrics. |
MonitoringRole | Role that will be used to manage DB monitoring. |
NetworkType | The network type of the DB instance. |
ParameterGroup | Additional parameters to pass to the database engine. |
Parameters | The parameters in the DBClusterParameterGroup to create automatically. |
PerformanceInsightEncryptionKey | The AWS KMS key for encryption of Performance Insights data. |
PerformanceInsightRetention | The amount of time, in days, to retain Performance Insights data. |
Port | What port to listen on. |
PreferredMaintenanceWindow | A preferred maintenance window day/time range. Should be specified as a range ddd:hh24:mi-ddd:hh24:mi (24H Clock UTC). |
Readers | A list of instances to create as cluster reader instances. |
RemovalPolicy | The removal policy to apply when the cluster and its instances are removed from the stack or replaced during an update. |
S3ExportBuckets | S3 buckets that you want to load data into. This feature is only supported by the Aurora database engine. |
S3ExportRole | Role that will be associated with this DB cluster to enable S3 export. |
S3ImportBuckets | S3 buckets that you want to load data from. This feature is only supported by the Aurora database engine. |
S3ImportRole | Role that will be associated with this DB cluster to enable S3 import. |
SecurityGroups | Security group. |
ServerlessV2MaxCapacity | The maximum number of Aurora capacity units (ACUs) for a DB instance in an Aurora Serverless v2 cluster. |
ServerlessV2MinCapacity | The minimum number of Aurora capacity units (ACUs) for a DB instance in an Aurora Serverless v2 cluster. |
SnapshotCredentials | Master user credentials. |
SnapshotIdentifier | The identifier for the DB instance snapshot or DB cluster snapshot to restore from. |
StorageEncrypted | Whether to enable storage encryption. |
StorageEncryptionKey | The KMS key for storage encryption. |
StorageType | The storage type to be associated with the DB cluster. |
SubnetGroup | Existing subnet group for the cluster. |
Vpc | What subnets to run the RDS instances in. |
VpcSubnets | Where to place the instances within the VPC. |
Writer | The instance to use for the cluster writer. |
Properties
AutoMinorVersionUpgrade
Specifies whether minor engine upgrades are applied automatically to the DB cluster during the maintenance window.
virtual Nullable<bool> AutoMinorVersionUpgrade { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: true
BacktrackWindow
The number of seconds to set a cluster's target backtrack window to.
virtual Duration BacktrackWindow { get; }
Property Value
Remarks
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
Backup
Backup settings.
virtual IBackupProps Backup { get; }
Property Value
Remarks
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.
CloudwatchLogsExports
The list of log types that need to be enabled for exporting to CloudWatch Logs.
virtual string[] CloudwatchLogsExports { get; }
Property Value
System.String[]
Remarks
Default: - no log exports
CloudwatchLogsRetention
The number of days log events are kept in CloudWatch Logs.
virtual Nullable<RetentionDays> CloudwatchLogsRetention { get; }
Property Value
System.Nullable<RetentionDays>
Remarks
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
CloudwatchLogsRetentionRole
The IAM role for the Lambda function associated with the custom resource that sets the retention policy.
virtual IRole CloudwatchLogsRetentionRole { get; }
Property Value
Remarks
Default: - a new role is created.
ClusterIdentifier
An optional identifier for the cluster.
virtual string ClusterIdentifier { get; }
Property Value
System.String
Remarks
Default: - A name is automatically generated.
ClusterScailabilityType
Specifies the scalability mode of the Aurora DB cluster.
virtual Nullable<ClusterScailabilityType> ClusterScailabilityType { get; }
Property Value
System.Nullable<ClusterScailabilityType>
Remarks
Set LIMITLESS if you want to use a limitless database; otherwise, set it to STANDARD.
Default: ClusterScailabilityType.STANDARD
CopyTagsToSnapshot
Whether to copy tags to the snapshot when a snapshot is created.
virtual Nullable<bool> CopyTagsToSnapshot { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: - true
Credentials
(deprecated) Credentials for the administrative user.
virtual Credentials Credentials { get; }
Property Value
Remarks
Note - using this prop only works with Credentials.fromPassword()
with the
username of the snapshot, Credentials.fromUsername()
with the username and
password of the snapshot or Credentials.fromSecret()
with a secret containing
the username and password of the snapshot.
Default: - A username of 'admin' (or 'postgres' for PostgreSQL) and SecretsManager-generated password
that will not be applied to the cluster, use snapshotCredentials
for the correct behavior.
Stability: Deprecated
DefaultDatabaseName
Name of a database which is automatically created inside the cluster.
virtual string DefaultDatabaseName { get; }
Property Value
System.String
Remarks
Default: - Database is not created in cluster.
DeletionProtection
Indicates whether the DB cluster should have deletion protection enabled.
virtual Nullable<bool> DeletionProtection { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: - true if removalPolicy
is RETAIN, undefined
otherwise, which will not enable deletion protection.
To disable deletion protection after it has been enabled, you must explicitly set this value to false
.
Domain
Directory ID for associating the DB cluster with a specific Active Directory.
virtual string Domain { get; }
Property Value
System.String
Remarks
Necessary for enabling Kerberos authentication. If specified, the DB cluster joins the given Active Directory, enabling Kerberos authentication. If not specified, the DB cluster will not be associated with any Active Directory, and Kerberos authentication will not be enabled.
Default: - DB cluster is not associated with an Active Directory; Kerberos authentication is not enabled.
DomainRole
The IAM role to be used when making API calls to the Directory Service.
virtual IRole DomainRole { get; }
Property Value
Remarks
The role needs the AWS-managed policy
AmazonRDSDirectoryServiceAccess
or equivalent.
Default: - If DatabaseClusterBaseProps.domain
is specified, a role with the AmazonRDSDirectoryServiceAccess
policy is automatically created.
EnableClusterLevelEnhancedMonitoring
Whether to enable enhanced monitoring at the cluster level.
virtual Nullable<bool> EnableClusterLevelEnhancedMonitoring { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
If set to true, monitoringInterval
and monitoringRole
are applied to not the instances, but the cluster.
monitoringInterval
is required to be set if enableClusterLevelEnhancedMonitoring
is set to true.
Default: - When the monitoringInterval
is set, enhanced monitoring is enabled for each instance.
EnableDataApi
Whether to enable the Data API for the cluster.
virtual Nullable<bool> EnableDataApi { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: - false
EnableLocalWriteForwarding
Whether read replicas can forward write operations to the writer DB instance in the DB cluster.
virtual Nullable<bool> EnableLocalWriteForwarding { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
This setting can only be enabled for Aurora MySQL 3.04 or higher, and for Aurora PostgreSQL 16.4 or higher (for version 16), 15.8 or higher (for version 15), and 14.13 or higher (for version 14).
Default: false
See: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-postgresql-write-forwarding.html
EnablePerformanceInsights
Whether to enable Performance Insights for the DB cluster.
virtual Nullable<bool> EnablePerformanceInsights { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: - false, unless performanceInsightRetention
or performanceInsightEncryptionKey
is set.
Engine
IamAuthentication
Whether to enable mapping of AWS Identity and Access Management (IAM) accounts to database accounts.
virtual Nullable<bool> IamAuthentication { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: false
InstanceIdentifierBase
Base identifier for instances.
virtual string InstanceIdentifierBase { get; }
Property Value
System.String
Remarks
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.
InstanceProps
(deprecated) Settings for the individual instances that are launched.
virtual IInstanceProps InstanceProps { get; }
Property Value
Remarks
Stability: Deprecated
Instances
(deprecated) How many replicas/instances to create.
virtual Nullable<double> Instances { get; }
Property Value
System.Nullable<System.Double>
Remarks
Has to be at least 1.
Default: 2
Stability: Deprecated
InstanceUpdateBehaviour
The ordering of updates for instances.
virtual Nullable<InstanceUpdateBehaviour> InstanceUpdateBehaviour { get; }
Property Value
System.Nullable<InstanceUpdateBehaviour>
Remarks
Default: InstanceUpdateBehaviour.BULK
MonitoringInterval
The interval between points when Amazon RDS collects enhanced monitoring metrics.
virtual Duration MonitoringInterval { get; }
Property Value
Remarks
If you enable enableClusterLevelEnhancedMonitoring
, this property is applied to the cluster,
otherwise it is applied to the instances.
Default: - no enhanced monitoring
MonitoringRole
Role that will be used to manage DB monitoring.
virtual IRole MonitoringRole { get; }
Property Value
Remarks
If you enable enableClusterLevelEnhancedMonitoring
, this property is applied to the cluster,
otherwise it is applied to the instances.
Default: - A role is automatically created for you
NetworkType
The network type of the DB instance.
virtual Nullable<NetworkType> NetworkType { get; }
Property Value
System.Nullable<NetworkType>
Remarks
Default: - IPV4
ParameterGroup
Additional parameters to pass to the database engine.
virtual IParameterGroup ParameterGroup { get; }
Property Value
Remarks
Default: - No parameter group.
Parameters
The parameters in the DBClusterParameterGroup to create automatically.
virtual IDictionary<string, string> Parameters { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.String>
Remarks
You can only specify parameterGroup or parameters but not both. You need to use a versioned engine to auto-generate a DBClusterParameterGroup.
Default: - None
PerformanceInsightEncryptionKey
The AWS KMS key for encryption of Performance Insights data.
virtual IKey PerformanceInsightEncryptionKey { get; }
Property Value
Remarks
Default: - default master key
PerformanceInsightRetention
The amount of time, in days, to retain Performance Insights data.
virtual Nullable<PerformanceInsightRetention> PerformanceInsightRetention { get; }
Property Value
System.Nullable<PerformanceInsightRetention>
Remarks
Default: 7
Port
What port to listen on.
virtual Nullable<double> Port { get; }
Property Value
System.Nullable<System.Double>
Remarks
Default: - The default for the engine is used.
PreferredMaintenanceWindow
A preferred maintenance window day/time range. Should be specified as a range ddd:hh24:mi-ddd:hh24:mi (24H Clock UTC).
virtual string PreferredMaintenanceWindow { get; }
Property Value
System.String
Remarks
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.
Readers
A list of instances to create as cluster reader instances.
virtual IClusterInstance[] Readers { get; }
Property Value
Remarks
Default: - no readers are created. The cluster will have a single writer/reader
RemovalPolicy
The removal policy to apply when the cluster and its instances are removed from the stack or replaced during an update.
virtual Nullable<RemovalPolicy> RemovalPolicy { get; }
Property Value
System.Nullable<RemovalPolicy>
Remarks
Default: - RemovalPolicy.SNAPSHOT (remove the cluster and instances, but retain a snapshot of the data)
S3ExportBuckets
S3 buckets that you want to load data into. This feature is only supported by the Aurora database engine.
virtual IBucket[] S3ExportBuckets { get; }
Property Value
IBucket[]
Remarks
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
S3ExportRole
Role that will be associated with this DB cluster to enable S3 export.
virtual IRole S3ExportRole { get; }
Property Value
Remarks
This feature is only supported by the Aurora database engine.
This property must not be used if s3ExportBuckets
is used.
To use this property with Aurora PostgreSQL, it must be configured with the S3 export feature enabled when creating the DatabaseClusterEngine
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
S3ImportBuckets
S3 buckets that you want to load data from. This feature is only supported by the Aurora database engine.
virtual IBucket[] S3ImportBuckets { get; }
Property Value
IBucket[]
Remarks
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
S3ImportRole
Role that will be associated with this DB cluster to enable S3 import.
virtual IRole S3ImportRole { get; }
Property Value
Remarks
This feature is only supported by the Aurora database engine.
This property must not be used if s3ImportBuckets
is used.
To use this property with Aurora PostgreSQL, it must be configured with the S3 import feature enabled when creating the DatabaseClusterEngine
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
SecurityGroups
Security group.
virtual ISecurityGroup[] SecurityGroups { get; }
Property Value
Remarks
Default: - a new security group is created.
ServerlessV2MaxCapacity
The maximum number of Aurora capacity units (ACUs) for a DB instance in an Aurora Serverless v2 cluster.
virtual Nullable<double> ServerlessV2MaxCapacity { get; }
Property Value
System.Nullable<System.Double>
Remarks
You can specify ACU values in half-step increments, such as 40, 40.5, 41, and so on. The largest value that you can use is 256.
The maximum capacity must be higher than 0.5 ACUs.
Default: 2
ServerlessV2MinCapacity
The minimum number of Aurora capacity units (ACUs) for a DB instance in an Aurora Serverless v2 cluster.
virtual Nullable<double> ServerlessV2MinCapacity { get; }
Property Value
System.Nullable<System.Double>
Remarks
You can specify ACU values in half-step increments, such as 8, 8.5, 9, and so on. The smallest value that you can use is 0.
For Aurora versions that support the Aurora Serverless v2 auto-pause feature, the smallest value that you can use is 0. For versions that don't support Aurora Serverless v2 auto-pause, the smallest value that you can use is 0.5.
Default: 0.5
SnapshotCredentials
Master user credentials.
virtual SnapshotCredentials SnapshotCredentials { get; }
Property Value
Remarks
Note - It is not possible to change the master username for a snapshot; however, it is possible to provide (or generate) a new password.
Default: - The existing username and password from the snapshot will be used.
SnapshotIdentifier
The identifier for the DB instance snapshot or DB cluster snapshot to restore from.
string SnapshotIdentifier { get; }
Property Value
System.String
Remarks
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.
StorageEncrypted
Whether to enable storage encryption.
virtual Nullable<bool> StorageEncrypted { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: - true if storageEncryptionKey is provided, false otherwise
StorageEncryptionKey
The KMS key for storage encryption.
virtual IKey StorageEncryptionKey { get; }
Property Value
Remarks
If specified, storageEncrypted
will be set to true
.
Default: - if storageEncrypted is true then the default master key, no key otherwise
StorageType
The storage type to be associated with the DB cluster.
virtual Nullable<DBClusterStorageType> StorageType { get; }
Property Value
System.Nullable<DBClusterStorageType>
Remarks
Default: - DBClusterStorageType.AURORA_IOPT1
SubnetGroup
Existing subnet group for the cluster.
virtual ISubnetGroup SubnetGroup { get; }
Property Value
Remarks
Default: - a new subnet group will be created.
Vpc
What subnets to run the RDS instances in.
virtual IVpc Vpc { get; }
Property Value
Remarks
Must be at least 2 subnets in two different AZs.
VpcSubnets
Where to place the instances within the VPC.
virtual ISubnetSelection VpcSubnets { get; }
Property Value
Remarks
Default: - the Vpc default strategy if not specified.
Writer
The instance to use for the cluster writer.
virtual IClusterInstance Writer { get; }
Property Value
Remarks
Default: - required if instanceProps is not provided