Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions dotcom-rendering/cdk/bin/cdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@ export const TagPageRenderingPropsCODE: RenderingCDKStackProps = {
scaleOutCooldown: Duration.seconds(60),
},
},

// Route all traffic to ECS
targetGroupWeights: {
ec2: 0,
ecs: 1,
},
},
};

Expand Down Expand Up @@ -178,6 +184,12 @@ export const TagPageRenderingPropsPROD: RenderingCDKStackProps = {
scaleOutCooldown: Duration.seconds(60),
},
},

// Route 90% traffic to EC2, 10% to ECS
targetGroupWeights: {
ec2: 9,
ecs: 1,
},
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2966,13 +2966,13 @@ exports[`The RenderingCDKStack matches the snapshot for Tag Page Rendering CODE
"TargetGroupArn": {
"Ref": "TargetGroupTagpagerendering42E428EE",
},
"Weight": 1,
"Weight": 0,
},
{
"TargetGroupArn": {
"Ref": "TagpagerenderingEcsTargetGroupTagpagerendering0976D2E5",
},
"Weight": 0,
"Weight": 1,
},
],
},
Expand Down Expand Up @@ -5459,13 +5459,13 @@ exports[`The RenderingCDKStack matches the snapshot for Tag Page Rendering PROD
"TargetGroupArn": {
"Ref": "TargetGroupTagpagerendering42E428EE",
},
"Weight": 1,
"Weight": 9,
},
{
"TargetGroupArn": {
"Ref": "TagpagerenderingEcsTargetGroupTagpagerendering0976D2E5",
},
"Weight": 0,
"Weight": 1,
},
],
},
Expand Down
11 changes: 5 additions & 6 deletions dotcom-rendering/cdk/lib/renderingStack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ export interface RenderingCDKStackProps extends Omit<GuStackProps, 'stack'> {
scaling: NonNullable<
GuLoadBalancedAppExperimentalProps['ecsProps']
>['scaling'];

targetGroupWeights: NonNullable<
GuLoadBalancedAppExperimentalProps['targetGroupWeights']
>;
};
}

Expand Down Expand Up @@ -303,12 +307,7 @@ export class RenderingCDKStack extends CDKStack {
cpu: ecsProps.taskCpu,
scaling: ecsProps.scaling,
},

// Route all traffic to EC2
targetGroupWeights: {
ec2: 1,
ecs: 0,
},
targetGroupWeights: ecsProps.targetGroupWeights,
}),
});

Expand Down
Loading