Skip to content
v2.278.0

ClusterInstanceBindOptions Struct ​

Options for binding the instance to the cluster.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
import { aws_rds as rds } from 'aws-cdk-lib';
import { aws_iam as interfaces_iam } from 'aws-cdk-lib/interfaces';
import { aws_rds as interfaces_rds } from 'aws-cdk-lib/interfaces';

declare const dBSubnetGroupRef: interfaces_rds.IDBSubnetGroupRef;
declare const roleRef: interfaces_iam.IRoleRef;
const clusterInstanceBindOptions: rds.ClusterInstanceBindOptions = {
  monitoringInterval: cdk.Duration.minutes(30),
  monitoringRole: roleRef,
  promotionTier: 123,
  removalPolicy: cdk.RemovalPolicy.DESTROY,
  subnetGroup: dBSubnetGroupRef,
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk as cdk
from aws_cdk import aws_rds as rds
from aws_cdk.interfaces import aws_iam as interfaces_iam
from aws_cdk.interfaces import aws_rds as interfaces_rds

# d_b_subnet_group_ref: interfaces_rds.IDBSubnetGroupRef
# role_ref: interfaces_iam.IRoleRef

cluster_instance_bind_options = rds.ClusterInstanceBindOptions(
    monitoring_interval=cdk.Duration.minutes(30),
    monitoring_role=role_ref,
    promotion_tier=123,
    removal_policy=cdk.RemovalPolicy.DESTROY,
    subnet_group=d_b_subnet_group_ref
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.*;
import software.amazon.awscdk.services.rds.*;
import software.amazon.awscdk.interfaces.iam.*;
import software.amazon.awscdk.interfaces.rds.*;

IDBSubnetGroupRef dBSubnetGroupRef;
IRoleRef roleRef;

ClusterInstanceBindOptions clusterInstanceBindOptions = ClusterInstanceBindOptions.builder()
        .monitoringInterval(Duration.minutes(30))
        .monitoringRole(roleRef)
        .promotionTier(123)
        .removalPolicy(RemovalPolicy.DESTROY)
        .subnetGroup(dBSubnetGroupRef)
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK;
using Amazon.CDK.AWS.RDS;
using Amazon.CDK.Interfaces.IAM;
using Amazon.CDK.Interfaces.RDS;

IDBSubnetGroupRef dBSubnetGroupRef;
IRoleRef roleRef;

var clusterInstanceBindOptions = new ClusterInstanceBindOptions {
    MonitoringInterval = Duration.Minutes(30),
    MonitoringRole = roleRef,
    PromotionTier = 123,
    RemovalPolicy = RemovalPolicy.DESTROY,
    SubnetGroup = dBSubnetGroupRef
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var dBSubnetGroupRef IDBSubnetGroupRef
var roleRef IRoleRef

clusterInstanceBindOptions := &ClusterInstanceBindOptions{
	MonitoringInterval: cdk.Duration_Minutes(jsii.Number(30)),
	MonitoringRole: roleRef,
	PromotionTier: jsii.Number(123),
	RemovalPolicy: cdk.RemovalPolicy_DESTROY,
	SubnetGroup: dBSubnetGroupRef,
}

Properties ​

monitoringIntervaloptionalDurationmonitoring_intervaloptionalDurationmonitoringIntervaloptionalDurationMonitoringIntervaloptionalDurationMonitoringIntervaloptionalDuration #
The interval, in seconds, between points when Amazon RDS collects enhanced monitoring metrics for the DB instances.

Default: no enhanced monitoring

monitoringRoleoptionalIRoleRefmonitoring_roleoptionalIRoleRefmonitoringRoleoptionalIRoleRefMonitoringRoleoptionalIRoleRefMonitoringRoleoptionalIRoleRef #
Role that will be used to manage DB instances monitoring.

Default: A role is automatically created for you

promotionTieroptionalnumberpromotion_tieroptionalint | floatpromotionTieroptionalNumberPromotionTieroptionaldoublePromotionTieroptional*float64 = 2 #
The promotion tier of the cluster instance.
notes

This matters more for serverlessV2 instances. If a serverless instance is in tier 0-1 then it will scale with the writer.

For provisioned instances this just determines the failover priority. If multiple instances have the same priority then one will be picked at random

removalPolicyoptionalRemovalPolicyremoval_policyoptionalRemovalPolicyremovalPolicyoptionalRemovalPolicyRemovalPolicyoptionalRemovalPolicyRemovalPolicyoptionalRemovalPolicy #
The removal policy on the cluster.

Default: RemovalPolicy.DESTROY (cluster snapshot can restore)

subnetGroupoptionalIDBSubnetGroupRefsubnet_groupoptionalIDBSubnetGroupRefsubnetGroupoptionalIDBSubnetGroupRefSubnetGroupoptionalIDBSubnetGroupRefSubnetGroupoptionalIDBSubnetGroupRef #
Existing subnet group for the cluster.

Default: cluster subnet group is used

This is only needed when using the isFromLegacyInstanceProps