Skip to content

aws_ecs.Ec2TaskDefinition : add_container function isn't working properly #4519

Open
@keeratg

Description

@keeratg

Describe the bug

As shown in the image below when I call the add_container function a Ec2TaskDefinition I get the following error: TypeError: add_container() got an unexpected keyword argument 'memory_limit_mi_b'. I checked the documentation and I am calling it correctly with the right parameters.
Documentation:https://docs.aws.amazon.com/cdk/api/v2/python/aws_cdk.aws_ecs/Ec2TaskDefinition.html

Screenshot 2024-05-19 at 9 17 00 PM

Expected Behavior

I expect it to add a container with the given memory_limit_mi_b value

Current Behavior

Currently, it is giving me an error when I try to deploy.

Error image:
Screenshot 2024-05-19 at 9 25 08 PM

Reproduction Steps

task_definition = ecs.Ec2TaskDefinition(self, "TaskDef")
task_definition.add_container("TheContainer",
    image=ecs.ContainerImage.from_registry("example-image"),
    memory_limit_mi_b=256,
)

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.142.1 (build ed4e152)

Framework Version

No response

Node.js Version

v22.2.0

OS

MacOS

Language

Python

Language Version

Python 3.8.2

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.documentationThis is a problem with documentation.effort/smallSmall work item – less than a day of effortjsiip2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions