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
clusterEndpointAddressoptionalstringcluster_endpoint_addressoptionalstrclusterEndpointAddressoptionalStringClusterEndpointAddressoptionalstringClusterEndpointAddressoptional*string#Cluster endpoint address.
Default: no endpoint address
clusterIdentifierstringcluster_identifierstrclusterIdentifierStringClusterIdentifierstringClusterIdentifier*stringrequired#Identifier for the cluster.
clusterResourceIdentifieroptionalstringcluster_resource_identifieroptionalstrclusterResourceIdentifieroptionalStringClusterResourceIdentifieroptionalstringClusterResourceIdentifieroptional*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.
dataApiEnabledoptionalbooleandata_api_enabledoptionalbooldataApiEnabledoptionalBooleanDataApiEnabledoptionalboolDataApiEnabledoptional*bool= false#Whether the Data API for the cluster is enabled.
engineoptionalIClusterEngineengineoptionalIClusterEngineengineoptionalIClusterEngineEngineoptionalIClusterEngineEngineoptionalIClusterEngine#The engine of the existing Cluster.
Default: the imported Cluster's engine is unknown
instanceEndpointAddressesoptionalstring[]instance_endpoint_addressesoptionaltyping.List[str]instanceEndpointAddressesoptionalList<String>InstanceEndpointAddressesoptionalstring[]InstanceEndpointAddressesoptional*[]*string#Endpoint addresses of individual instances.
Default: no instance endpoints
instanceIdentifiersoptionalstring[]instance_identifiersoptionaltyping.List[str]instanceIdentifiersoptionalList<String>InstanceIdentifiersoptionalstring[]InstanceIdentifiersoptional*[]*string#Identifier for the instances.
Default: no instance identifiers
portoptionalnumberportoptionalint | floatportoptionalNumberPortoptionaldoublePortoptional*float64= none#The database port.
readerEndpointAddressoptionalstringreader_endpoint_addressoptionalstrreaderEndpointAddressoptionalStringReaderEndpointAddressoptionalstringReaderEndpointAddressoptional*string#Reader endpoint address.
Default: no reader address
secretoptionalISecretsecretoptionalISecretsecretoptionalISecretSecretoptionalISecretSecretoptionalISecret#The secret attached to the database cluster.
Default: the imported Cluster's secret is unknown
securityGroupsoptionalISecurityGroup[]security_groupsoptionaltyping.List[ISecurityGroup]securityGroupsoptionalList<ISecurityGroup>SecurityGroupsoptionalISecurityGroup[]SecurityGroupsoptional*[]ISecurityGroup#The security groups of the database cluster.
Default: no security groups