-
Notifications
You must be signed in to change notification settings - Fork 4k
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
β NOTICE(ecs): Error: Invalid CPU and memory combinations for FARGATE compatible task definition #31106
Comments
initial investigation this works in 2.150.0 and 2.151.0 in CDK TypeScript. No regression. const cluster = new ecs.Cluster(this, 'Cluster', { vpc });
const task = new ecs.TaskDefinition(this, 'Task', {
cpu: '4096',
memoryMiB: '8192',
compatibility: ecs.Compatibility.FARGATE,
});
task.addContainer('nginx', {
image: ecs.ContainerImage.fromRegistry('nginx:latest')
})
new ecs.FargateService(this, 'Service', {
cluster,
taskDefinition: task,
}) checking Java. |
OK the value is from |
OK confirmed a export class DummyStack extends Stack {
constructor(scope: Construct, id: string, props?: StackProps) {
super(scope, id, props);
const vpc = getDefaultVpc(this);
const cpuParam = new CfnParameter(this, 'cpuParam', {
type: 'String',
default: '4096',
});
const memoryParam = new CfnParameter(this, 'memoryParam', {
type: 'String',
default: '8192',
})
const cluster = new ecs.Cluster(this, 'Cluster', { vpc });
const task = new ecs.TaskDefinition(this, 'Task', {
cpu: cpuParam.valueAsString,
memoryMiB: memoryParam.valueAsString,
compatibility: ecs.Compatibility.FARGATE,
});
task.addContainer('nginx', {
image: ecs.ContainerImage.fromRegistry('nginx:latest')
})
new ecs.FargateService(this, 'Service', {
cluster,
taskDefinition: task,
})
}
} This synthesizes in 2.150.0 but fails in 2.151.0
I guess the bug is from here but we need more investigation from the team. As this is confirmed a regression. I am making it a p0. |
The error is from this PR: #30166. It added the validation but doesn't allow token to pass through. |
Hey @Mahoney, thanks for reporting this to us. We will patch this shortly. If you have not already, you should be able to unblock yourself in the mean time by pinning to a previous working version - 1.150.0. |
Update notice for aws/aws-cdk#31106
Comments on closed issues and PRs are hard for our team to see. |
Please add your +1 π to let us know you have encountered this
Status:
Fixed in versions after 2.151.1
Overview:
A validation was added to check if the memory/cpu combination is FARGATE compatible task definition for ECS in this PR: #30166.
However the validation doesn't allow token to pass through so it will fail the synthesize.
This issue was introduced in CDK version 2.151.0
Complete Error Message:
Workaround:
Pinning CDK version to 2.150 or before. This issue only exists in the latest CDK version 2.151
Solution:
Will revert the change and do a patch release.
Original Issue Content:
Describe the bug
In
1.150.0
we were able to define a Service Catalog product which launched an ECS Service as so:On upgrading to
1.151.0
our tests fail as so:If I replace
cpu.valueAsString
with the literal"4096"
andmemoryMiB.valueAsString
with the literal"8192"
it works, so it looks to me as if some validation is incorrectly failing to notice that these values are from parameters.For clarity, we have successfully been creating provisioned products using this service catalog for a year or more using these CfnParameter s.
Regression Issue
Last Known Working CDK Version
1.150.0
Expected Behavior
Call to Template.fromStack should not throw an exception
Current Behavior
Call to Template.fromStack does throw an exception
Reproduction Steps
See code in description.
Possible Solution
No response
Additional Information/Context
We have successfully been creating provisioned products using this service catalog for a year or more using these CfnParameter s.
CDK CLI Version
1.151.0
Framework Version
No response
Node.js Version
v18.16.0
OS
macOs & Linux
Language
Java
Language Version
17
Other information
No response
The text was updated successfully, but these errors were encountered: