-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
ecs: task definition validation container bug #25275
Comments
Thanks for reporting, We should only need to add another condition to the if statement to check if the memory of the task definition hasn't been set: aws-cdk/packages/aws-cdk-lib/aws-ecs/lib/base/task-definition.ts Lines 733 to 745 in 78c411b
|
Could I try to solve this. This would be my first open source contribution |
It would be very welcomed @jackhannan-hello, be sure to check out our Contributing Guide, and feel free to ping me or @pahud if you have any questions |
Every time I try to clone my fork in VS Code it does not seem to work. and everything is deleted. @peterwoodworth |
Yeah, unfortunately we're aware of this issue on windows following the repo restructure #25164 Try using the gitpod solution? |
I think I may have fixed the issue but I am confused on how to test it. I understand I have to make a sample.ts file. I included what petderek said to reproduce but I do not know what to import to be able to test. What should I import @peterwoodworth @pahud ? |
I haven't followed the steps exactly as described in the contributing guide since that's a new section, and we've also recently restructured the repository. But, all you should need to do is import whichever modules are necessary to test this use case. |
We'll want a new integ test for this use case anyway, try looking at the existing integ tests and copy a simple one to build on top of that to test this use case? |
I would not recommend to develop aws-cdk on Windows if this is your first time contributing to CDK. Instead, I will recommend gitpod as it prebuild everything for you and you can just open and start your hack. Feel free to follow the verify your fix by deployment guide. In your case you would want to write a sample.ts in In your import {
App, Stack,
aws_ecs as ecs,
aws_ec2 as ec2,
} from 'aws-cdk-lib';
const app = new App();
const env = { region: process.env.CDK_DEFAULT_REGION, account: process.env.CDK_DEFAULT_ACCOUNT };
const stack = new Stack(app, 'my-test-stack', { env });
const cluster = new ecs.Cluster(stack, 'Cluster', {
vpc,
}); Feel free to reach out to me directly on cdk.dev slack and we welcome discussion around contributing experience in the slack #contributing channel as well. |
Previous PR was automatically closed and has not been active for a month. So I newly submitted PR. |
Sounds good 👍🏻 |
… is defined but container-level memory and memoryReservation are not defined with EC2 compatibility (#26027) Currently, validation for ECS task definition fails when task-level memory is defined but container-level memory and memoryReservation are not defined with EC2 compatibility. On the other hand, if we specify task-level memory, we can omit container-level memory and memoryReservation parameters from ECS API perspective. This PR solves the issue by skipping the validation when task-level memory is defined. Closes #25275 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
… is defined but container-level memory and memoryReservation are not defined with EC2 compatibility (aws#26027) Currently, validation for ECS task definition fails when task-level memory is defined but container-level memory and memoryReservation are not defined with EC2 compatibility. On the other hand, if we specify task-level memory, we can omit container-level memory and memoryReservation parameters from ECS API perspective. This PR solves the issue by skipping the validation when task-level memory is defined. Closes aws#25275 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
… is defined but container-level memory and memoryReservation are not defined with EC2 compatibility (aws#26027) Currently, validation for ECS task definition fails when task-level memory is defined but container-level memory and memoryReservation are not defined with EC2 compatibility. On the other hand, if we specify task-level memory, we can omit container-level memory and memoryReservation parameters from ECS API perspective. This PR solves the issue by skipping the validation when task-level memory is defined. Closes aws#25275 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Describe the bug
When I add a container definition to a fargate task definition, I am prompted to include
memory
ormemoryReservation
as a required field. This is not a container-level requirement if memory is already specified in the task.Expected Behavior
I expect the CDK to let me create a container without specifying
memory
.Current Behavior
Reproduction Steps
Something like this should repro:
Possible Solution
One solution would be to check if there is
memory
set at in the parent before validating the existence ofmemory
in the container.Additional Information/Context
The correct behavior is mentioned in the
register-task-definition
documentation.CDK CLI Version
2.76.0 (build 78c411b)
Framework Version
No response
Node.js Version
v18.16.0
OS
mac
Language
Typescript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: