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

    Interface EcsFargateTaskDefinitionProps

    Props for EcsFargateTaskDefinition construct.

    interface EcsFargateTaskDefinitionProps {
        appName: string;
        command?: string[];
        containerPort?: number;
        cpu?: FargateCpuValue;
        deployEnvironment: string;
        disableContainerHealthCheck?: boolean;
        enableInitProcess?: boolean;
        entryPoint?: string[];
        environment?: Record<string, string>;
        executionRole?: IRole;
        healthCheck?: ContainerHealthCheckProps;
        image: ContainerImage;
        imageVersion?: string;
        logging?: LogGroup | RetentionDays | LogDriver;
        memoryLimitMiB?: number;
        policyStatements?: PolicyStatement[];
        secrets?: Record<string, Secret>;
        serviceName?: string;
        taskRole?: IRole;
        validateProductionImageVersion?: boolean;
        vpc?: IVpc;
        vpcName?: string;
    }

    Hierarchy (View Summary)

    Index

    Properties

    appName: string

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

    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').

    disableContainerHealthCheck?: boolean

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

    false
    
    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
    
    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).

    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',
    }),
    memoryLimitMiB?: number

    Memory in MiB for the task.

    2048 (2 GB)
    
    policyStatements?: PolicyStatement[]

    Additional IAM policy statements for task role.

    secrets?: Record<string, Secret>

    Secrets from Secrets Manager or SSM Parameter Store.

    serviceName?: string

    Service name used for naming resources (task definition family, log group).

    'svc'
    
    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'