add cdk scripts
This commit is contained in:
parent
f586142938
commit
4e06c867ad
17 changed files with 5362 additions and 0 deletions
55
deploy/scripts/cdk/lib/cdk-stack.ts
Normal file
55
deploy/scripts/cdk/lib/cdk-stack.ts
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
import * as cdk from 'aws-cdk-lib';
|
||||
import { Construct } from 'constructs';
|
||||
import * as ecs from 'aws-cdk-lib/aws-ecs'
|
||||
|
||||
import { Network, EcrRepository, FrontEndCluster, BackEndCluster, Rds } from './construct';
|
||||
// import * as sqs from 'aws-cdk-lib/aws-sqs';
|
||||
|
||||
export class LangflowAppStack extends cdk.Stack {
|
||||
constructor(scope: Construct, id: string, props?: cdk.StackProps) {
|
||||
super(scope, id, props);
|
||||
// Arch
|
||||
const arch = ecs.CpuArchitecture.X86_64
|
||||
|
||||
// VPC
|
||||
const { vpc, cluster, alb, targetGroup, cloudmapNamespace, ecsFrontSG, ecsBackSG, dbSG, albSG, backendTaskRole, TaskExecutionRole, frontendTaskRole, backendLogGroup, frontendLogGroup} = new Network(this, 'Network')
|
||||
// ECR
|
||||
const { ecrFrontEndRepository,ecrBackEndRepository} = new EcrRepository(this, 'Ecr', {
|
||||
cloudmapNamespace:cloudmapNamespace,
|
||||
arch:arch
|
||||
})
|
||||
|
||||
// RDS
|
||||
// VPCとSGのリソース情報をPropsとして引き渡す
|
||||
const { rdsCluster } = new Rds(this, 'Rds', { vpc, dbSG })
|
||||
|
||||
const backendService = new BackEndCluster(this, 'backend', {
|
||||
cluster:cluster,
|
||||
ecsBackSG:ecsBackSG,
|
||||
ecrBackEndRepository:ecrBackEndRepository,
|
||||
backendTaskRole:backendTaskRole,
|
||||
backendTaskExecutionRole:TaskExecutionRole,
|
||||
backendLogGroup:backendLogGroup,
|
||||
cloudmapNamespace:cloudmapNamespace,
|
||||
rdsCluster:rdsCluster,
|
||||
alb:alb,
|
||||
arch:arch
|
||||
})
|
||||
|
||||
new FrontEndCluster(this, 'frontend',{
|
||||
cluster:cluster,
|
||||
ecsFrontSG:ecsFrontSG,
|
||||
ecrFrontEndRepository:ecrFrontEndRepository,
|
||||
targetGroup: targetGroup,
|
||||
backendServiceName: backendService.backendServiceName,
|
||||
frontendTaskRole: frontendTaskRole,
|
||||
frontendTaskExecutionRole: TaskExecutionRole,
|
||||
frontendLogGroup: frontendLogGroup,
|
||||
cloudmapNamespace: cloudmapNamespace,
|
||||
arch:arch
|
||||
})
|
||||
|
||||
// S3+CloudFront
|
||||
// new Web(this,'Cloudfront-S3')
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue