From b481225d79b6098ad2e4e649daf5fcd4bc6c9185 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Mon, 18 Jul 2022 13:43:19 +0200 Subject: [PATCH 1/7] fix(aws-ecs-patterns): Set memoryLimitMiB also on container --- .../lib/fargate/application-load-balanced-fargate-service.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/application-load-balanced-fargate-service.ts b/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/application-load-balanced-fargate-service.ts index 9648781f1d93e..6a2928755d9de 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/application-load-balanced-fargate-service.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/application-load-balanced-fargate-service.ts @@ -148,6 +148,7 @@ export class ApplicationLoadBalancedFargateService extends ApplicationLoadBalanc environment: taskImageOptions.environment, secrets: taskImageOptions.secrets, dockerLabels: taskImageOptions.dockerLabels, + memoryLimitMiB: props.memoryLimitMiB }); container.addPortMappings({ containerPort: taskImageOptions.containerPort || 80, From f09c937f0606074cb96da85eec1046a0e517742a Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Tue, 19 Jul 2022 12:00:27 +0200 Subject: [PATCH 2/7] Add cpu and memory limit fix to all fargate patterns, add test based on ecs patterns --- .../application-load-balanced-fargate-service.ts | 5 +++-- ...cation-multiple-target-groups-fargate-service.ts | 6 ++++-- .../network-load-balanced-fargate-service.ts | 4 +++- ...etwork-multiple-target-groups-fargate-service.ts | 4 +++- .../lib/fargate/queue-processing-fargate-service.ts | 9 +++++++-- .../lib/fargate/scheduled-fargate-task.ts | 9 +++++++-- .../@aws-cdk/aws-ecs-patterns/test/ec2/l3s.test.ts | 13 +++++++++---- 7 files changed, 36 insertions(+), 14 deletions(-) diff --git a/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/application-load-balanced-fargate-service.ts b/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/application-load-balanced-fargate-service.ts index 6a2928755d9de..0e7798e604dcd 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/application-load-balanced-fargate-service.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/application-load-balanced-fargate-service.ts @@ -144,11 +144,12 @@ export class ApplicationLoadBalancedFargateService extends ApplicationLoadBalanc const containerName = taskImageOptions.containerName ?? 'web'; const container = this.taskDefinition.addContainer(containerName, { image: taskImageOptions.image, - logging: logDriver, + cpu: props.cpu, + memoryLimitMiB: props.memoryLimitMiB, environment: taskImageOptions.environment, secrets: taskImageOptions.secrets, + logging: logDriver, dockerLabels: taskImageOptions.dockerLabels, - memoryLimitMiB: props.memoryLimitMiB }); container.addPortMappings({ containerPort: taskImageOptions.containerPort || 80, diff --git a/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/application-multiple-target-groups-fargate-service.ts b/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/application-multiple-target-groups-fargate-service.ts index 9299cfc2e3023..9aefe74df4688 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/application-multiple-target-groups-fargate-service.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/application-multiple-target-groups-fargate-service.ts @@ -134,10 +134,12 @@ export class ApplicationMultipleTargetGroupsFargateService extends ApplicationMu const containerName = taskImageOptions.containerName ?? 'web'; const container = this.taskDefinition.addContainer(containerName, { image: taskImageOptions.image, - logging: this.logDriver, + cpu: props.cpu, + memoryLimitMiB: props.memoryLimitMiB, environment: taskImageOptions.environment, secrets: taskImageOptions.secrets, - dockerLabels: taskImageOptions.dockerLabels, + logging: this.logDriver, + dockerLabels: taskImageOptions.dockerLabels }); if (taskImageOptions.containerPorts) { for (const containerPort of taskImageOptions.containerPorts) { diff --git a/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/network-load-balanced-fargate-service.ts b/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/network-load-balanced-fargate-service.ts index e24af6774b42b..bb85c5af15013 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/network-load-balanced-fargate-service.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/network-load-balanced-fargate-service.ts @@ -131,9 +131,11 @@ export class NetworkLoadBalancedFargateService extends NetworkLoadBalancedServic const containerName = taskImageOptions.containerName ?? 'web'; const container = this.taskDefinition.addContainer(containerName, { image: taskImageOptions.image, - logging: logDriver, + cpu: props.cpu, + memoryLimitMiB: props.memoryLimitMiB, environment: taskImageOptions.environment, secrets: taskImageOptions.secrets, + logging: logDriver, dockerLabels: taskImageOptions.dockerLabels, }); container.addPortMappings({ diff --git a/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/network-multiple-target-groups-fargate-service.ts b/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/network-multiple-target-groups-fargate-service.ts index 4e610dac65154..eca9e6b037d37 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/network-multiple-target-groups-fargate-service.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/network-multiple-target-groups-fargate-service.ts @@ -134,9 +134,11 @@ export class NetworkMultipleTargetGroupsFargateService extends NetworkMultipleTa const containerName = taskImageOptions.containerName ?? 'web'; const container = this.taskDefinition.addContainer(containerName, { image: taskImageOptions.image, - logging: this.logDriver, + cpu: props.cpu, + memoryLimitMiB: props.memoryLimitMiB, environment: taskImageOptions.environment, secrets: taskImageOptions.secrets, + logging: this.logDriver, dockerLabels: taskImageOptions.dockerLabels, }); if (taskImageOptions.containerPorts) { diff --git a/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/queue-processing-fargate-service.ts b/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/queue-processing-fargate-service.ts index 89b666fd39405..6df84e6dd8b4f 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/queue-processing-fargate-service.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/queue-processing-fargate-service.ts @@ -120,10 +120,13 @@ export class QueueProcessingFargateService extends QueueProcessingServiceBase { constructor(scope: Construct, id: string, props: QueueProcessingFargateServiceProps) { super(scope, id, props); + const cpu = props.cpu || 256; + const memoryLimitMiB = props.memoryLimitMiB || 512 + // Create a Task Definition for the container to start this.taskDefinition = new FargateTaskDefinition(this, 'QueueProcessingTaskDef', { - memoryLimitMiB: props.memoryLimitMiB || 512, - cpu: props.cpu || 256, + cpu, + memoryLimitMiB, family: props.family, }); @@ -131,6 +134,8 @@ export class QueueProcessingFargateService extends QueueProcessingServiceBase { this.taskDefinition.addContainer(containerName, { image: props.image, + cpu, + memoryLimitMiB, command: props.command, environment: this.environment, secrets: this.secrets, diff --git a/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/scheduled-fargate-task.ts b/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/scheduled-fargate-task.ts index 7a5a018920e7a..2f7333b2eeb78 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/scheduled-fargate-task.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/scheduled-fargate-task.ts @@ -111,12 +111,17 @@ export class ScheduledFargateTask extends ScheduledTaskBase { this.taskDefinition = props.scheduledFargateTaskDefinitionOptions.taskDefinition; } else if (props.scheduledFargateTaskImageOptions) { const taskImageOptions = props.scheduledFargateTaskImageOptions; + const cpu = taskImageOptions.cpu || 256; + const memoryLimitMiB = taskImageOptions.memoryLimitMiB || 512 + this.taskDefinition = new FargateTaskDefinition(this, 'ScheduledTaskDef', { - memoryLimitMiB: taskImageOptions.memoryLimitMiB || 512, - cpu: taskImageOptions.cpu || 256, + memoryLimitMiB, + cpu, }); this.taskDefinition.addContainer('ScheduledContainer', { image: taskImageOptions.image, + memoryLimitMiB, + cpu, command: taskImageOptions.command, environment: taskImageOptions.environment, secrets: taskImageOptions.secrets, diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/ec2/l3s.test.ts b/packages/@aws-cdk/aws-ecs-patterns/test/ec2/l3s.test.ts index cd243dfcc3852..6608a0031b091 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/ec2/l3s.test.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/test/ec2/l3s.test.ts @@ -397,6 +397,11 @@ test('test Fargate loadbalanced construct', () => { Template.fromStack(stack).hasResourceProperties('AWS::ECS::TaskDefinition', { ContainerDefinitions: [ Match.objectLike({ + Cpu: 1024, + DockerLabels: { + label1: 'labelValue1', + label2: 'labelValue2', + }, Environment: [ { Name: 'TEST_ENVIRONMENT_VARIABLE1', @@ -407,6 +412,7 @@ test('test Fargate loadbalanced construct', () => { Value: 'test environment variable 2 value', }, ], + Image: "test", LogConfiguration: { LogDriver: 'awslogs', Options: { @@ -415,12 +421,11 @@ test('test Fargate loadbalanced construct', () => { 'awslogs-region': { Ref: 'AWS::Region' }, }, }, - DockerLabels: { - label1: 'labelValue1', - label2: 'labelValue2', - }, + Memory: 2048, }), ], + Cpu: 1024, + Memory: 2048, }); Template.fromStack(stack).hasResourceProperties('AWS::ECS::Service', { From f43eff601674553152188e0da4f03efb01ff94ab Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Wed, 20 Jul 2022 16:18:49 +0200 Subject: [PATCH 3/7] Fix lint errors --- .../application-multiple-target-groups-fargate-service.ts | 2 +- .../lib/fargate/queue-processing-fargate-service.ts | 2 +- .../aws-ecs-patterns/lib/fargate/scheduled-fargate-task.ts | 2 +- packages/@aws-cdk/aws-ecs-patterns/test/ec2/l3s.test.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/application-multiple-target-groups-fargate-service.ts b/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/application-multiple-target-groups-fargate-service.ts index 9aefe74df4688..b527daabf0e0e 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/application-multiple-target-groups-fargate-service.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/application-multiple-target-groups-fargate-service.ts @@ -139,7 +139,7 @@ export class ApplicationMultipleTargetGroupsFargateService extends ApplicationMu environment: taskImageOptions.environment, secrets: taskImageOptions.secrets, logging: this.logDriver, - dockerLabels: taskImageOptions.dockerLabels + dockerLabels: taskImageOptions.dockerLabels, }); if (taskImageOptions.containerPorts) { for (const containerPort of taskImageOptions.containerPorts) { diff --git a/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/queue-processing-fargate-service.ts b/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/queue-processing-fargate-service.ts index 6df84e6dd8b4f..04369a76216b8 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/queue-processing-fargate-service.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/queue-processing-fargate-service.ts @@ -121,7 +121,7 @@ export class QueueProcessingFargateService extends QueueProcessingServiceBase { super(scope, id, props); const cpu = props.cpu || 256; - const memoryLimitMiB = props.memoryLimitMiB || 512 + const memoryLimitMiB = props.memoryLimitMiB || 512; // Create a Task Definition for the container to start this.taskDefinition = new FargateTaskDefinition(this, 'QueueProcessingTaskDef', { diff --git a/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/scheduled-fargate-task.ts b/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/scheduled-fargate-task.ts index 2f7333b2eeb78..6eeb58e91636f 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/scheduled-fargate-task.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/lib/fargate/scheduled-fargate-task.ts @@ -112,7 +112,7 @@ export class ScheduledFargateTask extends ScheduledTaskBase { } else if (props.scheduledFargateTaskImageOptions) { const taskImageOptions = props.scheduledFargateTaskImageOptions; const cpu = taskImageOptions.cpu || 256; - const memoryLimitMiB = taskImageOptions.memoryLimitMiB || 512 + const memoryLimitMiB = taskImageOptions.memoryLimitMiB || 512; this.taskDefinition = new FargateTaskDefinition(this, 'ScheduledTaskDef', { memoryLimitMiB, diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/ec2/l3s.test.ts b/packages/@aws-cdk/aws-ecs-patterns/test/ec2/l3s.test.ts index 9f68ac8da9a63..e24126452265f 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/ec2/l3s.test.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/test/ec2/l3s.test.ts @@ -530,7 +530,7 @@ test('test Fargate loadbalanced construct', () => { Value: 'test environment variable 2 value', }, ], - Image: "test", + Image: 'test', LogConfiguration: { LogDriver: 'awslogs', Options: { From 0c68a476cb8bf98fed8ea09b166422edfb57867c Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Wed, 20 Jul 2022 17:11:59 +0200 Subject: [PATCH 4/7] Fix tests :fingerscrossed: --- packages/@aws-cdk/aws-ecs-patterns/test/ec2/l3s.test.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/ec2/l3s.test.ts b/packages/@aws-cdk/aws-ecs-patterns/test/ec2/l3s.test.ts index e24126452265f..08b03231b38c9 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/ec2/l3s.test.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/test/ec2/l3s.test.ts @@ -499,6 +499,8 @@ test('test Fargate loadbalanced construct', () => { // WHEN new ecsPatterns.ApplicationLoadBalancedFargateService(stack, 'Service', { cluster, + cpu: 1024, + memoryLimitMiB: 2048, taskImageOptions: { image: ecs.ContainerImage.fromRegistry('test'), environment: { From da2d2448cf3ce84c6e8f0deb38724c2427851fae Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Thu, 21 Jul 2022 09:39:16 +0200 Subject: [PATCH 5/7] Fix Cpu and Memory types in expected template output --- packages/@aws-cdk/aws-ecs-patterns/test/ec2/l3s.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/ec2/l3s.test.ts b/packages/@aws-cdk/aws-ecs-patterns/test/ec2/l3s.test.ts index 08b03231b38c9..48f15ba409a1a 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/ec2/l3s.test.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/test/ec2/l3s.test.ts @@ -544,8 +544,8 @@ test('test Fargate loadbalanced construct', () => { Memory: 2048, }), ], - Cpu: 1024, - Memory: 2048, + Cpu: '1024', + Memory: '2048', }); Template.fromStack(stack).hasResourceProperties('AWS::ECS::Service', { From c3cdc92d11767d047c14f3ac03880ad495eef68e Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Fri, 22 Jul 2022 22:12:32 +0200 Subject: [PATCH 6/7] Fix integration tests --- .../aws-ecs-integ-alb-fg-https.template.json | 1 + .../aws-ecs-integ.template.json | 1 + .../aws-ecs-patterns-queue.template.json | 2 ++ .../executionrole.integ.snapshot/aws-ecs-integ.template.json | 2 ++ .../aws-ecs-integ-l3-autocreate.template.json | 4 ++++ .../aws-ecs-integ-lb-fargate.template.json | 4 ++++ .../aws-ecs-integ-l3-vpconly.template.json | 4 ++++ .../l3.integ.snapshot/aws-ecs-integ-lb-fargate.template.json | 4 ++++ .../aws-ecs-integ.template.json | 1 + .../aws-ecs-patterns-queue-isolated.template.json | 2 ++ .../aws-ecs-patterns-queue-public.template.json | 2 ++ .../aws-ecs-patterns-queue.template.json | 2 ++ .../aws-fargate-integ.template.json | 2 ++ 13 files changed, 31 insertions(+) diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/alb-fargate-service-https.integ.snapshot/aws-ecs-integ-alb-fg-https.template.json b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/alb-fargate-service-https.integ.snapshot/aws-ecs-integ-alb-fg-https.template.json index b43512a5773e7..59f9681d49745 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/alb-fargate-service-https.integ.snapshot/aws-ecs-integ-alb-fg-https.template.json +++ b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/alb-fargate-service-https.integ.snapshot/aws-ecs-integ-alb-fg-https.template.json @@ -636,6 +636,7 @@ } } }, + "Memory": 512, "Name": "web", "PortMappings": [ { diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/circuit-breaker-load-balanced-fargate-service.integ.snapshot/aws-ecs-integ.template.json b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/circuit-breaker-load-balanced-fargate-service.integ.snapshot/aws-ecs-integ.template.json index 972b0642021bd..800bc588a7f46 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/circuit-breaker-load-balanced-fargate-service.integ.snapshot/aws-ecs-integ.template.json +++ b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/circuit-breaker-load-balanced-fargate-service.integ.snapshot/aws-ecs-integ.template.json @@ -529,6 +529,7 @@ } } }, + "Memory": 512, "Name": "web", "PortMappings": [ { diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/circuit-breaker-queue-processing-fargate-service.integ.snapshot/aws-ecs-patterns-queue.template.json b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/circuit-breaker-queue-processing-fargate-service.integ.snapshot/aws-ecs-patterns-queue.template.json index 64ce41f985ed3..f2afafcbc61e4 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/circuit-breaker-queue-processing-fargate-service.integ.snapshot/aws-ecs-patterns-queue.template.json +++ b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/circuit-breaker-queue-processing-fargate-service.integ.snapshot/aws-ecs-patterns-queue.template.json @@ -461,6 +461,7 @@ "Properties": { "ContainerDefinitions": [ { + "Cpu": 256, "Environment": [ { "Name": "QUEUE_NAME", @@ -504,6 +505,7 @@ } } }, + "Memory": 512, "Name": "QueueProcessingContainer" } ], diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/executionrole.integ.snapshot/aws-ecs-integ.template.json b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/executionrole.integ.snapshot/aws-ecs-integ.template.json index b8aca663dd829..e71893a8f3063 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/executionrole.integ.snapshot/aws-ecs-integ.template.json +++ b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/executionrole.integ.snapshot/aws-ecs-integ.template.json @@ -564,6 +564,7 @@ "Properties": { "ContainerDefinitions": [ { + "Cpu": 512, "Essential": true, "Image": "amazon/amazon-ecs-sample", "LogConfiguration": { @@ -578,6 +579,7 @@ } } }, + "Memory": 1024, "Name": "web", "PortMappings": [ { diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/l3-autocreate.integ.snapshot/aws-ecs-integ-l3-autocreate.template.json b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/l3-autocreate.integ.snapshot/aws-ecs-integ-l3-autocreate.template.json index 1f9ca9150aa38..5efb07639c727 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/l3-autocreate.integ.snapshot/aws-ecs-integ-l3-autocreate.template.json +++ b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/l3-autocreate.integ.snapshot/aws-ecs-integ-l3-autocreate.template.json @@ -129,6 +129,7 @@ "Properties": { "ContainerDefinitions": [ { + "Cpu": 512, "Essential": true, "Image": "amazon/amazon-ecs-sample", "LogConfiguration": { @@ -143,6 +144,7 @@ } } }, + "Memory": 1024, "Name": "web", "PortMappings": [ { @@ -775,6 +777,7 @@ "Properties": { "ContainerDefinitions": [ { + "Cpu": 512, "Essential": true, "Image": "amazon/amazon-ecs-sample", "LogConfiguration": { @@ -789,6 +792,7 @@ } } }, + "Memory": 1024, "Name": "web", "PortMappings": [ { diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/l3-capacity-provider-strategies.integ.snapshot/aws-ecs-integ-lb-fargate.template.json b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/l3-capacity-provider-strategies.integ.snapshot/aws-ecs-integ-lb-fargate.template.json index 78a971a6fc95e..41f957c530db4 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/l3-capacity-provider-strategies.integ.snapshot/aws-ecs-integ-lb-fargate.template.json +++ b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/l3-capacity-provider-strategies.integ.snapshot/aws-ecs-integ-lb-fargate.template.json @@ -528,6 +528,7 @@ "Properties": { "ContainerDefinitions": [ { + "Cpu": 512, "Essential": true, "Image": "amazon/amazon-ecs-sample", "LogConfiguration": { @@ -542,6 +543,7 @@ } } }, + "Memory": 1024, "Name": "web", "PortMappings": [ { @@ -799,6 +801,7 @@ "Properties": { "ContainerDefinitions": [ { + "Cpu": 512, "Essential": true, "Image": "amazon/amazon-ecs-sample", "LogConfiguration": { @@ -813,6 +816,7 @@ } } }, + "Memory": 1024, "Name": "web", "PortMappings": [ { diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/l3-vpconly.integ.snapshot/aws-ecs-integ-l3-vpconly.template.json b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/l3-vpconly.integ.snapshot/aws-ecs-integ-l3-vpconly.template.json index ba315a320a5fc..017474dfeb2d3 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/l3-vpconly.integ.snapshot/aws-ecs-integ-l3-vpconly.template.json +++ b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/l3-vpconly.integ.snapshot/aws-ecs-integ-l3-vpconly.template.json @@ -512,6 +512,7 @@ "Properties": { "ContainerDefinitions": [ { + "Cpu": 512, "Essential": true, "Image": "amazon/amazon-ecs-sample", "LogConfiguration": { @@ -526,6 +527,7 @@ } } }, + "Memory": 1024, "Name": "web", "PortMappings": [ { @@ -775,6 +777,7 @@ "Properties": { "ContainerDefinitions": [ { + "Cpu": 512, "Essential": true, "Image": "amazon/amazon-ecs-sample", "LogConfiguration": { @@ -789,6 +792,7 @@ } } }, + "Memory": 1024, "Name": "web", "PortMappings": [ { diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/l3.integ.snapshot/aws-ecs-integ-lb-fargate.template.json b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/l3.integ.snapshot/aws-ecs-integ-lb-fargate.template.json index 5d9f94b76397a..5055f98fddfed 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/l3.integ.snapshot/aws-ecs-integ-lb-fargate.template.json +++ b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/l3.integ.snapshot/aws-ecs-integ-lb-fargate.template.json @@ -515,6 +515,7 @@ "Properties": { "ContainerDefinitions": [ { + "Cpu": 512, "Essential": true, "Image": "amazon/amazon-ecs-sample", "LogConfiguration": { @@ -529,6 +530,7 @@ } } }, + "Memory": 1024, "Name": "web", "PortMappings": [ { @@ -775,6 +777,7 @@ "Properties": { "ContainerDefinitions": [ { + "Cpu": 512, "Essential": true, "Image": "amazon/amazon-ecs-sample", "LogConfiguration": { @@ -789,6 +792,7 @@ } } }, + "Memory": 1024, "Name": "web", "PortMappings": [ { diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/multiple-network-load-balanced-fargate-service.integ.snapshot/aws-ecs-integ.template.json b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/multiple-network-load-balanced-fargate-service.integ.snapshot/aws-ecs-integ.template.json index 2a503a6b25d24..45e3fbfbb202a 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/multiple-network-load-balanced-fargate-service.integ.snapshot/aws-ecs-integ.template.json +++ b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/multiple-network-load-balanced-fargate-service.integ.snapshot/aws-ecs-integ.template.json @@ -530,6 +530,7 @@ } } }, + "Memory": 512, "Name": "web", "PortMappings": [ { diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/queue-processing-fargate-service-isolated.integ.snapshot/aws-ecs-patterns-queue-isolated.template.json b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/queue-processing-fargate-service-isolated.integ.snapshot/aws-ecs-patterns-queue-isolated.template.json index 930d342cdb091..01f170e4ad3c5 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/queue-processing-fargate-service-isolated.integ.snapshot/aws-ecs-patterns-queue-isolated.template.json +++ b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/queue-processing-fargate-service-isolated.integ.snapshot/aws-ecs-patterns-queue-isolated.template.json @@ -770,6 +770,7 @@ "Properties": { "ContainerDefinitions": [ { + "Cpu": 256, "Environment": [ { "Name": "QUEUE_NAME", @@ -813,6 +814,7 @@ } } }, + "Memory": 512, "Name": "QueueProcessingContainer" } ], diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/queue-processing-fargate-service-public.integ.snapshot/aws-ecs-patterns-queue-public.template.json b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/queue-processing-fargate-service-public.integ.snapshot/aws-ecs-patterns-queue-public.template.json index 1bff926aba21a..68c10a9aac5e8 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/queue-processing-fargate-service-public.integ.snapshot/aws-ecs-patterns-queue-public.template.json +++ b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/queue-processing-fargate-service-public.integ.snapshot/aws-ecs-patterns-queue-public.template.json @@ -461,6 +461,7 @@ "Properties": { "ContainerDefinitions": [ { + "Cpu": 256, "Environment": [ { "Name": "QUEUE_NAME", @@ -513,6 +514,7 @@ } } }, + "Memory": 512, "Name": "QueueProcessingContainer" } ], diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/queue-processing-fargate-service.integ.snapshot/aws-ecs-patterns-queue.template.json b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/queue-processing-fargate-service.integ.snapshot/aws-ecs-patterns-queue.template.json index 4a91c2fabee6f..d635ba9043349 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/queue-processing-fargate-service.integ.snapshot/aws-ecs-patterns-queue.template.json +++ b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/queue-processing-fargate-service.integ.snapshot/aws-ecs-patterns-queue.template.json @@ -461,6 +461,7 @@ "Properties": { "ContainerDefinitions": [ { + "Cpu": 256, "Environment": [ { "Name": "QUEUE_NAME", @@ -504,6 +505,7 @@ } } }, + "Memory": 512, "Name": "QueueProcessingContainer" } ], diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/scheduled-fargate-task.lit.integ.snapshot/aws-fargate-integ.template.json b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/scheduled-fargate-task.lit.integ.snapshot/aws-fargate-integ.template.json index 669810a5d8785..3fb1642063cf0 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/scheduled-fargate-task.lit.integ.snapshot/aws-fargate-integ.template.json +++ b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/scheduled-fargate-task.lit.integ.snapshot/aws-fargate-integ.template.json @@ -285,6 +285,7 @@ "Properties": { "ContainerDefinitions": [ { + "Cpu": 256, "Environment": [ { "Name": "TRIGGER", @@ -323,6 +324,7 @@ } } }, + "Memory": 512, "Name": "ScheduledContainer" } ], From ca3f612a53868fe2ffdec686c311835d4f0e0f57 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Sat, 23 Jul 2022 14:59:10 +0200 Subject: [PATCH 7/7] Fix one more test --- .../aws-fargate-integ.template.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/scheduled-fargate-task.integ.snapshot/aws-fargate-integ.template.json b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/scheduled-fargate-task.integ.snapshot/aws-fargate-integ.template.json index 669810a5d8785..3fb1642063cf0 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/scheduled-fargate-task.integ.snapshot/aws-fargate-integ.template.json +++ b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/scheduled-fargate-task.integ.snapshot/aws-fargate-integ.template.json @@ -285,6 +285,7 @@ "Properties": { "ContainerDefinitions": [ { + "Cpu": 256, "Environment": [ { "Name": "TRIGGER", @@ -323,6 +324,7 @@ } } }, + "Memory": 512, "Name": "ScheduledContainer" } ],