Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(rds): allow to specify availability zone for Aurora instances #33503

Open
1 of 2 tasks
Tietew opened this issue Feb 19, 2025 · 1 comment · May be fixed by #33515
Open
1 of 2 tasks

(rds): allow to specify availability zone for Aurora instances #33503

Tietew opened this issue Feb 19, 2025 · 1 comment · May be fixed by #33515
Labels
@aws-cdk/aws-rds Related to Amazon Relational Database effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2

Comments

@Tietew
Copy link
Contributor

Tietew commented Feb 19, 2025

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

@Tietew Tietew added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Feb 19, 2025
@github-actions github-actions bot added the @aws-cdk/aws-rds Related to Amazon Relational Database label Feb 19, 2025
@pahud
Copy link
Contributor

pahud commented Feb 19, 2025

Yeah if cloudformation supports that, we should allow CDK users to specify that as well.

@pahud pahud added p2 effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-rds Related to Amazon Relational Database effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants