Skip to content

Commit

Permalink
Fix AWS deployment (#1893)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattbajorek authored May 20, 2024
1 parent 75642cc commit 5fe118a
Show file tree
Hide file tree
Showing 3 changed files with 476 additions and 659 deletions.
60 changes: 37 additions & 23 deletions scripts/aws/lib/construct/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,43 +23,57 @@ export class Rds extends Construct{
})

// DB クラスターのパラメータグループ作成
const clusterParameterGroup = new rds.ParameterGroup(scope, 'ClusterParameterGroup',{
engine: rds.DatabaseClusterEngine.auroraMysql({
version: rds.AuroraMysqlEngineVersion.VER_3_02_0
}),
description: 'for-langflow',
})
const clusterParameterGroup = new rds.ParameterGroup(
scope,
"ClusterParameterGroup",
{
engine: rds.DatabaseClusterEngine.auroraMysql({
version: rds.AuroraMysqlEngineVersion.of(
"8.0.mysql_aurora.3.05.2",
"8.0"
),
}),
description: "for-langflow",
}
);
clusterParameterGroup.bindToCluster({})

// DB インスタンスのパラメタグループ作成
const instanceParameterGroup = new rds.ParameterGroup(scope, 'InstanceParameterGroup',{
engine: rds.DatabaseClusterEngine.auroraMysql({
version: rds.AuroraMysqlEngineVersion.VER_3_02_0,
}),
description: 'for-langflow',
})
const instanceParameterGroup = new rds.ParameterGroup(
scope,
"InstanceParameterGroup",
{
engine: rds.DatabaseClusterEngine.auroraMysql({
version: rds.AuroraMysqlEngineVersion.of("8.0.mysql_aurora.3.05.2", '8.0'),
}),
description: "for-langflow",
}
);
instanceParameterGroup.bindToInstance({})

this.rdsCluster = new rds.DatabaseCluster(scope, 'LangflowDbCluster', {
this.rdsCluster = new rds.DatabaseCluster(scope, "LangflowDbCluster", {
engine: rds.DatabaseClusterEngine.auroraMysql({
version: rds.AuroraMysqlEngineVersion.VER_3_02_0,
version: rds.AuroraMysqlEngineVersion.of(
"8.0.mysql_aurora.3.05.2",
"8.0"
),
}),
storageEncrypted: true,
credentials: rdsCredentials,
instanceIdentifierBase: 'langflow-instance',
vpc:vpc,
vpcSubnets:vpc.selectSubnets({
subnetGroupName: 'langflow-Isolated',
instanceIdentifierBase: "langflow-instance",
vpc: vpc,
vpcSubnets: vpc.selectSubnets({
subnetGroupName: "langflow-Isolated",
}),
securityGroups:[dbSG],
securityGroups: [dbSG],
writer: rds.ClusterInstance.provisioned("WriterInstance", {
instanceType: instanceType,
enablePerformanceInsights: true,
parameterGroup:instanceParameterGroup,
parameterGroup: instanceParameterGroup,
}),
// 2台目以降はreaders:で設定
// 2台目以降はreaders:で設定
parameterGroup: clusterParameterGroup,
defaultDatabaseName: 'langflow',
})
defaultDatabaseName: "langflow",
});
}
}
Loading

0 comments on commit 5fe118a

Please sign in to comment.