@zarpay/zar-cdk-lib - v0.32.0
    Preparing search index...

    Class SharedAlbEcsFargateService

    Golden Path Application Load Balanced ECS Fargate Service.

    Wraps EcsFargateService and adds:

    • Shared ALB integration via Platform class
    • Target group with health checks
    • Route53 DNS records
    • Optional Blue/Green with dual target groups
    • Weighted traffic routing support
    // Basic usage with shared ALB
    const webService = new SharedAlbEcsFargateService(this, 'WebService', {
    appName: 'ZarCore',
    deployEnvironment: 'staging',
    image: ecs.ContainerImage.fromEcrRepository(repo, 'v1.0.0'),
    imageVersion: 'v1.0.0',
    dns: {
    recordName: 'core', // creates core.staging.zarhq.dev
    },
    });

    // Blue/Green deployment with dual target groups
    const webService = new SharedAlbEcsFargateService(this, 'WebService', {
    appName: 'ZarCore',
    deployEnvironment: 'staging',
    image: ecs.ContainerImage.fromEcrRepository(repo, 'v1.0.0'),
    imageVersion: 'v1.0.0',
    blueGreen: { enabled: true }, // Creates dual target groups for weighted routing
    });

    Hierarchy

    • Construct
      • SharedAlbEcsFargateService

    Implements

    Index

    Constructors

    Properties

    alb: IApplicationLoadBalancer

    The Application Load Balancer

    blueTargetGroup: ApplicationTargetGroup

    The Blue target group (receives traffic initially)

    cluster: ICluster

    The ECS cluster

    container: ContainerDefinition

    The main container definition

    greenTargetGroup?: ApplicationTargetGroup

    The Green target group - only when blueGreen.enabled is true

    listener: IApplicationListener

    The ALB listener

    scalableTarget?: ScalableTaskCount

    The auto-scaling target (if auto-scaling is enabled)

    securityGroup: SecurityGroup

    The security group for ECS tasks

    service: FargateService

    The Fargate service

    taskDefinition: FargateTaskDefinition

    The Fargate task definition

    vpc: IVpc

    The VPC where resources are deployed