Skip to content
This repository was archived by the owner on Oct 6, 2022. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .projen/deps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .projenrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const project = new awscdk.AwsCdkConstructLibrary({
authorName: 'Pahud Hsieh',
authorEmail: 'hunhsieh@amazon.com',
name: PROJECT_NAME,
cdkVersion: '2.18.0',
cdkVersion: '2.29.1',
description: PROJECT_DESCRIPTION,
repository: 'https://github.com/aws-samples/cdk-serverless-lamp.git',
defaultReleaseBranch: 'main',
Expand Down
2 changes: 2 additions & 0 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ new DatabaseCluster(scope: Construct, id: string, props: DatabaseProps)
* **masterUserName** (<code>string</code>) master username. __*Default*__: admin
* **rdsProxy** (<code>boolean</code>) enable the Amazon RDS proxy. __*Default*__: true
* **rdsProxyOptions** (<code>[aws_rds.DatabaseProxyOptions](#aws-cdk-lib-aws-rds-databaseproxyoptions)</code>) RDS Proxy Options. __*Optional*__
* **vpcSubnets** (<code>[aws_ec2.SubnetSelection](#aws-cdk-lib-aws-ec2-subnetselection)</code>) List of subnets to use when creating subnet group. __*Optional*__



Expand Down Expand Up @@ -160,6 +161,7 @@ Name | Type | Description
**masterUserName**? | <code>string</code> | master username.<br/>__*Default*__: admin
**rdsProxy**? | <code>boolean</code> | enable the Amazon RDS proxy.<br/>__*Default*__: true
**rdsProxyOptions**? | <code>[aws_rds.DatabaseProxyOptions](#aws-cdk-lib-aws-rds-databaseproxyoptions)</code> | RDS Proxy Options.<br/>__*Optional*__
**vpcSubnets**? | <code>[aws_ec2.SubnetSelection](#aws-cdk-lib-aws-ec2-subnetselection)</code> | List of subnets to use when creating subnet group.<br/>__*Optional*__



Expand Down
4 changes: 2 additions & 2 deletions package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,11 @@ export interface DatabaseProps {
*/
readonly instanceCapacity?: number;

/**
* List of subnets to use when creating subnet group.
*/
readonly vpcSubnets?: ec2.SubnetSelection;

}

export class DatabaseCluster extends Construct {
Expand Down Expand Up @@ -241,6 +246,7 @@ export class DatabaseCluster extends Construct {
vpc: props.vpc,
instanceType: props.instanceType ?? new ec2.InstanceType('t3.medium'),
securityGroups: [dbConnectionGroup],
vpcSubnets: props.vpcSubnets,
},
credentials: {
username: masterUserSecret.secretValueFromJson('username').toString(),
Expand Down Expand Up @@ -279,6 +285,7 @@ export class DatabaseCluster extends Construct {
dbProxyName: `${Stack.of(this).stackName}-RDSProxy`,
securityGroups: [dbConnectionGroup],
role: rdsProxyRole,
vpcSubnets: props.vpcSubnets,
};

// create the RDS proxy
Expand Down
14 changes: 7 additions & 7 deletions yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.