Skip to content
v2.273.0

DatabaseClusterAttributes Struct ​

Properties that describe an existing cluster instance.

Example ​

ts
declare const vpc: ec2.Vpc;
declare const fn: lambda.Function;
declare const secret: secretsmanager.Secret;

// Create a serverless V1 cluster
const serverlessV1Cluster = new rds.ServerlessCluster(this, 'AnotherCluster', {
  engine: rds.DatabaseClusterEngine.AURORA_MYSQL,
  vpc, // this parameter is optional for serverless Clusters
  enableDataApi: true, // Optional - will be automatically set if you call grantDataApiAccess()
});
serverlessV1Cluster.grantDataApiAccess(fn);

// Create an Aurora cluster
const cluster = new rds.DatabaseCluster(this, 'Cluster', {
  engine: rds.DatabaseClusterEngine.AURORA_MYSQL,
  vpc,
  enableDataApi: true, // Optional - will be automatically set if you call grantDataApiAccess()
});
cluster.grantDataApiAccess(fn);

// Import an Aurora cluster
const importedCluster = rds.DatabaseCluster.fromDatabaseClusterAttributes(this, 'ImportedCluster', {
  clusterIdentifier: 'clusterIdentifier',
  secret,
  dataApiEnabled: true,
});
importedCluster.grantDataApiAccess(fn);

Properties ​

clusterEndpointAddressstringcluster_endpoint_addressstrclusterEndpointAddressStringClusterEndpointAddressstringClusterEndpointAddress*string= no endpoint address#
Cluster endpoint address.
clusterIdentifierstringcluster_identifierstrclusterIdentifierStringClusterIdentifierstringClusterIdentifier*stringrequired#
Identifier for the cluster.
clusterResourceIdentifierstringcluster_resource_identifierstrclusterResourceIdentifierStringClusterResourceIdentifierstringClusterResourceIdentifier*string= none#
The immutable identifier for the cluster; for example: cluster-ABCD1234EFGH5678IJKL90MNOP.

This AWS Region-unique identifier is used to grant access to the cluster.

dataApiEnabledbooleandata_api_enabledbooldataApiEnabledBooleanDataApiEnabledboolDataApiEnabled*bool= false#
Whether the Data API for the cluster is enabled.
engineIClusterEngineengineIClusterEngineengineIClusterEngineEngineIClusterEngineEngineIClusterEngine= the imported Cluster's engine is…#
The engine of the existing Cluster.
default

Default: the imported Cluster's engine is unknown

instanceEndpointAddressesstring[]instance_endpoint_addressestyping.List[str]instanceEndpointAddressesList<String>InstanceEndpointAddressesstring[]InstanceEndpointAddresses*[]*string= no instance endpoints#
Endpoint addresses of individual instances.
instanceIdentifiersstring[]instance_identifierstyping.List[str]instanceIdentifiersList<String>InstanceIdentifiersstring[]InstanceIdentifiers*[]*string= no instance identifiers#
Identifier for the instances.
portnumberportint | floatportNumberPortdoublePort*float64= none#
The database port.
readerEndpointAddressstringreader_endpoint_addressstrreaderEndpointAddressStringReaderEndpointAddressstringReaderEndpointAddress*string= no reader address#
Reader endpoint address.
secretISecretsecretISecretsecretISecretSecretISecretSecretISecret= the imported Cluster's secret is…#
The secret attached to the database cluster.
default

Default: the imported Cluster's secret is unknown

securityGroupsISecurityGroup[]security_groupstyping.List[ISecurityGroup]securityGroupsList<ISecurityGroup>SecurityGroupsISecurityGroup[]SecurityGroups*[]ISecurityGroup= no security groups#
The security groups of the database cluster.