Skip to content

Instantly share code, notes, and snippets.

@insanitybit
Created September 15, 2018 17:22
Show Gist options
  • Save insanitybit/4961eba377bae6ac39690e9678c57075 to your computer and use it in GitHub Desktop.
Save insanitybit/4961eba377bae6ac39690e9678c57075 to your computer and use it in GitHub Desktop.
class HistoryDb extends cdk.Stack {
vpc: ec2.VpcNetwork;
db: rds.DatabaseCluster;
constructor(parent: cdk.App, username: cdk.Token, password: cdk.Token) {
super(parent, 'HistoryDb');
this.vpc = new ec2.VpcNetwork(this, 'VPC');
this.db = new rds.DatabaseCluster(this, 'HistoryDb', {
defaultDatabaseName: 'HistoryDb',
masterUser: {
username: username,
password: password,
},
engine: rds.DatabaseClusterEngine.AuroraPostgresql,
instanceProps: {
instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.Burstable2, ec2.InstanceSize.Micro),
vpc: this.vpc,
vpcPlacement: {
subnetsToUse: SubnetType.Public
}
}
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment