onEcsPostConstructor()

in infra/ecs-service/ecs-alb-service-stack.ts [38:102]


    onEcsPostConstructor(vpc: ec2.IVpc, cluster: ecs.ICluster, ns: sd.IPrivateDnsNamespace) {
        const repo = new EcsRepoConstrunct(this, 'EcsAlbRepoConstrunct', {
            stackName: this.stackName,
            projectPrefix: this.projectPrefix,
            env: this.commonProps.env!,
            stackConfig: this.stackConfig,
            variables: this.commonProps.variables,

            shortStackName: this.stackConfig.ShortStackName
        });
        
        const infra = new EcsInfraConstrunct(this, 'EcsAlbInfraConstrunct', {
            stackName: this.stackName,
            projectPrefix: this.projectPrefix,
            env: this.commonProps.env!,
            stackConfig: this.stackConfig,
            variables: this.commonProps.variables,

            infraVersion: this.stackConfig.InfraVersion,
            dockerImageType: this.stackConfig.DockerImageType,
            vpc: vpc,
            cluster: cluster,
            ecrRepo: repo.ecrRepo,
            internetFacing: this.stackConfig.InternetFacing,
            containerPort: this.stackConfig.PortNumber,
            dockerPath: this.stackConfig.AppPath,
            cpu: this.stackConfig.Cpu,
            memory: this.stackConfig.Memory,
            desiredTasks: this.stackConfig.DesiredTasks,
            autoscaling: this.stackConfig.AutoScalingEnable,
            minTasks: this.stackConfig.AutoScalingMinCapacity,
            maxTasks: this.stackConfig.AutoScalingMaxCapacity,
            tableName: this.stackConfig.TableName,
        });

        new EcsCicdConstrunct(this, 'EcsAlbCicdConstrunct', {
            stackName: this.stackName,
            projectPrefix: this.projectPrefix,
            env: this.commonProps.env!,
            stackConfig: this.stackConfig,
            variables: this.commonProps.variables,

            vpc: vpc,
            cluster: cluster,
            service: infra.service,
            containerName: infra.containerName,
            appPath: this.stackConfig.AppPath,
            repo: repo.gitRepo,
            ecrRepo: repo.ecrRepo
        });

        new EcsAlbMonitorConstrunct(this, 'EcsAlbMonitorConstrunct', {
            stackName: this.stackName,
            projectPrefix: this.projectPrefix,
            env: this.commonProps.env!,
            stackConfig: this.stackConfig,
            variables: this.commonProps.variables,
            
            alb: infra.alb,
            ecsSrevice: infra.service,
            alarmThreshold: this.stackConfig.AlarmThreshold,
            subscriptionEmails: this.stackConfig.SubscriptionEmails,
            table: infra.table,
        });
    }