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
8 changes: 5 additions & 3 deletions cdk/bin/cdk.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'source-map-support/register';
import type { GuStackProps } from '@guardian/cdk/lib/constructs/core';
import { App } from 'aws-cdk-lib';
import type { RegistrationProps } from '../lib/registration';
import { Registration } from '../lib/registration';
import { RegistrationsDbProxy } from '../lib/registrations-db-proxy';
import { Report, type ReportProps } from '../lib/report';
Expand All @@ -9,14 +9,16 @@ import { SloMonitoring } from '../lib/slo-monitoring';

const app = new App();

export const registrationCodeProps: GuStackProps = {
export const registrationCodeProps: RegistrationProps = {
stack: 'mobile-notifications',
stage: 'CODE',
app: 'registration',
};

export const registrationProdProps: GuStackProps = {
export const registrationProdProps: RegistrationProps = {
stack: 'mobile-notifications',
stage: 'PROD',
app: 'registration',
};

new Registration(app, 'Registration-CODE', registrationCodeProps);
Expand Down
80 changes: 66 additions & 14 deletions cdk/lib/__snapshots__/registration.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,10 @@ exports[`The Registration stack matches the snapshot for CODE 1`] = `
},
],
"Tags": [
{
"Key": "App",
"Value": "registration",
},
{
"Key": "gu:cdk:version",
"Value": "TEST",
Expand Down Expand Up @@ -326,6 +330,10 @@ exports[`The Registration stack matches the snapshot for CODE 1`] = `
},
"Statistic": "Average",
"Tags": [
{
"Key": "App",
"Value": "registration",
},
{
"Key": "gu:cdk:version",
"Value": "TEST",
Expand Down Expand Up @@ -383,6 +391,10 @@ exports[`The Registration stack matches the snapshot for CODE 1`] = `
},
],
"Tags": [
{
"Key": "App",
"Value": "registration",
},
{
"Key": "gu:cdk:version",
"Value": "TEST",
Expand Down Expand Up @@ -426,6 +438,10 @@ exports[`The Registration stack matches the snapshot for CODE 1`] = `
},
],
"Tags": [
{
"Key": "App",
"Value": "registration",
},
{
"Key": "gu:cdk:version",
"Value": "TEST",
Expand Down Expand Up @@ -478,6 +494,10 @@ exports[`The Registration stack matches the snapshot for CODE 1`] = `
"Ref": "PublicSubnets",
},
"Tags": [
{
"Key": "App",
"Value": "registration",
},
{
"Key": "gu:cdk:version",
"Value": "TEST",
Expand Down Expand Up @@ -553,6 +573,10 @@ exports[`The Registration stack matches the snapshot for CODE 1`] = `
},
"Statistic": "Average",
"Tags": [
{
"Key": "App",
"Value": "registration",
},
{
"Key": "gu:cdk:version",
"Value": "TEST",
Expand Down Expand Up @@ -612,6 +636,10 @@ exports[`The Registration stack matches the snapshot for CODE 1`] = `
"Period": 1800,
"Statistic": "Sum",
"Tags": [
{
"Key": "App",
"Value": "registration",
},
{
"Key": "gu:cdk:version",
"Value": "TEST",
Expand Down Expand Up @@ -666,6 +694,10 @@ exports[`The Registration stack matches the snapshot for CODE 1`] = `
"Period": 86400,
"Statistic": "Sum",
"Tags": [
{
"Key": "App",
"Value": "registration",
},
{
"Key": "gu:cdk:version",
"Value": "TEST",
Expand Down Expand Up @@ -726,13 +758,7 @@ exports[`The Registration stack matches the snapshot for CODE 1`] = `
{
"Key": "App",
"PropagateAtLaunch": true,
"Value": {
"Fn::FindInMap": [
"Constants",
"App",
"Value",
],
},
"Value": "registration",
},
{
"Key": "gu:cdk:version",
Expand Down Expand Up @@ -1090,6 +1116,10 @@ exports[`The Registration stack matches the snapshot for PROD 1`] = `
},
],
"Tags": [
{
"Key": "App",
"Value": "registration",
},
{
"Key": "gu:cdk:version",
"Value": "TEST",
Expand Down Expand Up @@ -1183,6 +1213,10 @@ exports[`The Registration stack matches the snapshot for PROD 1`] = `
},
"Statistic": "Average",
"Tags": [
{
"Key": "App",
"Value": "registration",
},
{
"Key": "gu:cdk:version",
"Value": "TEST",
Expand Down Expand Up @@ -1240,6 +1274,10 @@ exports[`The Registration stack matches the snapshot for PROD 1`] = `
},
],
"Tags": [
{
"Key": "App",
"Value": "registration",
},
{
"Key": "gu:cdk:version",
"Value": "TEST",
Expand Down Expand Up @@ -1283,6 +1321,10 @@ exports[`The Registration stack matches the snapshot for PROD 1`] = `
},
],
"Tags": [
{
"Key": "App",
"Value": "registration",
},
{
"Key": "gu:cdk:version",
"Value": "TEST",
Expand Down Expand Up @@ -1335,6 +1377,10 @@ exports[`The Registration stack matches the snapshot for PROD 1`] = `
"Ref": "PublicSubnets",
},
"Tags": [
{
"Key": "App",
"Value": "registration",
},
{
"Key": "gu:cdk:version",
"Value": "TEST",
Expand Down Expand Up @@ -1410,6 +1456,10 @@ exports[`The Registration stack matches the snapshot for PROD 1`] = `
},
"Statistic": "Average",
"Tags": [
{
"Key": "App",
"Value": "registration",
},
{
"Key": "gu:cdk:version",
"Value": "TEST",
Expand Down Expand Up @@ -1469,6 +1519,10 @@ exports[`The Registration stack matches the snapshot for PROD 1`] = `
"Period": 1800,
"Statistic": "Sum",
"Tags": [
{
"Key": "App",
"Value": "registration",
},
{
"Key": "gu:cdk:version",
"Value": "TEST",
Expand Down Expand Up @@ -1523,6 +1577,10 @@ exports[`The Registration stack matches the snapshot for PROD 1`] = `
"Period": 86400,
"Statistic": "Sum",
"Tags": [
{
"Key": "App",
"Value": "registration",
},
{
"Key": "gu:cdk:version",
"Value": "TEST",
Expand Down Expand Up @@ -1583,13 +1641,7 @@ exports[`The Registration stack matches the snapshot for PROD 1`] = `
{
"Key": "App",
"PropagateAtLaunch": true,
"Value": {
"Fn::FindInMap": [
"Constants",
"App",
"Value",
],
},
"Value": "registration",
},
{
"Key": "gu:cdk:version",
Expand Down
6 changes: 5 additions & 1 deletion cdk/lib/registration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ import { GuStack } from '@guardian/cdk/lib/constructs/core';
import type { App } from 'aws-cdk-lib';
import { CfnInclude } from 'aws-cdk-lib/cloudformation-include';

export interface RegistrationProps extends GuStackProps {
app: string;
}

export class Registration extends GuStack {
constructor(scope: App, id: string, props: GuStackProps) {
constructor(scope: App, id: string, props: RegistrationProps) {
super(scope, id, props);
const yamlTemplateFilePath = join(
__dirname,
Expand Down