Describe the bug
The DatabaseCluster.instanceEndpoints only returns the reader endpoints but not the writer endpoints, while DatabaseCluster.instanceIdentifiers returns identifiers for both.
Expected Behavior
According to the documentation I would expect both endpoints return the information for all instances:

i.e. DatabaseCluster.instanceEndpoints should return writer and reader endpoints.
Current Behavior
DatabaseCluster.instanceEndpoints only returns the reader endpoints but not the writer endpoints
Reproduction Steps
const clusterProps:DatabaseClusterProps = {
…,
writer: ClusterInstance.serverlessV2('writer'),
readers: [ClusterInstance.serverlessV2('reader')],
…
};
databaseCluster = new DatabaseCluster(
this,
`${id}`,
{
...clusterProps,
credentials: Credentials.fromSecret(secret),
},
);
databaseCluster.instanceEndpoints
Possible Solution
the writer endpoint should be added to instanceEndpoints here:
|
instanceIdentifiers.push(writer.instanceIdentifier); |
Additional Information/Context
No response
CDK CLI Version
2.130.0
Framework Version
No response
Node.js Version
v18.17.1
OS
Mac
Language
TypeScript
Language Version
No response
Other information
No response
Describe the bug
The DatabaseCluster.instanceEndpoints only returns the reader endpoints but not the writer endpoints, while DatabaseCluster.instanceIdentifiers returns identifiers for both.
Expected Behavior
According to the documentation I would expect both endpoints return the information for all instances:

i.e. DatabaseCluster.instanceEndpoints should return writer and reader endpoints.
Current Behavior
DatabaseCluster.instanceEndpoints only returns the reader endpoints but not the writer endpoints
Reproduction Steps
Possible Solution
the writer endpoint should be added to instanceEndpoints here:
aws-cdk/packages/aws-cdk-lib/aws-rds/lib/cluster.ts
Line 716 in f3d74bb
Additional Information/Context
No response
CDK CLI Version
2.130.0
Framework Version
No response
Node.js Version
v18.17.1
OS
Mac
Language
TypeScript
Language Version
No response
Other information
No response