@aws-cdk_aws-neptune-alpha.DatabaseCluster

class DatabaseCluster (construct) ๐Ÿ”น

LanguageType name
.NETAmazon.CDK.AWS.Neptune.Alpha.DatabaseCluster
Gogithub.com/aws/aws-cdk-go/awscdkneptunealpha/v2#DatabaseCluster
Javasoftware.amazon.awscdk.services.neptune.alpha.DatabaseCluster
Pythonaws_cdk.aws_neptune_alpha.DatabaseCluster
TypeScript (source)@aws-cdk/aws-neptune-alpha ยป DatabaseCluster

Implements IConstruct, IDependable, IResource, IDatabaseCluster, IConnectable

Create a clustered database with a given number of instances.

Example

const cluster = new neptune.DatabaseCluster(this, 'Database', {
  vpc,
  instanceType: neptune.InstanceType.R5_LARGE,
  instances: 2,
});

Initializer

new DatabaseCluster(scope: Construct, id: string, props: DatabaseClusterProps)

Parameters

  • scope Construct
  • id string
  • props DatabaseClusterProps

Construct Props

NameTypeDescription
instanceType๐Ÿ”นInstanceTypeWhat type of instance to start for the replicas.
vpc๐Ÿ”นIVpcWhat subnets to run the Neptune instances in.
associatedRoles?๐Ÿ”นIRole[]A list of AWS Identity and Access Management (IAM) role that can be used by the cluster to access other AWS services.
autoMinorVersionUpgrade?๐Ÿ”นbooleanIf set to true, Neptune will automatically update the engine of the entire cluster to the latest minor version after a stabilization window of 2 to 3 weeks.
backupRetention?๐Ÿ”นDurationHow many days to retain the backup.
cloudwatchLogsExports?๐Ÿ”นLogType[]The list of log types that need to be enabled for exporting to CloudWatch Logs.
cloudwatchLogsRetention?๐Ÿ”นRetentionDaysThe number of days log events are kept in CloudWatch Logs.
cloudwatchLogsRetentionRole?๐Ÿ”นIRoleThe IAM role for the Lambda function associated with the custom resource that sets the retention policy.
clusterParameterGroup?๐Ÿ”นIClusterParameterGroupAdditional parameters to pass to the database engine.
dbClusterName?๐Ÿ”นstringAn optional identifier for the cluster.
deletionProtection?๐Ÿ”นbooleanIndicates whether the DB cluster should have deletion protection enabled.
engineVersion?๐Ÿ”นEngineVersionWhat version of the database to start.
iamAuthentication?๐Ÿ”นbooleanMap AWS Identity and Access Management (IAM) accounts to database accounts.
instanceIdentifierBase?๐Ÿ”นstringBase identifier for instances.
instances?๐Ÿ”นnumberNumber of Neptune compute instances.
kmsKey?๐Ÿ”นIKeyThe KMS key for storage encryption.
parameterGroup?๐Ÿ”นIParameterGroupThe DB parameter group to associate with the instance.
port?๐Ÿ”นnumberThe port the Neptune cluster will listen on.
preferredBackupWindow?๐Ÿ”นstringA daily time range in 24-hours UTC format in which backups preferably execute.
preferredMaintenanceWindow?๐Ÿ”นstringA weekly time range in which maintenance should preferably execute.
removalPolicy?๐Ÿ”นRemovalPolicyThe removal policy to apply when the cluster and its instances are removed or replaced during a stack update, or when the stack is deleted.
securityGroups?๐Ÿ”นISecurityGroup[]Security group.
storageEncrypted?๐Ÿ”นbooleanWhether to enable storage encryption.
subnetGroup?๐Ÿ”นISubnetGroupExisting subnet group for the cluster.
vpcSubnets?๐Ÿ”นSubnetSelectionWhere to place the instances within the VPC.

instanceType๐Ÿ”น

Type: InstanceType

What type of instance to start for the replicas.


vpc๐Ÿ”น

Type: IVpc

What subnets to run the Neptune instances in.

Must be at least 2 subnets in two different AZs.


associatedRoles?๐Ÿ”น

Type: IRole[] (optional, default: No role is attached to the cluster.)

