Class DatabaseCluster
Create a clustered database with a given number of instances.
Implements
Inherited Members
Namespace: Amazon.CDK.AWS.DocDB
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class DatabaseCluster : Resource, IDatabaseCluster, IResource, IConnectable, ISecretAttachmentTarget
Syntax (vb)
Public Class DatabaseCluster
Inherits Resource
Implements IDatabaseCluster, IResource, IConnectable, ISecretAttachmentTarget
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,
RemovalPolicy = RemovalPolicy.SNAPSHOT
});
Synopsis
Constructors
DatabaseCluster(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
DatabaseCluster(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
DatabaseCluster(Construct, String, IDatabaseClusterProps) |
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. |
InstanceEndpoints | Endpoints which address each individual replica. |
InstanceIdentifiers | Identifiers of the replicas. |
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(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(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected DatabaseCluster(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
DatabaseCluster(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected DatabaseCluster(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
DatabaseCluster(Construct, String, IDatabaseClusterProps)
public DatabaseCluster(Construct scope, string id, IDatabaseClusterProps props)
Parameters
- scope Constructs.Construct
- id System.String
- props IDatabaseClusterProps
Properties
ClusterEndpoint
The endpoint to use for read/write operations.
public virtual Endpoint ClusterEndpoint { get; }
Property Value
ClusterIdentifier
Identifier of the cluster.
public virtual string ClusterIdentifier { get; }
Property Value
System.String
ClusterReadEndpoint
Endpoint to use for load-balanced read-only operations.
public virtual Endpoint ClusterReadEndpoint { get; }
Property Value
ClusterResourceIdentifier
The resource id for the cluster;
public virtual string ClusterResourceIdentifier { get; }
Property Value
System.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
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
System.Double
DEFAULT_PORT
The default port Document DB listens on.
public static double DEFAULT_PORT { get; }
Property Value
System.Double
InstanceEndpoints
Endpoints which address each individual replica.
public virtual Endpoint[] InstanceEndpoints { get; }
Property Value
Endpoint[]
InstanceIdentifiers
Identifiers of the replicas.
public virtual string[] InstanceIdentifiers { get; }
Property Value
System.String[]
Secret
SecurityGroupId
Security group identifier of this database.
public virtual string SecurityGroupId { get; }
Property Value
System.String
Methods
AddRotationMultiUser(String, IRotationMultiUserOptions)
Adds the multi user rotation to this cluster.
public virtual SecretRotation AddRotationMultiUser(string id, IRotationMultiUserOptions options)
Parameters
- id System.String
- options IRotationMultiUserOptions
Returns
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
AddSecurityGroups(ISecurityGroup[])
Adds security groups to this cluster.
public virtual void AddSecurityGroups(params ISecurityGroup[] securityGroups)
Parameters
- securityGroups ISecurityGroup[]
The security groups to add.
AsSecretAttachmentTarget()
Renders the secret attachment target specifications.
public virtual ISecretAttachmentTargetProps AsSecretAttachmentTarget()
Returns
FromDatabaseClusterAttributes(Construct, String, IDatabaseClusterAttributes)
Import an existing DatabaseCluster from properties.
public static IDatabaseCluster FromDatabaseClusterAttributes(Construct scope, string id, IDatabaseClusterAttributes attrs)
Parameters
- scope Constructs.Construct
- id System.String
- attrs IDatabaseClusterAttributes
Returns