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

(aws-rds): vpc should be optional in ServerlessCluster #17401

Closed
1 of 2 tasks
CorentinDoue opened this issue Nov 8, 2021 · 2 comments · Fixed by #17413
Closed
1 of 2 tasks

(aws-rds): vpc should be optional in ServerlessCluster #17401

CorentinDoue opened this issue Nov 8, 2021 · 2 comments · Fixed by #17413
Labels
@aws-cdk/aws-rds Related to Amazon Relational Database effort/small Small work item – less than a day of effort feature/coverage-gap Gaps in CloudFormation coverage by L2 constructs feature-request A feature should be added or improved. p1

Comments

@CorentinDoue
Copy link
Contributor

CorentinDoue commented Nov 8, 2021

Description

A VPC is not mandatory to create a AWS Aurora serverless cluster. In CfnDBCluster,DBSubnetGroupName and VpcSecurityGroupIds are optional.

But a VPC is required to create a ServerlessCluster

The VPC attribute should be optional.

Use Case

When the DataAPI is enabled, it's possible to have a project without any direct access to the Cluster. The cluster don't need to be in a VPC (or if it's in VPC we don't need to know it). It's especially useful for serverless projects which tend to get rid of VPCs.

I wish I could simply write

const cluster = new rds.ServerlessCluster(this, 'AnotherCluster', {
  engine: rds.DatabaseClusterEngine.AURORA_MYSQL,
  enableDataApi: true,
});

declare const code: lambda.Code;
const fn = new lambda.Function(this, 'MyFunction', {
  runtime: lambda.Runtime.NODEJS_14_X,
  handler: 'index.handler',
  code,
  environment: {
    CLUSTER_ARN: cluster.clusterArn,
    SECRET_ARN: cluster.secret!.secretArn,
  },
});
cluster.grantDataApiAccess(fn);

Proposed Solution

Make the vpc parameter optional. When it's undefined, don't create any subnet or security group and don't set DBSubnetGroupName and VpcSecurityGroupIds

Other information

No response

Acknowledge

  • I may be able to implement this feature request
  • This feature might incur a breaking change
@CorentinDoue CorentinDoue added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Nov 8, 2021
@github-actions github-actions bot added the @aws-cdk/aws-rds Related to Amazon Relational Database label Nov 8, 2021
@skinny85
Copy link
Contributor

skinny85 commented Nov 8, 2021

Thanks for opening the issue @CorentinDoue! We encourage community contributions, so if you'd like to open us a Pull Request adding this feature, that would be fantastic - it should be a relatively straightforward change. Our "Contributing" guide: https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md.

Thanks,
Adam

@skinny85 skinny85 added effort/small Small work item – less than a day of effort feature/coverage-gap Gaps in CloudFormation coverage by L2 constructs p1 and removed needs-triage This issue or PR still needs to be triaged. labels Nov 8, 2021
@skinny85 skinny85 removed their assignment Nov 8, 2021
@mergify mergify bot closed this as completed in #17413 Feb 22, 2022
mergify bot pushed a commit that referenced this issue Feb 22, 2022
Fixes #17401

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

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/small Small work item – less than a day of effort feature/coverage-gap Gaps in CloudFormation coverage by L2 constructs feature-request A feature should be added or improved. p1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants