Skip to content

Commit c858e0c

Browse files
authored
Merge pull request #1637 from guardian/notification-migration-cdk
Add cdk project for notification
2 parents d261057 + 319bacf commit c858e0c

File tree

6 files changed

+2245
-2
lines changed

6 files changed

+2245
-2
lines changed

.github/workflows/notification.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
- common/**
88
- commoneventconsumer/**
99
- commonscheduleddynamodb/**
10+
- cdk/**
1011
- project/**
1112
- build.sbt
1213
- .github/workflows/notification.yml
@@ -32,6 +33,22 @@ jobs:
3233
- name: Setup JDK and sbt
3334
uses: guardian/setup-scala@v1
3435

36+
- run: corepack enable
37+
38+
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 #v6.2.0
39+
with:
40+
cache: yarn
41+
cache-dependency-path: cdk/yarn.lock
42+
node-version-file: .nvmrc
43+
44+
- name: CDK synth
45+
run: |
46+
cd cdk
47+
yarn install --immutable
48+
yarn lint
49+
yarn test
50+
yarn synth
51+
3552
- name: Compile, test and package
3653
run: sbt "project common" "compile" "test" "project commonscheduledynamodb" "compile" "test" "project notification" "compile" "test" "debian:packageBin"
3754

@@ -57,4 +74,5 @@ jobs:
5774
notification:
5875
- notification/target/notification_1.0-latest_all.deb
5976
notification-cfn:
60-
- notification/conf/notification.yaml
77+
- cdk/cdk.out/Notification-CODE.template.json
78+
- cdk/cdk.out/Notification-PROD.template.json

cdk/bin/cdk.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import 'source-map-support/register';
22
import { App } from 'aws-cdk-lib';
3+
import type { NotificationProps } from '../lib/notification';
4+
import { Notification } from '../lib/notification';
35
import type { RegistrationProps } from '../lib/registration';
46
import { Registration } from '../lib/registration';
57
import { RegistrationsDbProxy } from '../lib/registrations-db-proxy';
@@ -9,6 +11,18 @@ import { SloMonitoring } from '../lib/slo-monitoring';
911

1012
const app = new App();
1113

14+
export const notificationCodeProps: NotificationProps = {
15+
stack: 'mobile-notifications',
16+
stage: 'CODE',
17+
};
18+
19+
export const notificationProdProps: NotificationProps = {
20+
stack: 'mobile-notifications',
21+
stage: 'PROD',
22+
};
23+
24+
new Notification(app, 'Notification-CODE', notificationCodeProps);
25+
new Notification(app, 'Notification-PROD', notificationProdProps);
1226
export const registrationCodeProps: RegistrationProps = {
1327
stack: 'mobile-notifications',
1428
stage: 'CODE',

0 commit comments

Comments
 (0)