Skip to content

Commit

Permalink
Add security group for RDS and allow ingress from bastion
Browse files Browse the repository at this point in the history
  • Loading branch information
shogo82148 committed Mar 11, 2024
1 parent 49b990c commit 8f08c67
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions _integration/lib/integration-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,17 @@ export class IntegrationStack extends cdk.Stack {
});

// Relational Database Service
const rdsSG = new ec2.SecurityGroup(this, "RDSSG", {
vpc,
});
rdsSG.addIngressRule(bastionSG, ec2.Port.tcp(3306));
const cluster = new rds.DatabaseCluster(this, "Database", {
engine: rds.DatabaseClusterEngine.auroraMysql({
version: rds.AuroraMysqlEngineVersion.VER_3_05_2,
}),
writer: rds.ClusterInstance.serverlessV2("writer"),
vpc,
securityGroups: [rdsSG],
});
}
}

0 comments on commit 8f08c67

Please sign in to comment.