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

    Interface SharedAlbEcsFargateServiceProps

    Props for SharedAlbEcsFargateService construct.

    interface SharedAlbEcsFargateServiceProps {
        alb?: IApplicationLoadBalancer;
        albName?: string;
        appName: string;
        autoScaling?: AutoScalingProps;
        blueGreen?: BlueGreenDeploymentProps;
        circuitBreaker?: DeploymentCircuitBreaker;
        cluster?: ICluster;
        command?: string[];
        containerPort?: number;
        cpu?: FargateCpuValue;
        deployEnvironment: string;
        desiredCount?: number;
        disableAutoScaling?: boolean;
        disableContainerHealthCheck?: boolean;
        dns?: DnsProps;
        ecsFargateService?: IEcsFargateService;
        enableExecuteCommand?: boolean;
        enableInitProcess?: boolean;
        entryPoint?: string[];
        environment?: Record<string, string>;
        executionRole?: IRole;
        healthCheck?: ContainerHealthCheckProps;
        healthCheckGracePeriod?: Duration;
        hostHeaders?: string[];
        image: ContainerImage;
        imageVersion?: string;
        listenerPriority?: number;
        logging?: LogGroup | RetentionDays | LogDriver;
        maxHealthyPercent?: number;
        memoryLimitMiB?: number;
        minHealthyPercent?: number;
        policyStatements?: PolicyStatement[];
        secrets?: Record<string, Secret>;
        securityGroup?: SecurityGroup;
        serviceName?: string;
        subnetSelection?: SubnetSelection;
        targetGroupHealthCheck?: TargetGroupHealthCheckProps;
        targetGroupPort?: number;
        taskDef?: IEcsFargateTask;
        taskRole?: IRole;
        validateProductionImageVersion?: boolean;
        vpc?: IVpc;
        vpcName?: string;
    }

    Hierarchy (View Summary)

    Index

    Properties

    alb?: IApplicationLoadBalancer

    Pre-existing ALB.

    - Imports shared ALB from Platform.alb()
    
    albName?: string

    ALB name for import via SSM.

    'ZarSharedALB'
    
    appName: string

    Application name (e.g., 'ZarCore', 'ZarPayments'). Used for naming resources and tagging.

    autoScaling?: AutoScalingProps

    Auto-scaling configuration.

    - Scaling on 80% CPU/Memory
    

    Blue/Green deployment configuration.

    - Rolling deployment (no Blue/Green)
    
    circuitBreaker?: DeploymentCircuitBreaker

    Circuit breaker configuration.

    { enable: true, rollback: true }
    
    cluster?: ICluster

    Pre-existing ECS cluster.

    - Creates a new cluster for this service
    
    command?: string[]

    Custom command for the container.

    containerPort?: number

    Port the container listens on.

    80
    

    CPU units for the task.

    1024 (1 vCPU)
    
    deployEnvironment: string

    Deployment environment (e.g., 'development', 'staging', 'production').

    desiredCount?: number

    Desired task count.

    disableAutoScaling?: boolean

    Disable auto-scaling.

    false
    
    disableContainerHealthCheck?: boolean

    Disable container health check. Useful when using ALB health checks instead.

    false
    
    dns?: DnsProps

    DNS configuration. Creates Route53 records and uses domains for host header routing.

    - No DNS records created
    
    ecsFargateService?: IEcsFargateService

    Pre-existing ECS Fargate Service (for composition). If provided, service props are ignored.

    - Creates new service
    
    enableExecuteCommand?: boolean

    Enable ECS Exec for debugging.

    true
    
    enableInitProcess?: boolean

    Enable init process (tini) for proper signal handling.

    true
    
    entryPoint?: string[]

    Custom entry point for the container.

    environment?: Record<string, string>

    Environment variables for the container.

    executionRole?: IRole

    Pre-existing execution role.

    - Creates new execution role
    

    Container health check configuration.

    - Health check on /up endpoint
    
    healthCheckGracePeriod?: Duration

    Health check grace period.

    Duration.seconds(60)
    
    hostHeaders?: string[]

    Host headers for listener rule routing. Use this when you want host-based routing without creating DNS records.

    - Derived from dns prop if provided, otherwise no host header condition
    
    image: ContainerImage

    Container image to deploy.

    imageVersion?: string

    Image version/tag for validation. Required when validateProductionImageVersion is true in production. In production, this must be a semantic version (e.g., v1.2.3).

    listenerPriority?: number

    Listener rule priority.

    - Auto-generated based on app name and environment
    
    logging?: LogGroup | RetentionDays | LogDriver

    Logging configuration for the ECS task.

    Can be one of:

    • ecs.LogDriver - Full control over logging configuration
    • logs.LogGroup - We create an AwsLogDriver with this LogGroup
    • logs.RetentionDays - We create an AwsLogDriver and LogGroup with specified retention
    - Creates AwsLogDriver with LogGroup using TWO_WEEKS retention
    
    // Use custom retention
    logging: logs.RetentionDays.ONE_MONTH,

    // Use existing log group
    logging: myLogGroup,

    // Full control with custom LogDriver
    logging: ecs.LogDrivers.awsLogs({
    logGroup: myLogGroup,
    streamPrefix: 'custom',
    }),
    maxHealthyPercent?: number

    Maximum healthy percent during deployment.

    200
    
    memoryLimitMiB?: number

    Memory in MiB for the task.

    2048 (2 GB)
    
    minHealthyPercent?: number

    Minimum healthy percent during deployment.

    50
    
    policyStatements?: PolicyStatement[]

    Additional IAM policy statements for task role.

    secrets?: Record<string, Secret>

    Secrets from Secrets Manager or SSM Parameter Store.

    securityGroup?: SecurityGroup

    Pre-existing security group for ECS tasks.

    - Creates new security group with HTTPS (443) egress
    
    serviceName?: string

    Service name suffix. Used for naming the ECS service.

    'svc'
    
    subnetSelection?: SubnetSelection

    Subnet selection for task placement.

    - Private subnets with egress
    
    targetGroupHealthCheck?: TargetGroupHealthCheckProps

    Target group health check configuration.

    targetGroupPort?: number

    Target group port.

    - Uses containerPort
    
    taskDef?: IEcsFargateTask

    Pre-existing task definition (for composition). If provided, task definition props are ignored.

    - Creates new task definition
    
    taskRole?: IRole

    Pre-existing task role.

    - Creates new task role
    
    validateProductionImageVersion?: boolean

    Validate image version format in production.

    true
    
    vpc?: IVpc

    Pre-existing VPC to use.

    - Imports VPC from Platform.vpc() using vpcName
    
    vpcName?: string

    Name of VPC to import via SSM parameters.

    'ZarVpc'