Skip to content

Commit

Permalink
feat(rds): pass InstanceParameterGroup to CfnDBInstance
Browse files Browse the repository at this point in the history
  • Loading branch information
aereal committed Mar 22, 2019
1 parent 327dee3 commit a59d9ad
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/@aws-cdk/aws-rds/lib/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,8 @@ export class DatabaseCluster extends DatabaseClusterBase implements IDatabaseClu

const publiclyAccessible = props.instanceProps.vpcSubnets && props.instanceProps.vpcSubnets.subnetType === ec2.SubnetType.Public;

const instanceParameterGroupName = props.instanceProps.parameterGroup && props.instanceProps.parameterGroup.parameterGroupName;

const instance = new CfnDBInstance(this, `Instance${instanceIndex}`, {
// Link to cluster
engine: props.engine,
Expand All @@ -301,6 +303,7 @@ export class DatabaseCluster extends DatabaseClusterBase implements IDatabaseClu
publiclyAccessible,
// This is already set on the Cluster. Unclear to me whether it should be repeated or not. Better yes.
dbSubnetGroupName: subnetGroup.ref,
dbParameterGroupName: instanceParameterGroupName,
});

// We must have a dependency on the NAT gateway provider here to create
Expand Down
8 changes: 8 additions & 0 deletions packages/@aws-cdk/aws-rds/lib/props.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import ec2 = require('@aws-cdk/aws-ec2');
import kms = require('@aws-cdk/aws-kms');
import { IInstanceParameterGroup } from './instance-parameter-group';

/**
* The engine for the database cluster
Expand Down Expand Up @@ -36,6 +37,13 @@ export interface InstanceProps {
* Security group. If not specified a new one will be created.
*/
securityGroup?: ec2.ISecurityGroup;

/**
* Additional parameters to pass to the database instance
*
* @default No parameter group
*/
parameterGroup?: IInstanceParameterGroup;
}

/**
Expand Down

0 comments on commit a59d9ad

Please sign in to comment.