Skip to content

Commit d261057

Browse files
authored
Merge pull request #1639 from guardian/aa/registration-app
fix(registration): Consistent application of `app` tag
2 parents 5b55d61 + 8921d43 commit d261057

File tree

3 files changed

+76
-18
lines changed

3 files changed

+76
-18
lines changed

cdk/bin/cdk.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import 'source-map-support/register';
2-
import type { GuStackProps } from '@guardian/cdk/lib/constructs/core';
32
import { App } from 'aws-cdk-lib';
3+
import type { RegistrationProps } from '../lib/registration';
44
import { Registration } from '../lib/registration';
55
import { RegistrationsDbProxy } from '../lib/registrations-db-proxy';
66
import { Report, type ReportProps } from '../lib/report';
@@ -9,14 +9,16 @@ import { SloMonitoring } from '../lib/slo-monitoring';
99

1010
const app = new App();
1111

12-
export const registrationCodeProps: GuStackProps = {
12+
export const registrationCodeProps: RegistrationProps = {
1313
stack: 'mobile-notifications',
1414
stage: 'CODE',
15+
app: 'registration',
1516
};
1617

17-
export const registrationProdProps: GuStackProps = {
18+
export const registrationProdProps: RegistrationProps = {
1819
stack: 'mobile-notifications',
1920
stage: 'PROD',
21+
app: 'registration',
2022
};
2123

2224
new Registration(app, 'Registration-CODE', registrationCodeProps);

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

Lines changed: 66 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,10 @@ exports[`The Registration stack matches the snapshot for CODE 1`] = `
233233
},
234234
],
235235
"Tags": [
236+
{
237+
"Key": "App",
238+
"Value": "registration",
239+
},
236240
{
237241
"Key": "gu:cdk:version",
238242
"Value": "TEST",
@@ -326,6 +330,10 @@ exports[`The Registration stack matches the snapshot for CODE 1`] = `
326330
},
327331
"Statistic": "Average",
328332
"Tags": [
333+
{
334+
"Key": "App",
335+
"Value": "registration",
336+
},
329337
{
330338
"Key": "gu:cdk:version",
331339
"Value": "TEST",
@@ -383,6 +391,10 @@ exports[`The Registration stack matches the snapshot for CODE 1`] = `
383391
},
384392
],
385393
"Tags": [
394+
{
395+
"Key": "App",
396+
"Value": "registration",
397+
},
386398
{
387399
"Key": "gu:cdk:version",
388400
"Value": "TEST",
@@ -426,6 +438,10 @@ exports[`The Registration stack matches the snapshot for CODE 1`] = `
426438
},
427439
],
428440
"Tags": [
441+
{
442+
"Key": "App",
443+
"Value": "registration",
444+
},
429445
{
430446
"Key": "gu:cdk:version",
431447
"Value": "TEST",
@@ -478,6 +494,10 @@ exports[`The Registration stack matches the snapshot for CODE 1`] = `
478494
"Ref": "PublicSubnets",
479495
},
480496
"Tags": [
497+
{
498+
"Key": "App",
499+
"Value": "registration",
500+
},
481501
{
482502
"Key": "gu:cdk:version",
483503
"Value": "TEST",
@@ -553,6 +573,10 @@ exports[`The Registration stack matches the snapshot for CODE 1`] = `
553573
},
554574
"Statistic": "Average",
555575
"Tags": [
576+
{
577+
"Key": "App",
578+
"Value": "registration",
579+
},
556580
{
557581
"Key": "gu:cdk:version",
558582
"Value": "TEST",
@@ -612,6 +636,10 @@ exports[`The Registration stack matches the snapshot for CODE 1`] = `
612636
"Period": 1800,
613637
"Statistic": "Sum",
614638
"Tags": [
639+
{
640+
"Key": "App",
641+
"Value": "registration",
642+
},
615643
{
616644
"Key": "gu:cdk:version",
617645
"Value": "TEST",
@@ -666,6 +694,10 @@ exports[`The Registration stack matches the snapshot for CODE 1`] = `
666694
"Period": 86400,
667695
"Statistic": "Sum",
668696
"Tags": [
697+
{
698+
"Key": "App",
699+
"Value": "registration",
700+
},
669701
{
670702
"Key": "gu:cdk:version",
671703
"Value": "TEST",
@@ -726,13 +758,7 @@ exports[`The Registration stack matches the snapshot for CODE 1`] = `
726758
{
727759
"Key": "App",
728760
"PropagateAtLaunch": true,
729-
"Value": {
730-
"Fn::FindInMap": [
731-
"Constants",
732-
"App",
733-
"Value",
734-
],
735-
},
761+
"Value": "registration",
736762
},
737763
{
738764
"Key": "gu:cdk:version",
@@ -1090,6 +1116,10 @@ exports[`The Registration stack matches the snapshot for PROD 1`] = `
10901116
},
10911117
],
10921118
"Tags": [
1119+
{
1120+
"Key": "App",
1121+
"Value": "registration",
1122+
},
10931123
{
10941124
"Key": "gu:cdk:version",
10951125
"Value": "TEST",
@@ -1183,6 +1213,10 @@ exports[`The Registration stack matches the snapshot for PROD 1`] = `
11831213
},
11841214
"Statistic": "Average",
11851215
"Tags": [
1216+
{
1217+
"Key": "App",
1218+
"Value": "registration",
1219+
},
11861220
{
11871221
"Key": "gu:cdk:version",
11881222
"Value": "TEST",
@@ -1240,6 +1274,10 @@ exports[`The Registration stack matches the snapshot for PROD 1`] = `
12401274
},
12411275
],
12421276
"Tags": [
1277+
{
1278+
"Key": "App",
1279+
"Value": "registration",
1280+
},
12431281
{
12441282
"Key": "gu:cdk:version",
12451283
"Value": "TEST",
@@ -1283,6 +1321,10 @@ exports[`The Registration stack matches the snapshot for PROD 1`] = `
12831321
},
12841322
],
12851323
"Tags": [
1324+
{
1325+
"Key": "App",
1326+
"Value": "registration",
1327+
},
12861328
{
12871329
"Key": "gu:cdk:version",
12881330
"Value": "TEST",
@@ -1335,6 +1377,10 @@ exports[`The Registration stack matches the snapshot for PROD 1`] = `
13351377
"Ref": "PublicSubnets",
13361378
},
13371379
"Tags": [
1380+
{
1381+
"Key": "App",
1382+
"Value": "registration",
1383+
},
13381384
{
13391385
"Key": "gu:cdk:version",
13401386
"Value": "TEST",
@@ -1410,6 +1456,10 @@ exports[`The Registration stack matches the snapshot for PROD 1`] = `
14101456
},
14111457
"Statistic": "Average",
14121458
"Tags": [
1459+
{
1460+
"Key": "App",
1461+
"Value": "registration",
1462+
},
14131463
{
14141464
"Key": "gu:cdk:version",
14151465
"Value": "TEST",
@@ -1469,6 +1519,10 @@ exports[`The Registration stack matches the snapshot for PROD 1`] = `
14691519
"Period": 1800,
14701520
"Statistic": "Sum",
14711521
"Tags": [
1522+
{
1523+
"Key": "App",
1524+
"Value": "registration",
1525+
},
14721526
{
14731527
"Key": "gu:cdk:version",
14741528
"Value": "TEST",
@@ -1523,6 +1577,10 @@ exports[`The Registration stack matches the snapshot for PROD 1`] = `
15231577
"Period": 86400,
15241578
"Statistic": "Sum",
15251579
"Tags": [
1580+
{
1581+
"Key": "App",
1582+
"Value": "registration",
1583+
},
15261584
{
15271585
"Key": "gu:cdk:version",
15281586
"Value": "TEST",
@@ -1583,13 +1641,7 @@ exports[`The Registration stack matches the snapshot for PROD 1`] = `
15831641
{
15841642
"Key": "App",
15851643
"PropagateAtLaunch": true,
1586-
"Value": {
1587-
"Fn::FindInMap": [
1588-
"Constants",
1589-
"App",
1590-
"Value",
1591-
],
1592-
},
1644+
"Value": "registration",
15931645
},
15941646
{
15951647
"Key": "gu:cdk:version",

cdk/lib/registration.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@ import { GuStack } from '@guardian/cdk/lib/constructs/core';
44
import type { App } from 'aws-cdk-lib';
55
import { CfnInclude } from 'aws-cdk-lib/cloudformation-include';
66

7+
export interface RegistrationProps extends GuStackProps {
8+
app: string;
9+
}
10+
711
export class Registration extends GuStack {
8-
constructor(scope: App, id: string, props: GuStackProps) {
12+
constructor(scope: App, id: string, props: RegistrationProps) {
913
super(scope, id, props);
1014
const yamlTemplateFilePath = join(
1115
__dirname,

0 commit comments

Comments
 (0)