Show / Hide Table of Contents

Class DatabaseCluster

Create a clustered database with a given number of instances.

Inheritance
object
Resource
DatabaseCluster
Implements
IDatabaseCluster
IResource
IConnectable
ISecretAttachmentTarget
IDBClusterRef
IConstruct
IDependable
IEnvironmentAware
Inherited Members
Resource.IsOwnedResource(IConstruct)
Resource.IsResource(IConstruct)
Resource.ApplyRemovalPolicy(RemovalPolicy)
Resource.GeneratePhysicalName()
Resource.GetResourceArnAttribute(string, IArnComponents)
Resource.GetResourceNameAttribute(string)
Resource.Env
Resource.PhysicalName
Resource.Stack
Namespace: Amazon.CDK.AWS.DocDB
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class DatabaseCluster : Resource, IDatabaseCluster, IResource, IConnectable, ISecretAttachmentTarget, IDBClusterRef, IConstruct, IDependable, IEnvironmentAware
Syntax (vb)
Public Class DatabaseCluster Inherits Resource Implements IDatabaseCluster, IResource, IConnectable, ISecretAttachmentTarget, IDBClusterRef, IConstruct, IDependable, IEnvironmentAware
Remarks

Resource: AWS::DocDB::DBCluster

ExampleMetadata: infused

Examples
Vpc vpc;

             var cluster = new DatabaseCluster(this, "Database", new DatabaseClusterProps {
                 MasterUser = new Login {
                     Username = "myuser"
                 },
                 InstanceType = InstanceType.Of(InstanceClass.MEMORY5, InstanceSize.LARGE),
                 VpcSubnets = new SubnetSelection {
                     SubnetType = SubnetType.PUBLIC
                 },
                 Vpc = vpc,
                 DeletionProtection = true
             });

Synopsis

Constructors

DatabaseCluster(Construct, string, IDatabaseClusterProps)

Create a clustered database with a given number of instances.

Properties

ClusterEndpoint

The endpoint to use for read/write operations.

ClusterIdentifier

Identifier of the cluster.

ClusterReadEndpoint

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

ClusterResourceIdentifier

The resource id for the cluster;

Connections

The connections object to implement IConnectable.

DEFAULT_NUM_INSTANCES

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

DEFAULT_PORT

The default port Document DB listens on.

DbClusterRef

A reference to this cluster.

InstanceEndpoints

Endpoints which address each individual replica.

InstanceIdentifiers

Identifiers of the replicas.

PROPERTY_INJECTION_ID

Uniquely identifies this class.

Secret

The secret attached to this cluster.

SecurityGroupId

Security group identifier of this database.

Methods

AddRotationMultiUser(string, IRotationMultiUserOptions)

Adds the multi user rotation to this cluster.

AddRotationSingleUser(Duration?)

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

AddSecurityGroups(params ISecurityGroup[])

Adds security groups to this cluster.

AsSecretAttachmentTarget()

Renders the secret attachment target specifications.

FromDatabaseClusterAttributes(Construct, string, IDatabaseClusterAttributes)

Import an existing DatabaseCluster from properties.

Constructors

DatabaseCluster(Construct, string, IDatabaseClusterProps)

Create a clustered database with a given number of instances.

public DatabaseCluster(Construct scope, string id, IDatabaseClusterProps props)
Parameters
scope Construct
id string
props IDatabaseClusterProps
Remarks

Resource: AWS::DocDB::DBCluster

ExampleMetadata: infused

Examples
Vpc vpc;

             var cluster = new DatabaseCluster(this, "Database", new DatabaseClusterProps {
                 MasterUser = new Login {
                     Username = "myuser"
                 },
                 InstanceType = InstanceType.Of(InstanceClass.MEMORY5, InstanceSize.LARGE),
                 VpcSubnets = new SubnetSelection {
                     SubnetType = SubnetType.PUBLIC
                 },
                 Vpc = vpc,
                 DeletionProtection = true
             });

Properties

ClusterEndpoint

The endpoint to use for read/write operations.

public virtual Endpoint ClusterEndpoint { get; }
Property Value

Endpoint

Remarks

Resource: AWS::DocDB::DBCluster

ExampleMetadata: infused

ClusterIdentifier

Identifier of the cluster.

public virtual string ClusterIdentifier { get; }
Property Value

string

Remarks

Resource: AWS::DocDB::DBCluster

ExampleMetadata: infused

ClusterReadEndpoint

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

