Skip to content

Commit 5c8cbc6

Browse files
aug24connoromalleyatworkAshCorr
authored
Prep for PROD ECS (#16651)
* Add testing for no-ecs version of tag page rendering prod * Prep for PROD ECS * Correct check for missing image identifier * Wrap fetching image digest in function * fix: Update PROD tag page rendering snapshots --------- Co-authored-by: Connor OMalley <connor.omalley@guardian.co.uk> Co-authored-by: AshCorr <ashcorr20@gmail.com>
1 parent d48934a commit 5c8cbc6

3 files changed

Lines changed: 983 additions & 46 deletions

File tree

dotcom-rendering/cdk/bin/cdk.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,21 @@ new RenderingCDKStack(cdkApp, 'FaciaRendering-PROD', {
9797
});
9898

9999
/** Tag pages */
100+
function getImageIdentifier(): string {
101+
const imageIdentifier: string | undefined = process.env.IMAGE_DIGEST;
102+
if (!imageIdentifier) {
103+
throw new Error('Image identifier must be provided');
104+
}
105+
return imageIdentifier;
106+
}
107+
100108
export const TagPageRenderingPropsCODE: RenderingCDKStackProps = {
101109
guApp: 'tag-page-rendering',
102110
stage: 'CODE',
103111
domainName: 'tag-page-rendering.code.dev-guardianapis.com',
104112
scaling: { minimumInstances: 1, maximumInstances: 3 },
105113
instanceType: InstanceType.of(InstanceClass.T4G, InstanceSize.SMALL),
106-
imageIdentifier: process.env.IMAGE_DIGEST ?? 'DEV',
114+
imageIdentifier: getImageIdentifier(),
107115
};
108116

109117
new RenderingCDKStack(
@@ -142,6 +150,7 @@ export const TagPageRenderingPropsPROD: RenderingCDKStackProps = {
142150
},
143151
},
144152
instanceType: InstanceType.of(InstanceClass.C8G, InstanceSize.MEDIUM),
153+
imageIdentifier: getImageIdentifier(),
145154
};
146155

147156
new RenderingCDKStack(

0 commit comments

Comments
 (0)