-
Notifications
You must be signed in to change notification settings - Fork 4.5k
(aws-rds): vpc should be optional in ServerlessCluster #17401
Copy link
Copy link
Closed
Labels
@aws-cdk/aws-rdsRelated to Amazon Relational DatabaseRelated to Amazon Relational Databaseeffort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortfeature-requestA feature should be added or improved.A feature should be added or improved.feature/coverage-gapGaps in CloudFormation coverage by L2 constructsGaps in CloudFormation coverage by L2 constructsp1
Description
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-rdsRelated to Amazon Relational DatabaseRelated to Amazon Relational Databaseeffort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortfeature-requestA feature should be added or improved.A feature should be added or improved.feature/coverage-gapGaps in CloudFormation coverage by L2 constructsGaps in CloudFormation coverage by L2 constructsp1