public virtual Endpoint ClusterReadEndpoint { get; }
Property Value

Endpoint

Remarks

Resource: AWS::DocDB::DBCluster

ExampleMetadata: infused

ClusterResourceIdentifier

The resource id for the cluster;

public virtual string ClusterResourceIdentifier { get; }
Property Value

string

Remarks

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

Attribute: ClusterResourceId

Connections

The connections object to implement IConnectable.

public virtual Connections_ Connections { get; }
Property Value

Connections_

Remarks

Resource: AWS::DocDB::DBCluster

ExampleMetadata: infused

DEFAULT_NUM_INSTANCES

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

public static double DEFAULT_NUM_INSTANCES { get; }
Property Value

double

Remarks

Resource: AWS::DocDB::DBCluster

ExampleMetadata: infused

DEFAULT_PORT

The default port Document DB listens on.

public static double DEFAULT_PORT { get; }
Property Value

double

Remarks

Resource: AWS::DocDB::DBCluster

ExampleMetadata: infused

DbClusterRef

A reference to this cluster.

public virtual IDBClusterReference DbClusterRef { get; }
Property Value

IDBClusterReference

Remarks

Resource: AWS::DocDB::DBCluster

ExampleMetadata: infused

InstanceEndpoints

Endpoints which address each individual replica.

public virtual Endpoint[] InstanceEndpoints { get; }
Property Value

Endpoint[]

Remarks

Resource: AWS::DocDB::DBCluster

ExampleMetadata: infused

InstanceIdentifiers

Identifiers of the replicas.

public virtual string[] InstanceIdentifiers { get; }
Property Value

string[]

Remarks

Resource: AWS::DocDB::DBCluster

ExampleMetadata: infused

PROPERTY_INJECTION_ID

Uniquely identifies this class.

public static string PROPERTY_INJECTION_ID { get; }
Property Value

string

Remarks

Resource: AWS::DocDB::DBCluster

ExampleMetadata: infused

Secret

The secret attached to this cluster.

public virtual ISecret? Secret { get; }
Property Value

ISecret

Remarks

Resource: AWS::DocDB::DBCluster

ExampleMetadata: infused

SecurityGroupId

Security group identifier of this database.

public virtual string SecurityGroupId { get; }
Property Value

string

Remarks

Resource: AWS::DocDB::DBCluster

ExampleMetadata: infused

Methods

AddRotationMultiUser(string, IRotationMultiUserOptions)

Adds the multi user rotation to this cluster.

public virtual SecretRotation AddRotationMultiUser(string id, IRotationMultiUserOptions options)
Parameters
id string
options IRotationMultiUserOptions
Returns

SecretRotation

Remarks

Resource: AWS::DocDB::DBCluster

ExampleMetadata: infused

AddRotationSingleUser(Duration?)

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

public virtual SecretRotation AddRotationSingleUser(Duration? automaticallyAfter = null)
Parameters
automaticallyAfter Duration

Specifies the number of days after the previous rotation before Secrets Manager triggers the next automatic rotation.

Returns

SecretRotation

Remarks

Resource: AWS::DocDB::DBCluster

ExampleMetadata: infused

AddSecurityGroups(params ISecurityGroup[])

Adds security groups to this cluster.

public virtual void AddSecurityGroups(params ISecurityGroup[] securityGroups)
Parameters
securityGroups ISecurityGroup[]

The security groups to add.

Remarks

Resource: AWS::DocDB::DBCluster

ExampleMetadata: infused

AsSecretAttachmentTarget()

Renders the secret attachment target specifications.

public virtual ISecretAttachmentTargetProps AsSecretAttachmentTarget()
Returns

ISecretAttachmentTargetProps

Remarks

Resource: AWS::DocDB::DBCluster

ExampleMetadata: infused

FromDatabaseClusterAttributes(Construct, string, IDatabaseClusterAttributes)

Import an existing DatabaseCluster from properties.

public static IDatabaseCluster FromDatabaseClusterAttributes(Construct scope, string id, IDatabaseClusterAttributes attrs)
Parameters
scope Construct
id string
attrs IDatabaseClusterAttributes
Returns

IDatabaseCluster

Remarks

Resource: AWS::DocDB::DBCluster

ExampleMetadata: infused

Implements

IDatabaseCluster
IResource
IConnectable
ISecretAttachmentTarget
IDBClusterRef
Constructs.IConstruct
Constructs.IDependable
IEnvironmentAware
Back to top Generated by DocFX