aws / aws/jsii

aws_ecs.Ec2TaskDefinition : add_container function isn't working properly

Open
#4,519 1 comment 0 reactions 0 assignees View on GitHub
bug documentation effort/small jsii p2
Dominant language
TypeScript
Stars
2.9k
Forks
267
Avg merge
1d 25m
Merged PRs (30d)
14

Description

### 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_

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the documented Ec2TaskDefinition.add_container call with memory_limit_mi_b in Python and compare the generated method signature with the AWS CDK documentation. Trace the jsii cross-language binding for this entry point, then verify that the call accepts the documented argument and deploys successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, node.js, python, typescript
Domain
cloud, developer-experience, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.