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

feat(rds): dual-stack mode support #22596

Merged
merged 5 commits into from
Oct 26, 2022
Merged

feat(rds): dual-stack mode support #22596

merged 5 commits into from
Oct 26, 2022

Conversation

Tietew
Copy link
Contributor

@Tietew Tietew commented Oct 21, 2022

This PR adds dual-stack mode support to RDS instances and clusters.

Aurora

declare const vpc: ec2.Vpc; // VPC and subnets must have IPv6 CIDR blocks
const cluster = new rds.DatabaseCluster(this, 'Database', {
  engine: rds.DatabaseClusterEngine.auroraMysql({ version: rds.AuroraMysqlEngineVersion.VER_3_02_1 }),
  instanceProps: {
    vpc,
    publiclyAccessible: false,
  },
  networkType: rds.NetworkType.DUAL,
});

RDS

declare const vpc: ec2.Vpc; // VPC and subnets must have IPv6 CIDR blocks
const instance = new rds.DatabaseInstance(this, 'Instance', {
  engine: rds.DatabaseInstanceEngine.postgres({ version: rds.PostgresEngineVersion.VER_14_4 }),
  vpc,
  networkType: rds.NetworkType.DUAL,
  publiclyAccessible: false,
});

Note: CDK cannot check whether the specified VPC and subnets have actually IPv6 CIDR blocks because ec2.IVpc and ec2.ISubnet does not have ipv6 attributes. (cf. #19525)


All Submissions:

Adding new Unconventional Dependencies:

  • This PR adds new unconventional dependencies following the process described here

New Features

  • Have you added the new feature to an integration test?
    • Did you use yarn integ to deploy the infrastructure and generate the snapshot (i.e. yarn integ without --dry-run)?

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@gitpod-io
Copy link

gitpod-io bot commented Oct 21, 2022

@github-actions github-actions bot added beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK p2 labels Oct 21, 2022
@aws-cdk-automation aws-cdk-automation requested a review from a team October 21, 2022 04:51
Copy link
Contributor

@TheRealAmazonKendra TheRealAmazonKendra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks pretty good, we just need the extra tests I commented below.

@@ -457,6 +457,25 @@ describe('cluster', () => {
}).toThrow(/You cannot specify both parameterGroup and parameters/);
});

test('instance with dual-stack network type', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need a test case where IPV4 is explicitly set.

@@ -321,6 +321,20 @@ describe('instance', () => {
});
});

test('instance with dualstack network type', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need a test case where IPV4 is explicitly set.

cfnSubnet.addDependsOn(ipv6);
});

new rds.DatabaseCluster(stack, 'Cluster', {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need a test case where IPV4 is explicitly set.

cfnSubnet.addDependsOn(ipv6);
});

new rds.DatabaseInstance(stack, 'Instance', {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need a test case where IPV4 is explicitly set.

@mergify mergify bot dismissed TheRealAmazonKendra’s stale review October 26, 2022 05:06

Pull request has been modified.

@Tietew
Copy link
Contributor Author

Tietew commented Oct 26, 2022

@TheRealAmazonKendra Thank you for review I've added tests for IPV4 explicitly.

@mergify
Copy link
Contributor

mergify bot commented Oct 26, 2022

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 588e74d
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit 89a7365 into aws:main Oct 26, 2022
@mergify
Copy link
Contributor

mergify bot commented Oct 26, 2022

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@Tietew Tietew deleted the rds-dualstack branch October 27, 2022 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants