- Implements: aws-cdk-lib.aws_rds.IServerlessCluster
A Serverless Cluster restored from a snapshot.
import { ServerlessClusterFromSnapshot } from '@pepperize/cdk-serverless-cluster-from-snapshot'
new ServerlessClusterFromSnapshot(scope: Construct, id: string, props: ServerlessClusterFromSnapshotProps)
Name | Type | Description |
---|---|---|
scope |
constructs.Construct |
No description. |
id |
string |
No description. |
props |
ServerlessClusterFromSnapshotProps |
No description. |
- Type: constructs.Construct
- Type: string
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
applyRemovalPolicy |
Apply the given removal policy to this resource. |
addRotationMultiUser |
Adds the multi user rotation to this cluster. |
addRotationSingleUser |
Adds the single user rotation of the master password to this cluster. |
asSecretAttachmentTarget |
Renders the secret attachment target specifications. |
grantDataApiAccess |
Grant the given identity to access to the Data API, including read access to the secret attached to the cluster if present. |
public toString(): string
Returns a string representation of this construct.
public applyRemovalPolicy(policy: RemovalPolicy): void
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY
), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN
).
- Type: aws-cdk-lib.RemovalPolicy
public addRotationMultiUser(id: string, options: RotationMultiUserOptions): SecretRotation
Adds the multi user rotation to this cluster.
- Type: string
- Type: aws-cdk-lib.aws_rds.RotationMultiUserOptions
public addRotationSingleUser(options?: RotationSingleUserOptions): SecretRotation
Adds the single user rotation of the master password to this cluster.
- Type: aws-cdk-lib.aws_rds.RotationSingleUserOptions
public asSecretAttachmentTarget(): SecretAttachmentTargetProps
Renders the secret attachment target specifications.
public grantDataApiAccess(grantee: IGrantable): Grant
Grant the given identity to access to the Data API, including read access to the secret attached to the cluster if present.
- Type: aws-cdk-lib.aws_iam.IGrantable
The principal to grant access to.
Name | Description |
---|---|
isConstruct |
Checks if x is a construct. |
isResource |
Check whether the given construct is a Resource. |
import { ServerlessClusterFromSnapshot } from '@pepperize/cdk-serverless-cluster-from-snapshot'
ServerlessClusterFromSnapshot.isConstruct(x: any)
Checks if x
is a construct.
- Type: any
Any object.
import { ServerlessClusterFromSnapshot } from '@pepperize/cdk-serverless-cluster-from-snapshot'
ServerlessClusterFromSnapshot.isResource(construct: IConstruct)
Check whether the given construct is a Resource.
- Type: constructs.IConstruct
Name | Type | Description |
---|---|---|
node |
constructs.Node |
The tree node. |
env |
aws-cdk-lib.ResourceEnvironment |
The environment this resource belongs to. |
stack |
aws-cdk-lib.Stack |
The stack in which this resource is defined. |
clusterArn |
string |
The ARN of the cluster. |
clusterEndpoint |
aws-cdk-lib.aws_rds.Endpoint |
The endpoint to use for read/write operations. |
clusterIdentifier |
string |
Identifier of the cluster. |
clusterReadEndpoint |
aws-cdk-lib.aws_rds.Endpoint |
The endpoint to use for read/write operations. |
connections |
aws-cdk-lib.aws_ec2.Connections |
Access to the network connections. |
secret |
aws-cdk-lib.aws_secretsmanager.ISecret |
The secret attached to this cluster. |
public readonly node: Node;
- Type: constructs.Node
The tree node.
public readonly env: ResourceEnvironment;
- Type: aws-cdk-lib.ResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
public readonly stack: Stack;
- Type: aws-cdk-lib.Stack
The stack in which this resource is defined.
public readonly clusterArn: string;
- Type: string
The ARN of the cluster.
public readonly clusterEndpoint: Endpoint;
- Type: aws-cdk-lib.aws_rds.Endpoint
The endpoint to use for read/write operations.
public readonly clusterIdentifier: string;
- Type: string
Identifier of the cluster.
public readonly clusterReadEndpoint: Endpoint;
- Type: aws-cdk-lib.aws_rds.Endpoint
The endpoint to use for read/write operations.
public readonly connections: Connections;
- Type: aws-cdk-lib.aws_ec2.Connections
Access to the network connections.
public readonly secret: ISecret;
- Type: aws-cdk-lib.aws_secretsmanager.ISecret
The secret attached to this cluster.
Properties to configure an Aurora Serverless Cluster.
import { ServerlessClusterFromSnapshotProps } from '@pepperize/cdk-serverless-cluster-from-snapshot'
const serverlessClusterFromSnapshotProps: ServerlessClusterFromSnapshotProps = { ... }
Name | Type | Description |
---|---|---|
engine |
aws-cdk-lib.aws_rds.IClusterEngine |
What kind of database to start. |
snapshotIdentifier |
string |
The identifier for the DB snapshot or DB cluster snapshot to restore from. |
vpc |
aws-cdk-lib.aws_ec2.IVpc |
The VPC that this Aurora Serverless cluster has been created in. |
backupRetention |
aws-cdk-lib.Duration |
The number of days during which automatic DB snapshots are retained. |
clusterIdentifier |
string |
An optional identifier for the cluster. |
credentials |
aws-cdk-lib.aws_rds.Credentials |
Credentials for the administrative user. |
defaultDatabaseName |
string |
Name of a database which is automatically created inside the cluster. |
deletionProtection |
boolean |
Indicates whether the DB cluster should have deletion protection enabled. |
enableDataApi |
boolean |
Whether to enable the Data API. |
parameterGroup |
aws-cdk-lib.aws_rds.IParameterGroup |
Additional parameters to pass to the database engine. |
removalPolicy |
aws-cdk-lib.RemovalPolicy |
The removal policy to apply when the cluster and its instances are removed from the stack or replaced during an update. |
scaling |
aws-cdk-lib.aws_rds.ServerlessScalingOptions |
Scaling configuration of an Aurora Serverless database cluster. |
securityGroups |
aws-cdk-lib.aws_ec2.ISecurityGroup[] |
Security group. |
storageEncryptionKey |
aws-cdk-lib.aws_kms.IKey |
The KMS key for storage encryption. |
subnetGroup |
aws-cdk-lib.aws_rds.ISubnetGroup |
Existing subnet group for the cluster. |
vpcSubnets |
aws-cdk-lib.aws_ec2.SubnetSelection |
Where to place the instances within the VPC. |
public readonly engine: IClusterEngine;
- Type: aws-cdk-lib.aws_rds.IClusterEngine
What kind of database to start.
public readonly snapshotIdentifier: string;
- Type: string
The identifier for the DB 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 snapshot.
After you restore a DB cluster with a SnapshotIdentifier property, you must specify the same SnapshotIdentifier property for any future updates to the DB cluster. When you specify this property for an update, the DB cluster is not restored from the snapshot again, and the data in the database is not changed. However, if you don't specify the SnapshotIdentifier property, an empty DB cluster is created, and the original DB cluster is deleted. If you specify a property that is different from the previous snapshot restore property, a new DB cluster is restored from the specified SnapshotIdentifier property, and the original DB cluster is deleted.
public readonly vpc: IVpc;
- Type: aws-cdk-lib.aws_ec2.IVpc
The VPC that this Aurora Serverless cluster has been created in.
public readonly backupRetention: Duration;
- Type: aws-cdk-lib.Duration
- 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.
public readonly clusterIdentifier: string;
- Type: string
- Default: A name is automatically generated.
An optional identifier for the cluster.
public readonly credentials: Credentials;
- Type: aws-cdk-lib.aws_rds.Credentials
- Default: A username of 'admin' and SecretsManager-generated password
Credentials for the administrative user.
public readonly defaultDatabaseName: string;
- Type: string
- Default: Database is not created in cluster.
Name of a database which is automatically created inside the cluster.
public readonly deletionProtection: boolean;
- Type: boolean
- Default: true if removalPolicy is RETAIN, false otherwise
Indicates whether the DB cluster should have deletion protection enabled.
public readonly enableDataApi: boolean;
- Type: boolean
- Default: false
Whether to enable the Data API.
https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/data-api.html
public readonly parameterGroup: IParameterGroup;
- Type: aws-cdk-lib.aws_rds.IParameterGroup
- Default: no parameter group.
Additional parameters to pass to the database engine.
public readonly removalPolicy: RemovalPolicy;
- Type: aws-cdk-lib.RemovalPolicy
- 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.
public readonly scaling: ServerlessScalingOptions;
- Type: aws-cdk-lib.aws_rds.ServerlessScalingOptions
- 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.
public readonly securityGroups: ISecurityGroup[];
- Type: aws-cdk-lib.aws_ec2.ISecurityGroup[]
- Default: a new security group is created.
Security group.
public readonly storageEncryptionKey: IKey;
- Type: aws-cdk-lib.aws_kms.IKey
- Default: the default master key will be used for storage encryption
The KMS key for storage encryption.
If you specify the SnapshotIdentifier property, the StorageEncrypted property value is inherited from the snapshot, and if the DB cluster is encrypted, the specified KmsKeyId property is used.
public readonly subnetGroup: ISubnetGroup;
- Type: aws-cdk-lib.aws_rds.ISubnetGroup
- Default: a new subnet group will be created.
Existing subnet group for the cluster.
public readonly vpcSubnets: SubnetSelection;
- Type: aws-cdk-lib.aws_ec2.SubnetSelection
- Default: the VPC default strategy if not specified.
Where to place the instances within the VPC.