Skip to content

(aws_ecs_patterns): container-level cpu & memory props for ApplicationLoadBalancedFargateService #20638

@Eryn-mk

Description

@Eryn-mk

Describe the feature

Surface the container-level cpu and container-level memoryLimitMiB property of ContainerDefinitionOptions as part of the ApplicationLoadBalancedFargateService construct.

Currently those two properties are not accessible when creating an ApplicationLoadBalancedFargateService. (see code)

Use Case

I want to deploy a sidecar container to the service container, within the same task definition. Right now the issue I observe is, the service container is set a cpu value that equals to the task cpu value (named cpu in ApplicationLoadBalancedFargateService construct prop), thus I get error because the sum of sidecar container cpu and service container cpu exceeds the task cpu limit.

Proposed Solution

const service = new ApplicationLoadBalancedFargateService(this, 'Service',  {
    cpu: 4096 ,
    memoryLimitMiB: 7168, 
    containerCpu: 2048,
    containerMemoryLimitMiB: 6144,
    ...
}

or maybe passing in an object

const service = new ApplicationLoadBalancedFargateService(this, 'Service',  {
    cpu: 4096 ,
    memoryLimitMiB: 7168, 
    containerDefinitionOptions : {
        containerCpu: 2048,
        containerMemoryLimitMiB: 6144,
        ...
    }
    ...
}

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2

Environment details (OS name and version, etc.)

Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-ecs-patternsRelated to ecs-patterns libraryeffort/smallSmall work item – less than a day of effortfeature-requestA feature should be added or improved.good first issueRelated to contributions. See CONTRIBUTING.mdp2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions