Skip to content

Latest commit

 

History

History
575 lines (353 loc) · 25.4 KB

File metadata and controls

575 lines (353 loc) · 25.4 KB

API Reference

Constructs

ServerlessClusterFromSnapshot

  • Implements: aws-cdk-lib.aws_rds.IServerlessCluster

A Serverless Cluster restored from a snapshot.

Initializers

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.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

propsRequired

Methods

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.

toString
public toString(): string

Returns a string representation of this construct.

applyRemovalPolicy
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).

policyRequired
  • Type: aws-cdk-lib.RemovalPolicy

addRotationMultiUser
public addRotationMultiUser(id: string, options: RotationMultiUserOptions): SecretRotation

Adds the multi user rotation to this cluster.

idRequired
  • Type: string

optionsRequired
  • Type: aws-cdk-lib.aws_rds.RotationMultiUserOptions

addRotationSingleUser
public addRotationSingleUser(options?: RotationSingleUserOptions): SecretRotation

Adds the single user rotation of the master password to this cluster.

optionsOptional
  • Type: aws-cdk-lib.aws_rds.RotationSingleUserOptions

asSecretAttachmentTarget
public asSecretAttachmentTarget(): SecretAttachmentTargetProps

Renders the secret attachment target specifications.

grantDataApiAccess
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.

granteeRequired
  • Type: aws-cdk-lib.aws_iam.IGrantable

The principal to grant access to.


Static Functions

Name Description
isConstruct Checks if x is a construct.
isResource Check whether the given construct is a Resource.

isConstruct
import { ServerlessClusterFromSnapshot } from '@pepperize/cdk-serverless-cluster-from-snapshot'

ServerlessClusterFromSnapshot.isConstruct(x: any)

Checks if x is a construct.

xRequired
  • Type: any

Any object.


isResource
import { ServerlessClusterFromSnapshot } from '@pepperize/cdk-serverless-cluster-from-snapshot'

ServerlessClusterFromSnapshot.isResource(construct: IConstruct)

Check whether the given construct is a Resource.

constructRequired
  • Type: constructs.IConstruct

Properties

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.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


envRequired
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.


stackRequired
public readonly stack: Stack;
  • Type: aws-cdk-lib.Stack

The stack in which this resource is defined.


clusterArnRequired
public readonly clusterArn: string;
  • Type: string

The ARN of the cluster.


clusterEndpointRequired
public readonly clusterEndpoint: Endpoint;
  • Type: aws-cdk-lib.aws_rds.Endpoint

The endpoint to use for read/write operations.


clusterIdentifierRequired
public readonly clusterIdentifier: string;
  • Type: string

Identifier of the cluster.


clusterReadEndpointRequired
public readonly clusterReadEndpoint: Endpoint;
  • Type: aws-cdk-lib.aws_rds.Endpoint

The endpoint to use for read/write operations.


connectionsRequired
public readonly connections: Connections;
  • Type: aws-cdk-lib.aws_ec2.Connections

Access to the network connections.


secretOptional
public readonly secret: ISecret;
  • Type: aws-cdk-lib.aws_secretsmanager.ISecret

The secret attached to this cluster.


Structs

ServerlessClusterFromSnapshotProps

Properties to configure an Aurora Serverless Cluster.

Initializer

import { ServerlessClusterFromSnapshotProps } from '@pepperize/cdk-serverless-cluster-from-snapshot'

const serverlessClusterFromSnapshotProps: ServerlessClusterFromSnapshotProps = { ... }

Properties

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.

engineRequired
public readonly engine: IClusterEngine;
  • Type: aws-cdk-lib.aws_rds.IClusterEngine

What kind of database to start.


snapshotIdentifierRequired
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.


vpcRequired
public readonly vpc: IVpc;
  • Type: aws-cdk-lib.aws_ec2.IVpc

The VPC that this Aurora Serverless cluster has been created in.


backupRetentionOptional
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.


clusterIdentifierOptional
public readonly clusterIdentifier: string;
  • Type: string
  • Default: A name is automatically generated.

An optional identifier for the cluster.


credentialsOptional
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.


defaultDatabaseNameOptional
public readonly defaultDatabaseName: string;
  • Type: string
  • Default: Database is not created in cluster.

Name of a database which is automatically created inside the cluster.


deletionProtectionOptional
public readonly deletionProtection: boolean;
  • Type: boolean
  • Default: true if removalPolicy is RETAIN, false otherwise

Indicates whether the DB cluster should have deletion protection enabled.


enableDataApiOptional
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


parameterGroupOptional
public readonly parameterGroup: IParameterGroup;
  • Type: aws-cdk-lib.aws_rds.IParameterGroup
  • Default: no parameter group.

Additional parameters to pass to the database engine.


removalPolicyOptional
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.


scalingOptional
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.


securityGroupsOptional
public readonly securityGroups: ISecurityGroup[];
  • Type: aws-cdk-lib.aws_ec2.ISecurityGroup[]
  • Default: a new security group is created.

Security group.


storageEncryptionKeyOptional
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.


subnetGroupOptional
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.


vpcSubnetsOptional
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.