From b77b365340b78c0181000f5a9b1be49ec87dcf0d Mon Sep 17 00:00:00 2001 From: akash1810 Date: Mon, 12 Oct 2026 08:05:02 +0100 Subject: [PATCH] feat(tag-page-rendering): Scale EC2 instances to 0 Since https://github.com/guardian/dotcom-rendering/pull/16746, ECS has been serving 100% of CODE. Since https://github.com/guardian/dotcom-rendering/pull/16908, ECS has been serving 100% of PROD. This change scales down the EC2 infrastructure of these apps to 0 instances. This has two benefits: - Cost saving - Reducing "noise" from logs by removing EC2 launch configuration logs --- dotcom-rendering/cdk/bin/cdk.ts | 12 ++++++------ .../lib/__snapshots__/renderingStack.test.ts.snap | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/dotcom-rendering/cdk/bin/cdk.ts b/dotcom-rendering/cdk/bin/cdk.ts index 5445816d3f9..f012cec31ba 100644 --- a/dotcom-rendering/cdk/bin/cdk.ts +++ b/dotcom-rendering/cdk/bin/cdk.ts @@ -116,8 +116,8 @@ export const TagPageRenderingPropsCODE: RenderingCDKStackProps = { taskCpu: 1024, taskMemoryLimitMiB: 2048, scaling: { - minimumTasks: 1, - maximumTasks: 9, + minimumTasks: 0, + maximumTasks: 0, cpuScaling: { targetValue: 20, scaleInCooldown: Duration.seconds(60), @@ -125,7 +125,7 @@ export const TagPageRenderingPropsCODE: RenderingCDKStackProps = { }, }, - // Route all traffic to ECS + // Route all traffic to ECS. NOTE: EC2 has 0 instances. targetGroupWeights: { ec2: 0, ecs: 1, @@ -144,8 +144,8 @@ export const TagPageRenderingPropsPROD: RenderingCDKStackProps = { stage: 'PROD', domainName: 'tag-page-rendering.guardianapis.com', scaling: { - minimumInstances: 9, - maximumInstances: 90, + minimumInstances: 0, + maximumInstances: 0, policies: { step: { cpu: cpuScalingSteps, @@ -185,7 +185,7 @@ export const TagPageRenderingPropsPROD: RenderingCDKStackProps = { }, }, - // Route 100% traffic to ECS + // Route 100% traffic to ECS. NOTE: EC2 has 0 instances. targetGroupWeights: { ec2: 0, ecs: 1, diff --git a/dotcom-rendering/cdk/lib/__snapshots__/renderingStack.test.ts.snap b/dotcom-rendering/cdk/lib/__snapshots__/renderingStack.test.ts.snap index b0f2192e604..172f2ad50b1 100644 --- a/dotcom-rendering/cdk/lib/__snapshots__/renderingStack.test.ts.snap +++ b/dotcom-rendering/cdk/lib/__snapshots__/renderingStack.test.ts.snap @@ -2109,8 +2109,8 @@ exports[`The RenderingCDKStack matches the snapshot for Tag Page Rendering CODE "EcsTaskDefinitionTaskRoleB7B6D8DD", ], "Properties": { - "MaxCapacity": 9, - "MinCapacity": 1, + "MaxCapacity": 0, + "MinCapacity": 0, "ResourceId": { "Fn::Join": [ "", @@ -3969,13 +3969,13 @@ exports[`The RenderingCDKStack matches the snapshot for Tag Page Rendering PROD ], }, }, - "MaxSize": "90", + "MaxSize": "0", "MetricsCollection": [ { "Granularity": "1Minute", }, ], - "MinSize": "9", + "MinSize": "0", "Tags": [ { "Key": "App",