interface ServerlessClusterProps
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.RDS.ServerlessClusterProps |
![]() | software.amazon.awscdk.services.rds.ServerlessClusterProps |
![]() | aws_cdk.aws_rds.ServerlessClusterProps |
![]() | @aws-cdk/aws-rds » ServerlessClusterProps |
Properties for a new Aurora Serverless Cluster.
Example
declare const vpc: ec2.Vpc;
const cluster = new rds.ServerlessCluster(this, 'AnotherCluster', {
engine: rds.DatabaseClusterEngine.AURORA_MYSQL,
vpc, // this parameter is optional for serverless Clusters
enableDataApi: true, // Optional - will be automatically set if you call grantDataApiAccess()
});
declare const code: lambda.Code;
const fn = new lambda.Function(this, 'MyFunction', {
runtime: lambda.Runtime.NODEJS_14_X,
handler: 'index.handler',
code,
environment: {
CLUSTER_ARN: cluster.clusterArn,
SECRET_ARN: cluster.secret!.secretArn,
},
});
cluster.grantDataApiAccess(fn);
Properties
Name | Type | Description |
---|---|---|
engine | ICluster | What kind of database to start. |
backup | Duration | The number of days during which automatic DB snapshots are retained. |
cluster | string | An optional identifier for the cluster. |
credentials? | Credentials | Credentials for the administrative user. |
default | string | Name of a database which is automatically created inside the cluster. |
deletion | boolean | Indicates whether the DB cluster should have deletion protection enabled. |
enable | boolean | Whether to enable the Data API. |
parameter | IParameter | Additional parameters to pass to the database engine. |
removal | Removal | The removal policy to apply when the cluster and its instances are removed from the stack or replaced during an update. |
scaling? | Serverless | Scaling configuration of an Aurora Serverless database cluster. |
security | ISecurity [] | Security group. |
storage | IKey | The KMS key for storage encryption. |
subnet | ISubnet | Existing subnet group for the cluster. |
vpc? | IVpc | The VPC that this Aurora Serverless cluster has been created in. |
vpc | Subnet | Where to place the instances within the VPC. |
engine
Type:
ICluster
What kind of database to start.
backupRetention?
Type:
Duration
(optional, default: Duration.days(1))
The number of days during which automatic DB snapshots are retained.
Automatic backup retention cannot be disabled on serverless clusters. Must be a value from 1 day to 35 days.
clusterIdentifier?
Type:
string
(optional, default: A name is automatically generated.)
An optional identifier for the cluster.
credentials?
Type:
Credentials
(optional, default: A username of 'admin' and SecretsManager-generated password)
Credentials for the administrative user.
defaultDatabaseName?
Type:
string
(optional, default: Database is not created in cluster.)
Name of a database which is automatically created inside the cluster.
deletionProtection?
Type:
boolean
(optional, default: true if removalPolicy is RETAIN, false otherwise)
Indicates whether the DB cluster should have deletion protection enabled.
enableDataApi?
Type:
boolean
(optional, default: false)
Whether to enable the Data API.
See also: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/data-api.html
parameterGroup?
Type:
IParameter
(optional, default: no parameter group.)
Additional parameters to pass to the database engine.
removalPolicy?
Type:
Removal
(optional, default: RemovalPolicy.SNAPSHOT (remove the cluster and instances, but retain a snapshot of the data))
The removal policy to apply when the cluster and its instances are removed from the stack or replaced during an update.
scaling?
Type:
Serverless
(optional, default: Serverless cluster is automatically paused after 5 minutes of being idle.
minimum capacity: 2 ACU
maximum capacity: 16 ACU)
Scaling configuration of an Aurora Serverless database cluster.
securityGroups?
Type:
ISecurity
[]
(optional, 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.)
Security group.
storageEncryptionKey?
Type:
IKey
(optional, default: the default master key will be used for storage encryption)
The KMS key for storage encryption.
subnetGroup?
Type:
ISubnet
(optional, 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)
Existing subnet group for the cluster.
vpc?
Type:
IVpc
(optional, default: the default VPC in the account and region will be used)
The VPC that this Aurora Serverless cluster has been created in.
vpcSubnets?
Type:
Subnet
(optional, default: the VPC default strategy if not specified.)
Where to place the instances within the VPC.
If provided, the vpc
property must also be specified.