A list of AWS Identity and Access Management (IAM) role that can be used by the cluster to access other AWS services.


autoMinorVersionUpgrade?๐Ÿ”น

Type: boolean (optional, default: false)

If set to true, Neptune will automatically update the engine of the entire cluster to the latest minor version after a stabilization window of 2 to 3 weeks.


backupRetention?๐Ÿ”น

Type: Duration (optional, default: cdk.Duration.days(1))

How many days to retain the backup.


cloudwatchLogsExports?๐Ÿ”น

Type: LogType[] (optional, default: no log exports)

The list of log types that need to be enabled for exporting to CloudWatch Logs.

See also: https://docs.aws.amazon.com/neptune/latest/userguide/auditing.html#auditing-enable


cloudwatchLogsRetention?๐Ÿ”น

Type: RetentionDays (optional, default: logs never expire)

The number of days log events are kept in CloudWatch Logs.

When updating this property, unsetting it doesn't remove the log retention policy. To remove the retention policy, set the value to Infinity.


cloudwatchLogsRetentionRole?๐Ÿ”น

Type: IRole (optional, default: a new role is created.)

The IAM role for the Lambda function associated with the custom resource that sets the retention policy.


clusterParameterGroup?๐Ÿ”น

Type: IClusterParameterGroup (optional, default: No parameter group.)

Additional parameters to pass to the database engine.


dbClusterName?๐Ÿ”น

Type: string (optional, default: A name is automatically generated.)

An optional identifier for the cluster.


deletionProtection?๐Ÿ”น

Type: boolean (optional, default: true if removalPolicy is RETAIN, false otherwise)

Indicates whether the DB cluster should have deletion protection enabled.


engineVersion?๐Ÿ”น

Type: EngineVersion (optional, default: The default engine version.)

What version of the database to start.


iamAuthentication?๐Ÿ”น

Type: boolean (optional, default: false)

Map AWS Identity and Access Management (IAM) accounts to database accounts.


instanceIdentifierBase?๐Ÿ”น

Type: string (optional, default: dbClusterName is used with the word "Instance" appended. If dbClusterName is not provided, the identifier is automatically generated.)

Base identifier for instances.

Every replica is named by appending the replica number to this string, 1-based.


instances?๐Ÿ”น

Type: number (optional, default: 1)

Number of Neptune compute instances.


kmsKey?๐Ÿ”น

Type: IKey (optional, default: default master key.)

The KMS key for storage encryption.


parameterGroup?๐Ÿ”น

Type: IParameterGroup (optional, default: no parameter group)

The DB parameter group to associate with the instance.


port?๐Ÿ”น

Type: number (optional, default: The default engine port)

The port the Neptune cluster will listen on.


preferredBackupWindow?๐Ÿ”น

Type: string (optional, default: a 30-minute window selected at random from an 8-hour block of time for each AWS Region. To see the time blocks available, see)

A daily time range in 24-hours UTC format in which backups preferably execute.

Must be at least 30 minutes long.

Example: '01:00-02:00'


preferredMaintenanceWindow?๐Ÿ”น

Type: string (optional, 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.)

A weekly time range in which maintenance should preferably execute.

Must be at least 30 minutes long.

Example: 'tue:04:17-tue:04:47'


removalPolicy?๐Ÿ”น

Type: RemovalPolicy (optional, default: Retain cluster.)

The removal policy to apply when the cluster and its instances are removed or replaced during a stack update, or when the stack is deleted.

This removal policy also applies to the implicit security group created for the cluster if one is not supplied as a parameter.


securityGroups?๐Ÿ”น

Type: ISecurityGroup[] (optional, default: a new security group is created.)

Security group.


storageEncrypted?๐Ÿ”น

Type: boolean (optional, default: true)

Whether to enable storage encryption.


subnetGroup?๐Ÿ”น

Type: ISubnetGroup (optional, default: a new subnet group will be created.)

Existing subnet group for the cluster.


vpcSubnets?๐Ÿ”น

Type: SubnetSelection (optional, default: private subnets)

Where to place the instances within the VPC.

Properties

