Fix bug in deployment procedure in AWS CDK and support HTTPS (#1491)
* add cloudfront * modify: healthcheck disable * modify: health check option * modify nodejsbuild * add nodejs version * endpoint configuration * set axios url * remote console.log VITE_PROXY_TARGET * create alb stack * add alb to origin * alb build success * remote baseURL setting * add redirect * change responseHttpStatus to 200 * modify output and readme * modify architecture * add health check path route to cloudfront routing * modified: c9 env name in deploy langflow section * modified : package dependency for pymysql * modified: deploy procedure * modified: deploy procedure (ja) --------- Co-authored-by: nsxshota <nsxshota@amazon.co.jp> Co-authored-by: ymkazuki <ymkazuki@amazon.co.jp> Co-authored-by: Shota Nakamoto <53632932+nsy0328@users.noreply.github.com>
This commit is contained in:
parent
7363df6293
commit
3eeda84d28
18 changed files with 678 additions and 271 deletions
|
|
@ -21,18 +21,17 @@ interface BackEndProps {
|
|||
backendTaskRole: iam.Role;
|
||||
backendTaskExecutionRole: iam.Role;
|
||||
backendLogGroup: logs.LogGroup;
|
||||
cloudmapNamespace: servicediscovery.PrivateDnsNamespace;
|
||||
rdsCluster:rds.DatabaseCluster
|
||||
alb:elb.IApplicationLoadBalancer
|
||||
arch:ecs.CpuArchitecture
|
||||
albTG: elb.ApplicationTargetGroup;
|
||||
}
|
||||
|
||||
export class BackEndCluster extends Construct {
|
||||
readonly backendServiceName: string
|
||||
|
||||
constructor(scope: Construct, id: string, props:BackEndProps) {
|
||||
super(scope, id)
|
||||
const containerPort = 7860
|
||||
const backendServiceName = 'backend'
|
||||
const backendServicePort = 7860
|
||||
// Secrets ManagerからDB認証情報を取ってくる
|
||||
const secretsDB = props.rdsCluster.secret!;
|
||||
|
||||
|
|
@ -59,20 +58,13 @@ export class BackEndCluster extends Construct {
|
|||
logGroup: props.backendLogGroup,
|
||||
}),
|
||||
environment:{
|
||||
// user:pass@endpoint:port/dbname
|
||||
// "LANGFLOW_DATABASE_URL" : `mysql+pymysql://${username}:${password}@${host}:3306/${dbname}`,
|
||||
// "LANGFLOW_DATABASE_URL" : "sqlite:///./langflow.db",
|
||||
// "LANGFLOW_LANGCHAIN_CACHE" : "SQLiteCache",
|
||||
// "LANGFLOW_AUTO_LOGIN" : "false",
|
||||
// "LANGFLOW_SUPERUSER" : "admin",
|
||||
// "LANGFLOW_SUPERUSER_PASSWORD" : "1234567"
|
||||
"LANGFLOW_AUTO_LOGIN" : process.env.LANGFLOW_AUTO_LOGIN ?? 'false',
|
||||
"LANGFLOW_SUPERUSER" : process.env.LANGFLOW_SUPERUSER ?? "admin",
|
||||
"LANGFLOW_SUPERUSER_PASSWORD" : process.env.LANGFLOW_SUPERUSER_PASSWORD ?? "123456"
|
||||
},
|
||||
portMappings: [
|
||||
{
|
||||
containerPort: containerPort,
|
||||
containerPort: backendServicePort,
|
||||
protocol: ecs.Protocol.TCP,
|
||||
},
|
||||
],
|
||||
|
|
@ -84,22 +76,15 @@ export class BackEndCluster extends Construct {
|
|||
"password": ecs.Secret.fromSecretsManager(secretsDB, 'password'),
|
||||
},
|
||||
});
|
||||
this.backendServiceName = 'backend'
|
||||
|
||||
const backendService = new ecs.FargateService(this, 'BackEndService', {
|
||||
cluster: props.cluster,
|
||||
serviceName: this.backendServiceName,
|
||||
serviceName: backendServiceName,
|
||||
taskDefinition: backendTaskDefinition,
|
||||
enableExecuteCommand: true,
|
||||
securityGroups: [props.ecsBackSG],
|
||||
cloudMapOptions: {
|
||||
cloudMapNamespace: props.cloudmapNamespace,
|
||||
containerPort: containerPort,
|
||||
dnsRecordType: servicediscovery.DnsRecordType.A,
|
||||
dnsTtl: Duration.seconds(10),
|
||||
name: this.backendServiceName
|
||||
},
|
||||
vpcSubnets: { subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS },
|
||||
});
|
||||
|
||||
props.albTG.addTarget(backendService);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue