Interface IServerlessClusterProps
Properties for a new Aurora Serverless Cluster.
Namespace: Amazon.CDK.AWS.RDS
Assembly: Amazon.CDK.AWS.RDS.dll
Syntax (csharp)
public interface IServerlessClusterProps
Syntax (vb)
Public Interface IServerlessClusterProps
Remarks
ExampleMetadata: infused
Examples
Vpc vpc;
Code code;
var cluster = new ServerlessCluster(this, "AnotherCluster", new ServerlessClusterProps {
Engine = DatabaseClusterEngine.AURORA_MYSQL,
Vpc = vpc, // this parameter is optional for serverless Clusters
EnableDataApi = true
});
var fn = new Function(this, "MyFunction", new FunctionProps {
Runtime = Runtime.NODEJS_14_X,
Handler = "index.handler",
Code = code,
Environment = new Dictionary<string, string> {
{ "CLUSTER_ARN", cluster.ClusterArn },
{ "SECRET_ARN", cluster.Secret.SecretArn }
}
});
cluster.GrantDataApiAccess(fn);
Synopsis
Properties
BackupRetention | The number of days during which automatic DB snapshots are retained. |
ClusterIdentifier | An optional identifier for the cluster. |
Credentials | 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. |
EnableDataApi | Whether to enable the Data API. |
Engine | What kind of database to start. |
ParameterGroup | Additional parameters to pass to the database engine. |
RemovalPolicy | The removal policy to apply when the cluster and its instances are removed from the stack or replaced during an update. |
Scaling | Scaling configuration of an Aurora Serverless database cluster. |
SecurityGroups | Security group. |
StorageEncryptionKey | The KMS key for storage encryption. |
SubnetGroup | Existing subnet group for the cluster. |
Vpc | The VPC that this Aurora Serverless cluster has been created in. |
VpcSubnets | Where to place the instances within the VPC. |
Properties
BackupRetention
The number of days during which automatic DB snapshots are retained.
virtual Duration BackupRetention { get; }
Property Value
Remarks
Automatic backup retention cannot be disabled on serverless clusters. Must be a value from 1 day to 35 days.
Default: Duration.days(1)
ClusterIdentifier
An optional identifier for the cluster.
virtual string ClusterIdentifier { get; }
Property Value
System.String
Remarks
Default: - A name is automatically generated.
Credentials
Credentials for the administrative user.
virtual Credentials Credentials { get; }
Property Value
Remarks
Default: - A username of 'admin' and SecretsManager-generated password
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, false otherwise
EnableDataApi
Whether to enable the Data API.
virtual Nullable<bool> EnableDataApi { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: false
See: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/data-api.html
Engine
ParameterGroup
Additional parameters to pass to the database engine.
virtual IParameterGroup ParameterGroup { get; }
Property Value
Remarks
Default: - no parameter group.
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)
Scaling
Scaling configuration of an Aurora Serverless database cluster.
virtual IServerlessScalingOptions Scaling { get; }
Property Value
Remarks
Default: - Serverless cluster is automatically paused after 5 minutes of being idle. minimum capacity: 2 ACU maximum capacity: 16 ACU
SecurityGroups
Security group.
virtual ISecurityGroup[] SecurityGroups { get; }
Property Value
Remarks
Default: - a new security group is created if vpc
was provided.
If the vpc
property was not provided, no VPC security groups will be associated with the DB cluster.
StorageEncryptionKey
The KMS key for storage encryption.
virtual IKey StorageEncryptionKey { get; }
Property Value
Remarks
Default: - the default master key will be used for storage encryption
SubnetGroup
Existing subnet group for the cluster.
virtual ISubnetGroup SubnetGroup { get; }
Property Value
Remarks
Default: - a new subnet group is created if vpc
was provided.
If the vpc
property was not provided, no subnet group will be associated with the DB cluster
Vpc
The VPC that this Aurora Serverless cluster has been created in.
virtual IVpc Vpc { get; }
Property Value
Remarks
Default: - the default VPC in the account and region will be used
VpcSubnets
Where to place the instances within the VPC.
virtual ISubnetSelection VpcSubnets { get; }
Property Value
Remarks
If provided, the vpc
property must also be specified.
Default: - the VPC default strategy if not specified.