NameTypeDescription
clusterEndpoint๐Ÿ”นEndpointThe endpoint to use for read/write operations.
clusterIdentifier๐Ÿ”นstringIdentifier of the cluster.
clusterReadEndpoint๐Ÿ”นEndpointEndpoint to use for load-balanced read-only operations.
clusterResourceIdentifier๐Ÿ”นstringThe resource id for the cluster;
connections๐Ÿ”นConnectionsThe connections object to implement IConnectable.
env๐Ÿ”นResourceEnvironmentThe environment this resource belongs to.
instanceEndpoints๐Ÿ”นEndpoint[]Endpoints which address each individual instance.
instanceIdentifiers๐Ÿ”นstring[]Identifiers of the instance.
node๐Ÿ”นNodeThe tree node.
stack๐Ÿ”นStackThe stack in which this resource is defined.
subnetGroup๐Ÿ”นISubnetGroupSubnet group used by the DB.
vpc๐Ÿ”นIVpcThe VPC where the DB subnet group is created.
vpcSubnets๐Ÿ”นSubnetSelectionThe subnets used by the DB subnet group.
enableIamAuthentication?๐Ÿ”นboolean
static DEFAULT_NUM_INSTANCES๐Ÿ”นnumberThe default number of instances in the Neptune cluster if none are specified.

clusterEndpoint๐Ÿ”น

Type: Endpoint

The endpoint to use for read/write operations.


clusterIdentifier๐Ÿ”น

Type: string

Identifier of the cluster.


clusterReadEndpoint๐Ÿ”น

Type: Endpoint

Endpoint to use for load-balanced read-only operations.


clusterResourceIdentifier๐Ÿ”น

Type: string

The resource id for the cluster;

for example: cluster-ABCD1234EFGH5678IJKL90MNOP. The cluster ID uniquely identifies the cluster and is used in things like IAM authentication policies.


connections๐Ÿ”น

Type: Connections

The connections object to implement IConnectable.


env๐Ÿ”น

Type: 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.


instanceEndpoints๐Ÿ”น

Type: Endpoint[]

Endpoints which address each individual instance.


instanceIdentifiers๐Ÿ”น

Type: string[]

Identifiers of the instance.


node๐Ÿ”น

Type: Node

The tree node.


stack๐Ÿ”น

Type: Stack

The stack in which this resource is defined.


subnetGroup๐Ÿ”น

Type: ISubnetGroup

Subnet group used by the DB.


vpc๐Ÿ”น

Type: IVpc

The VPC where the DB subnet group is created.


vpcSubnets๐Ÿ”น

Type: SubnetSelection

The subnets used by the DB subnet group.


enableIamAuthentication?๐Ÿ”น

Type: boolean (optional)


static DEFAULT_NUM_INSTANCES๐Ÿ”น

Type: number

The default number of instances in the Neptune cluster if none are specified.

Methods

NameDescription
applyRemovalPolicy(policy)๐Ÿ”นApply the given removal policy to this resource.
grant(grantee, ...actions)๐Ÿ”นGrant the given identity the specified actions.
grantConnect(grantee)๐Ÿ”นGrant the given identity connection access to the database.
metric(metricName, props?)๐Ÿ”นReturn the given named metric associated with this DatabaseCluster instance.
toString()๐Ÿ”นReturns a string representation of this construct.

applyRemovalPolicy(policy)๐Ÿ”น

public applyRemovalPolicy(policy: RemovalPolicy): void

Parameters

  • policy RemovalPolicy

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


grant(grantee, ...actions)๐Ÿ”น

public grant(grantee: IGrantable, ...actions: string[]): Grant

Parameters

  • grantee IGrantable
  • actions string

Returns

  • Grant

Grant the given identity the specified actions.


grantConnect(grantee)๐Ÿ”น

public grantConnect(grantee: IGrantable): Grant

Parameters

  • grantee IGrantable

Returns

  • Grant

Grant the given identity connection access to the database.


metric(metricName, props?)๐Ÿ”น

public metric(metricName: string, props?: MetricOptions): Metric

Parameters

  • metricName string
  • props MetricOptions

Returns

  • Metric

Return the given named metric associated with this DatabaseCluster instance.


toString()๐Ÿ”น

public toString(): string

Returns

  • string

Returns a string representation of this construct.