Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set ulimit in container definition prop #24918

Closed
peterwoodworth opened this issue Apr 4, 2023 Discussed in #23063 · 3 comments · Fixed by #24963
Closed

Set ulimit in container definition prop #24918

peterwoodworth opened this issue Apr 4, 2023 Discussed in #23063 · 3 comments · Fixed by #24963
Labels
effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. good first issue Related to contributions. See CONTRIBUTING.md p2

Comments

@peterwoodworth
Copy link
Contributor

Discussed in #23063

Ability to set ulimit as prop, instead of just through a method

Originally posted by ambethell November 23, 2022
I need to set the ulimits on a fargate ECS task - (I'm using the Java CDK).

From what I can tell I should be able to set this on the fargate task definition - but I cannot see how to do this using the CDK. Do I need to add an extension to the fargateTaskDefinition?

I see 'ContainerDefinition' has a public method for setting uLimit - however the ContainerDefinitionOptions.builder() does not appear to provide methods to set this.

Both v1 / v2 documentation dont provide this - https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.ContainerDefinitionOptions.html

Any pointers?

Thanks!

@peterwoodworth peterwoodworth added good first issue Related to contributions. See CONTRIBUTING.md p2 feature-request A feature should be added or improved. effort/small Small work item – less than a day of effort labels Apr 4, 2023
@pahud
Copy link
Contributor

pahud commented Apr 4, 2023

I think we probably can just add ulimits in ContainerDefinitionOptions so we can specify ulimits when we addContainer().

const task = ecs.TaskDefinition(...);
task.addContainer('id', options_with_ulimits);

@peterwoodworth
Copy link
Contributor Author

Yes exactly 🙂

mergify bot added a commit to lpizzinidev/aws-cdk that referenced this issue Apr 6, 2023
@mergify mergify bot closed this as completed in #24963 Apr 6, 2023
mergify bot pushed a commit that referenced this issue Apr 6, 2023
This adds the `ulimits` property to `ContainerDefinitionOptions`, allowing to specify the parameter in the `addContainer` method:
```
const task = ecs.TaskDefinition(...);
task.addContainer('id', {
    ...,
    ulimits: [{
        hardLimit: 128,
        name: ecs.UlimitName.RSS,
        softLimit: 128,
     }],
});
```

Closes #24918.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link

github-actions bot commented Apr 6, 2023

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. good first issue Related to contributions. See CONTRIBUTING.md p2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants