Skip to content

Commit 8d15827

Browse files
committed
Migrate lambda functions. There is a required reference to the SAM stack so that it can access the stateful resources, e.g. tables, SQS, params.
1 parent 0728630 commit 8d15827

9 files changed

Lines changed: 553 additions & 3 deletions

File tree

.github/workflows/cdk_release_code.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,18 @@ on:
4141
EXPOSE_GET_STATUS_UPDATES:
4242
type: boolean
4343
required: true
44+
SAM_STACK_NAME:
45+
type: string
46+
required: true
47+
ENABLE_POST_DATED_NOTIFICATIONS:
48+
type: boolean
49+
required: true
50+
REQUIRE_APPLICATION_NAME:
51+
type: boolean
52+
required: true
53+
ENABLE_BACKUP:
54+
type: boolean
55+
required: true
4456
pinned_image:
4557
required: true
4658
type: string
@@ -107,6 +119,10 @@ jobs:
107119
CDK_CONFIG_forwardCsocLogs: "${{ inputs.FORWARD_CSOC_LOGS }}"
108120
CDK_CONFIG_deployCheckPrescriptionStatusUpdate: "${{ inputs.DEPLOY_CHECK_PRESCRIPTION_STATUS_UPDATE }}"
109121
CDK_CONFIG_exposeGetStatusUpdates: "${{ inputs.EXPOSE_GET_STATUS_UPDATES }}"
122+
CDK_CONFIG_samStackName: "${{ inputs.SAM_STACK_NAME }}"
123+
CDK_CONFIG_enablePostDatedNotifications: "${{ inputs.ENABLE_POST_DATED_NOTIFICATIONS }}"
124+
CDK_CONFIG_requireApplicationName: "${{ inputs.REQUIRE_APPLICATION_NAME }}"
125+
CDK_CONFIG_enableBackup: "${{ inputs.ENABLE_BACKUP }}"
110126
REQUIRE_APPROVAL: "never"
111127

112128
# later, there will be API deployment steps c.f. https://github.com/NHSDigital/electronic-prescription-service-clinical-prescription-tracker/blob/main/.github/workflows/cdk_release_code.yml

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ jobs:
8585
FORWARD_CSOC_LOGS: false
8686
DEPLOY_CHECK_PRESCRIPTION_STATUS_UPDATE: true
8787
EXPOSE_GET_STATUS_UPDATES: false
88+
SAM_STACK_NAME: psu
89+
ENABLE_POST_DATED_NOTIFICATIONS: true
90+
REQUIRE_APPLICATION_NAME: false
91+
ENABLE_BACKUP: true
8892
secrets:
8993
CLOUD_FORMATION_DEPLOY_ROLE: ${{ secrets.DEV_CLOUD_FORMATION_DEPLOY_ROLE }}
9094

.github/workflows/pull_request.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ jobs:
128128
FORWARD_CSOC_LOGS: false
129129
DEPLOY_CHECK_PRESCRIPTION_STATUS_UPDATE: true
130130
EXPOSE_GET_STATUS_UPDATES: false
131+
SAM_STACK_NAME: psu-pr-${{needs.get_issue_number.outputs.issue_number}}
132+
ENABLE_POST_DATED_NOTIFICATIONS: true
133+
REQUIRE_APPLICATION_NAME: false
134+
ENABLE_BACKUP: false
131135
secrets:
132136
CLOUD_FORMATION_DEPLOY_ROLE: ${{ secrets.DEV_CLOUD_FORMATION_DEPLOY_ROLE }}
133137

.github/workflows/release.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ jobs:
8787
FORWARD_CSOC_LOGS: false
8888
DEPLOY_CHECK_PRESCRIPTION_STATUS_UPDATE: true
8989
EXPOSE_GET_STATUS_UPDATES: false
90+
SAM_STACK_NAME: psu
91+
ENABLE_POST_DATED_NOTIFICATIONS: true
92+
REQUIRE_APPLICATION_NAME: false
93+
ENABLE_BACKUP: true
9094
secrets:
9195
CLOUD_FORMATION_DEPLOY_ROLE: ${{ secrets.DEV_CLOUD_FORMATION_DEPLOY_ROLE }}
9296

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ SHELL = /bin/bash
22
.SHELLFLAGS = -o pipefail -c
33
export CDK_APP_NAME=PsuStatelessApp
44
export CDK_CONFIG_stackName=${stack_name}
5+
export CDK_CONFIG_samStackName=${stack_name}
56
export CDK_CONFIG_versionNumber=undefined
67
export CDK_CONFIG_commitId=undefined
78
export CDK_CONFIG_isPullRequest=true
@@ -12,6 +13,9 @@ export CDK_CONFIG_trustStoreFile=psu-truststore.pem
1213
export CDK_CONFIG_forwardCsocLogs=false
1314
export CDK_CONFIG_deployCheckPrescriptionStatusUpdate=true
1415
export CDK_CONFIG_exposeGetStatusUpdates=false
16+
export CDK_CONFIG_enablePostDatedNotifications=false
17+
export CDK_CONFIG_requireApplicationName=false
18+
export CDK_CONFIG_enableBackup=false
1519

1620
guard-%:
1721
@ if [ "${${*}}" = "" ]; then \

packages/cdk/bin/PsuStatelessApp.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,18 @@ async function main() {
1818
new PsuStatelessStack(app, "PsuStatelessStack", {
1919
...props,
2020
stackName: calculateVersionedStackName(getConfigFromEnvVar("stackName"), props),
21+
samStackName: getConfigFromEnvVar("samStackName"), // TODO: REMOVE THE NEED FOR THIS
2122
logRetentionInDays: getNumberConfigFromEnvVar("logRetentionInDays"),
23+
logLevel: getConfigFromEnvVar("logLevel"),
24+
environment: getConfigFromEnvVar("environment"),
2225
mutualTlsTrustStoreKey: props.isPullRequest ? undefined : getConfigFromEnvVar("trustStoreFile"),
2326
csocApiGatewayDestination: "arn:aws:logs:eu-west-2:693466633220:destination:api_gateway_log_destination",
2427
forwardCsocLogs: getBooleanConfigFromEnvVar("forwardCsocLogs"),
2528
deployCheckPrescriptionStatusUpdate: getBooleanConfigFromEnvVar("deployCheckPrescriptionStatusUpdate"),
26-
exposeGetStatusUpdates: getBooleanConfigFromEnvVar("exposeGetStatusUpdates")
29+
exposeGetStatusUpdates: getBooleanConfigFromEnvVar("exposeGetStatusUpdates"),
30+
enablePostDatedNotifications: getConfigFromEnvVar("enablePostDatedNotifications", undefined, "false"),
31+
requireApplicationName: getConfigFromEnvVar("requireApplicationName", undefined, "false"),
32+
enableBackup: getBooleanConfigFromEnvVar("enableBackup", undefined, "false")
2733
})
2834
}
2935

0 commit comments

Comments
 (0)