-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Closed
Labels
@aws-cdk/aws-rdsRelated to Amazon Relational DatabaseRelated to Amazon Relational Databaseeffort/mediumMedium work item – several days of effortMedium work item – several days of effortfeature-requestA feature should be added or improved.A feature should be added or improved.p2
Description
Describe the feature
We can specify AvailabilityZone in Aurora's AWS::RDS::DBInstance as same as standalone RDS instances.
CDK is missing the feature.
Use Case
When I create a single-zone Aurora cluster and an EC2 instance in development purpose, I want to pin the Aurora instance and the EC2 instance in a same availability zone.
For example:
const instance = new ec2.Instance(this, 'MyDevelopmentInstance', {
availabilityZone: 'ap-northeast-1a',
// ...
});
const cluster = new rds.DatabaseCluster(this, 'MyDevelopmentCluster', {
writer: rds.ClusterInstance.serverlessV2('SingleInstance', {
availabilityZone: 'ap-northeast-1a', // THIS
},
// ...
});Proposed Solution
Add availaiblityZone prop to ClusterInstanceOptions.
Other Information
Escape hatch available but a bit complex.
const cfnInstance = cluster.node.findChild('SingleInstance').node.defaultChild as rds.CfnDBInstance;
cfnInstance.availabilityZone = 'ap-northeast-1a';I confirmed above escape hatch worked.
Acknowledgements
- I may be able to implement this feature request
- This feature might incur a breaking change
CDK version used
2.179.0
Environment details (OS name and version, etc.)
Linux
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-rdsRelated to Amazon Relational DatabaseRelated to Amazon Relational Databaseeffort/mediumMedium work item – several days of effortMedium work item – several days of effortfeature-requestA feature should be added or improved.A feature should be added or improved.p2