Class DatabaseClusterFromSnapshotProps
Properties for DatabaseClusterFromSnapshot
.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.RDS
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class DatabaseClusterFromSnapshotProps : Object, IDatabaseClusterFromSnapshotProps
Syntax (vb)
Public Class DatabaseClusterFromSnapshotProps
Inherits Object
Implements 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
Constructors
DatabaseClusterFromSnapshotProps() |
Properties
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. |
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. |
EnableDataApi | Whether to enable the Data API for the 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, in seconds, between points when Amazon RDS collects enhanced monitoring metrics for the DB instances. |
MonitoringRole | Role that will be used to manage DB instances 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. |
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. |
Constructors
DatabaseClusterFromSnapshotProps()
public DatabaseClusterFromSnapshotProps()
Properties
BacktrackWindow
The number of seconds to set a cluster's target backtrack window to.
public Duration BacktrackWindow { get; set; }
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.
public IBackupProps Backup { get; set; }
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.
public string[] CloudwatchLogsExports { get; set; }
Property Value
System.String[]
Remarks
Default: - no log exports
CloudwatchLogsRetention
The number of days log events are kept in CloudWatch Logs.
public Nullable<RetentionDays> CloudwatchLogsRetention { get; set; }
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.
public IRole CloudwatchLogsRetentionRole { get; set; }
Property Value
Remarks
Default: - a new role is created.
ClusterIdentifier
An optional identifier for the cluster.
public string ClusterIdentifier { get; set; }
Property Value
System.String
Remarks
Default: - A name is automatically generated.
CopyTagsToSnapshot
Whether to copy tags to the snapshot when a snapshot is created.
public Nullable<bool> CopyTagsToSnapshot { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: - true
Credentials
(deprecated) Credentials for the administrative user.
public Credentials Credentials { get; set; }
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.
public string DefaultDatabaseName { get; set; }
Property Value
System.String
Remarks
Default: - Database is not created in cluster.
DeletionProtection
Indicates whether the DB cluster should have deletion protection enabled.
public Nullable<bool> DeletionProtection { get; set; }
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.
public string Domain { get; set; }
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.
public IRole DomainRole { get; set; }
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.
EnableDataApi
Whether to enable the Data API for the cluster.
public Nullable<bool> EnableDataApi { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: - false
Engine
What kind of database to start.
public IClusterEngine Engine { get; set; }
Property Value
IamAuthentication
Whether to enable mapping of AWS Identity and Access Management (IAM) accounts to database accounts.
public Nullable<bool> IamAuthentication { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: false
InstanceIdentifierBase
Base identifier for instances.
public string InstanceIdentifierBase { get; set; }
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.
public IInstanceProps InstanceProps { get; set; }
Property Value
Remarks
Stability: Deprecated
Instances
(deprecated) How many replicas/instances to create.
public Nullable<double> Instances { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
Has to be at least 1.
Default: 2
Stability: Deprecated
InstanceUpdateBehaviour
The ordering of updates for instances.
public Nullable<InstanceUpdateBehaviour> InstanceUpdateBehaviour { get; set; }
Property Value
System.Nullable<InstanceUpdateBehaviour>
Remarks
Default: InstanceUpdateBehaviour.BULK
MonitoringInterval
The interval, in seconds, between points when Amazon RDS collects enhanced monitoring metrics for the DB instances.
public Duration MonitoringInterval { get; set; }
Property Value
Remarks
Default: no enhanced monitoring
MonitoringRole
Role that will be used to manage DB instances monitoring.
public IRole MonitoringRole { get; set; }
Property Value
Remarks
Default: - A role is automatically created for you
NetworkType
The network type of the DB instance.
public Nullable<NetworkType> NetworkType { get; set; }
Property Value
System.Nullable<NetworkType>
Remarks
Default: - IPV4
ParameterGroup
Additional parameters to pass to the database engine.
public IParameterGroup ParameterGroup { get; set; }
Property Value
Remarks
Default: - No parameter group.
Parameters
The parameters in the DBClusterParameterGroup to create automatically.
public IDictionary<string, string> Parameters { get; set; }
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
Port
What port to listen on.
public Nullable<double> Port { get; set; }
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).
public string PreferredMaintenanceWindow { get; set; }
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.
public IClusterInstance[] Readers { get; set; }
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.
public Nullable<RemovalPolicy> RemovalPolicy { get; set; }
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.
public IBucket[] S3ExportBuckets { get; set; }
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.
public IRole S3ExportRole { get; set; }
Property Value
Remarks
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
S3ImportBuckets
S3 buckets that you want to load data from. This feature is only supported by the Aurora database engine.
public IBucket[] S3ImportBuckets { get; set; }
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.
public IRole S3ImportRole { get; set; }
Property Value
Remarks
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
SecurityGroups
Security group.
public ISecurityGroup[] SecurityGroups { get; set; }
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.
public Nullable<double> ServerlessV2MaxCapacity { get; set; }
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 128 (256GB).
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.
public Nullable<double> ServerlessV2MinCapacity { get; set; }
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.5.
Default: 0.5
SnapshotCredentials
Master user credentials.
public SnapshotCredentials SnapshotCredentials { get; set; }
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.
public string SnapshotIdentifier { get; set; }
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.
public Nullable<bool> StorageEncrypted { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: - true if storageEncryptionKey is provided, false otherwise
StorageEncryptionKey
The KMS key for storage encryption.
public IKey StorageEncryptionKey { get; set; }
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.
public Nullable<DBClusterStorageType> StorageType { get; set; }
Property Value
System.Nullable<DBClusterStorageType>
Remarks
Default: - DBClusterStorageType.AURORA_IOPT1
SubnetGroup
Existing subnet group for the cluster.
public ISubnetGroup SubnetGroup { get; set; }
Property Value
Remarks
Default: - a new subnet group will be created.
Vpc
What subnets to run the RDS instances in.
public IVpc Vpc { get; set; }
Property Value
Remarks
Must be at least 2 subnets in two different AZs.
VpcSubnets
Where to place the instances within the VPC.
public ISubnetSelection VpcSubnets { get; set; }
Property Value
Remarks
Default: - the Vpc default strategy if not specified.
Writer
The instance to use for the cluster writer.
public IClusterInstance Writer { get; set; }
Property Value
Remarks
Default: required if instanceProps is not provided