Skip to content

Commit 82b4fc3

Browse files
committed
fix(reportextractor): Ensure simple-configuration can discover app identity
1 parent 88a2ea6 commit 82b4fc3

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

cdk/lib/__snapshots__/report.test.ts.snap

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -718,8 +718,11 @@ exports[`The Report stack matches the snapshot for CODE 1`] = `
718718
"Environment": {
719719
"Variables": {
720720
"APP": "reportextractor",
721+
"App": "reportextractor",
721722
"STACK": "mobile-notifications",
722723
"STAGE": "CODE",
724+
"Stack": "mobile-notifications",
725+
"Stage": "CODE",
723726
},
724727
},
725728
"Handler": "com.gu.notifications.extractor.Lambda",
@@ -1980,8 +1983,11 @@ exports[`The Report stack matches the snapshot for PROD 1`] = `
19801983
"Environment": {
19811984
"Variables": {
19821985
"APP": "reportextractor",
1986+
"App": "reportextractor",
19831987
"STACK": "mobile-notifications",
19841988
"STAGE": "PROD",
1989+
"Stack": "mobile-notifications",
1990+
"Stage": "PROD",
19851991
},
19861992
},
19871993
"Handler": "com.gu.notifications.extractor.Lambda",

cdk/lib/report.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,13 @@ export class Report extends GuStack {
125125
timeout: Duration.minutes(1),
126126
monitoringConfiguration: { noMonitoring: true },
127127
loggingFormat: LoggingFormat.TEXT,
128+
129+
// Although GuCDK provides UPPERCASED env vars for stack, stage, app, simple-configuration reads Title cased env vars.
130+
environment: {
131+
Stack: stack,
132+
Stage: stage,
133+
App: reportExtractorApp,
134+
},
128135
});
129136

130137
reportExtractor.addToRolePolicy(

0 commit comments

Comments
 (0)