Skip to content
Draft
Show file tree
Hide file tree
Changes from 3 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
5 changes: 5 additions & 0 deletions .github/scripts/release_code.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,9 @@ sam deploy \
StateMachineLogLevel="$STATE_MACHINE_LOG_LEVEL" \
EnableNotificationsInternal="$ENABLE_NOTIFICATIONS_INTERNAL" \
EnableNotificationsExternal="$ENABLE_NOTIFICATIONS_EXTERNAL" \
EnabledSiteODSCodesValue="$ENABLED_SITE_ODS_CODES" \
EnabledSystemsValue="$ENABLED_SYSTEMS" \
BlockedSiteODSCodesValue="$BLOCKED_SITE_ODS_CODES" \
NotifyRoutingPlanIDValue="$NOTIFY_ROUTING_PLAN_ID" \
NotifyAPIBaseURLValue="$NOTIFY_API_BASE_URL" \
RequireApplicationName="$REQUIRE_APPLICATION_NAME"
15 changes: 15 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ jobs:
ENABLE_BACKUP: True
ENABLE_NOTIFICATIONS_INTERNAL: true
ENABLE_NOTIFICATIONS_EXTERNAL: false
ENABLED_SITE_ODS_CODES: "FA565,A83008"
ENABLED_SYSTEMS: "Internal Test System"
BLOCKED_SITE_ODS_CODES: "B3J1Z"
NOTIFY_ROUTING_PLAN_ID: "e57fe5cc-0567-4854-abe2-b7dd9014a50c"
NOTIFY_API_BASE_URL: "https://int.api.service.nhs.uk"
MTLS_KEY: psu-mtls-1
IS_PULL_REQUEST: false
secrets:
Expand Down Expand Up @@ -155,6 +160,11 @@ jobs:
ENABLE_BACKUP: False
ENABLE_NOTIFICATIONS_INTERNAL: false
ENABLE_NOTIFICATIONS_EXTERNAL: false
ENABLED_SITE_ODS_CODES: "FA565,A83008"
ENABLED_SYSTEMS: "Internal Test System"
BLOCKED_SITE_ODS_CODES: "B3J1Z"
NOTIFY_ROUTING_PLAN_ID: "e57fe5cc-0567-4854-abe2-b7dd9014a50c"
NOTIFY_API_BASE_URL: "https://int.api.service.nhs.uk"
MTLS_KEY: psu-mtls-1
IS_PULL_REQUEST: false
secrets:
Expand Down Expand Up @@ -187,6 +197,11 @@ jobs:
ENABLE_BACKUP: False
ENABLE_NOTIFICATIONS_INTERNAL: false
ENABLE_NOTIFICATIONS_EXTERNAL: false
ENABLED_SITE_ODS_CODES: "FA565,A83008"
ENABLED_SYSTEMS: "Internal Test System"
BLOCKED_SITE_ODS_CODES: "B3J1Z"
NOTIFY_ROUTING_PLAN_ID: "e57fe5cc-0567-4854-abe2-b7dd9014a50c"
NOTIFY_API_BASE_URL: "https://int.api.service.nhs.uk"
MTLS_KEY: psu-mtls-1
IS_PULL_REQUEST: false
secrets:
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ jobs:
ENABLE_BACKUP: False
ENABLE_NOTIFICATIONS_INTERNAL: true
ENABLE_NOTIFICATIONS_EXTERNAL: false
ENABLED_SITE_ODS_CODES: "FA565,A83008"
ENABLED_SYSTEMS: "Internal Test System"
BLOCKED_SITE_ODS_CODES: "B3J1Z"
NOTIFY_ROUTING_PLAN_ID: "e57fe5cc-0567-4854-abe2-b7dd9014a50c"
NOTIFY_API_BASE_URL: "https://int.api.service.nhs.uk"
MTLS_KEY: psu-mtls-1
IS_PULL_REQUEST: true
secrets:
Expand Down Expand Up @@ -113,6 +118,11 @@ jobs:
ENABLE_BACKUP: False
ENABLE_NOTIFICATIONS_INTERNAL: false
ENABLE_NOTIFICATIONS_EXTERNAL: false
ENABLED_SITE_ODS_CODES: "FA565,A83008"
ENABLED_SYSTEMS: "Internal Test System"
BLOCKED_SITE_ODS_CODES: "B3J1Z"
NOTIFY_ROUTING_PLAN_ID: "e57fe5cc-0567-4854-abe2-b7dd9014a50c"
NOTIFY_API_BASE_URL: "https://int.api.service.nhs.uk"
MTLS_KEY: psu-mtls-1
IS_PULL_REQUEST: true
secrets:
Expand Down
37 changes: 36 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,11 @@ jobs:
ENABLE_BACKUP: True
ENABLE_NOTIFICATIONS_INTERNAL: false
ENABLE_NOTIFICATIONS_EXTERNAL: false
ENABLED_SITE_ODS_CODES: "FA565,A83008"
ENABLED_SYSTEMS: "Internal Test System"
BLOCKED_SITE_ODS_CODES: "B3J1Z"
NOTIFY_ROUTING_PLAN_ID: "e57fe5cc-0567-4854-abe2-b7dd9014a50c"
NOTIFY_API_BASE_URL: "https://int.api.service.nhs.uk"
MTLS_KEY: psu-mtls-1
IS_PULL_REQUEST: false
secrets:
Expand Down Expand Up @@ -172,6 +177,11 @@ jobs:
ENABLE_BACKUP: False
ENABLE_NOTIFICATIONS_INTERNAL: false
ENABLE_NOTIFICATIONS_EXTERNAL: false
ENABLED_SITE_ODS_CODES: "FA565,A83008"
ENABLED_SYSTEMS: "Internal Test System"
BLOCKED_SITE_ODS_CODES: "B3J1Z"
NOTIFY_ROUTING_PLAN_ID: "e57fe5cc-0567-4854-abe2-b7dd9014a50c"
NOTIFY_API_BASE_URL: "https://int.api.service.nhs.uk"
MTLS_KEY: psu-mtls-1
IS_PULL_REQUEST: false
secrets:
Expand Down Expand Up @@ -211,6 +221,11 @@ jobs:
ENABLE_BACKUP: False
ENABLE_NOTIFICATIONS_INTERNAL: false
ENABLE_NOTIFICATIONS_EXTERNAL: false
ENABLED_SITE_ODS_CODES: "FA565,A83008"
ENABLED_SYSTEMS: "Internal Test System, Apotec Ltd - Apotec CRM - Production, CrxPatientApp, nhsPrescriptionApp, Titan PSU Prod"
BLOCKED_SITE_ODS_CODES: "B3J1Z"
NOTIFY_ROUTING_PLAN_ID: "e57fe5cc-0567-4854-abe2-b7dd9014a50c"
NOTIFY_API_BASE_URL: "https://int.api.service.nhs.uk"
MTLS_KEY: psu-mtls-1
IS_PULL_REQUEST: false
secrets:
Expand Down Expand Up @@ -250,6 +265,11 @@ jobs:
ENABLE_BACKUP: False
ENABLE_NOTIFICATIONS_INTERNAL: false
ENABLE_NOTIFICATIONS_EXTERNAL: false
ENABLED_SITE_ODS_CODES: "FA565,A83008"
ENABLED_SYSTEMS: "Internal Test System, Apotec Ltd - Apotec CRM - Production, CrxPatientApp, nhsPrescriptionApp, Titan PSU Prod"
BLOCKED_SITE_ODS_CODES: "B3J1Z"
NOTIFY_ROUTING_PLAN_ID: "e57fe5cc-0567-4854-abe2-b7dd9014a50c"
NOTIFY_API_BASE_URL: "https://int.api.service.nhs.uk"
MTLS_KEY: psu-mtls-1
IS_PULL_REQUEST: false
secrets:
Expand Down Expand Up @@ -284,6 +304,11 @@ jobs:
ENABLE_BACKUP: True
ENABLE_NOTIFICATIONS_INTERNAL: true
ENABLE_NOTIFICATIONS_EXTERNAL: false
ENABLED_SITE_ODS_CODES: "FA565,A83008"
ENABLED_SYSTEMS: "Internal Test System, Apotec Ltd - Apotec CRM - Production, CrxPatientApp, nhsPrescriptionApp, Titan PSU Prod"
BLOCKED_SITE_ODS_CODES: "B3J1Z"
NOTIFY_ROUTING_PLAN_ID: "e57fe5cc-0567-4854-abe2-b7dd9014a50c"
NOTIFY_API_BASE_URL: "https://int.api.service.nhs.uk"
MTLS_KEY: psu-mtls-1
IS_PULL_REQUEST: false
secrets:
Expand Down Expand Up @@ -318,6 +343,11 @@ jobs:
ENABLE_BACKUP: False
ENABLE_NOTIFICATIONS_INTERNAL: false
ENABLE_NOTIFICATIONS_EXTERNAL: false
ENABLED_SITE_ODS_CODES: "FA565,A83008"
ENABLED_SYSTEMS: "Internal Test System, Apotec Ltd - Apotec CRM - Production, CrxPatientApp, nhsPrescriptionApp, Titan PSU Prod"
BLOCKED_SITE_ODS_CODES: "B3J1Z"
NOTIFY_ROUTING_PLAN_ID: "e57fe5cc-0567-4854-abe2-b7dd9014a50c"
NOTIFY_API_BASE_URL: "https://int.api.service.nhs.uk"
MTLS_KEY: psu-mtls-1
IS_PULL_REQUEST: false
secrets:
Expand Down Expand Up @@ -357,8 +387,13 @@ jobs:
RUN_REGRESSION_TEST: false
STATE_MACHINE_LOG_LEVEL: ERROR
ENABLE_BACKUP: True
ENABLE_NOTIFICATIONS_INTERNAL: true
ENABLE_NOTIFICATIONS_INTERNAL: false
ENABLE_NOTIFICATIONS_EXTERNAL: false
ENABLED_SITE_ODS_CODES: " "
ENABLED_SYSTEMS: " "
BLOCKED_SITE_ODS_CODES: " "
NOTIFY_ROUTING_PLAN_ID: "e57fe5cc-0567-4854-abe2-b7dd9014a50c" # INT and PROD share a value
NOTIFY_API_BASE_URL: "https://api.service.nhs.uk"
MTLS_KEY: psu-mtls-1
IS_PULL_REQUEST: false
secrets:
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/run_release_code_and_api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,21 @@ on:
required: false
type: boolean
default: false
ENABLED_SITE_ODS_CODES:
required: true
type: string
ENABLED_SYSTEMS:
required: true
type: string
BLOCKED_SITE_ODS_CODES:
required: true
type: string
NOTIFY_ROUTING_PLAN_ID:
required: true
type: string
NOTIFY_API_BASE_URL:
required: true
type: string
IS_PULL_REQUEST:
type: boolean
default: true
Expand Down Expand Up @@ -179,6 +194,11 @@ jobs:
ENABLE_NOTIFICATIONS_INTERNAL: ${{ inputs.ENABLE_NOTIFICATIONS_INTERNAL }}
ENABLE_NOTIFICATIONS_EXTERNAL: ${{ inputs.ENABLE_NOTIFICATIONS_EXTERNAL }}
REQUIRE_APPLICATION_NAME: ${{ inputs.REQUIRE_APPLICATION_NAME }}
ENABLED_SITE_ODS_CODES: ${{ inputs.ENABLED_SITE_ODS_CODES }}
ENABLED_SYSTEMS: ${{ inputs.ENABLED_SYSTEMS }}
BLOCKED_SITE_ODS_CODES: ${{ inputs.BLOCKED_SITE_ODS_CODES }}
NOTIFY_ROUTING_PLAN_ID: ${{ inputs.NOTIFY_ROUTING_PLAN_ID }}
NOTIFY_API_BASE_URL: ${{ inputs.NOTIFY_API_BASE_URL }}
run: ./release_code.sh

- name: get mtls secrets
Expand Down
2 changes: 1 addition & 1 deletion SAMtemplates/functions/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ Resources:
TABLE_NAME: !Ref PrescriptionNotificationStatesTableName
API_KEY_SECRET: secrets-PSU-Notify-API-Key
PRIVATE_KEY_SECRET: secrets-PSU-Notify-PrivateKey
KID_SECRET: secrets-PSU-Notify-Application-Name
KID_SECRET: secrets-PSU-Notify-Application-KID
NHS_NOTIFY_ROUTING_ID_PARAM: !Ref NotifyRoutingPlanIDParam
NOTIFY_API_BASE_URL_PARAM: !Ref NotifyAPIBaseURLParam
MAKE_REAL_NOTIFY_REQUESTS_PARAM: !Ref EnableNotificationsExternalParam
Expand Down
27 changes: 26 additions & 1 deletion SAMtemplates/main_template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ Parameters:
AllowedValues:
- True
- False

EnableNotificationsInternal:
Type: String
Default: false
Expand All @@ -109,6 +110,26 @@ Parameters:
- true
- false

EnabledSiteODSCodesValue:
Type: String
Default: " "

EnabledSystemsValue:
Type: String
Default: " "

BlockedSiteODSCodesValue:
Type: String
Default: " "

NotifyRoutingPlanIDValue:
Type: String
Default: " "

NotifyAPIBaseURLValue:
Type: String
Default: " "

RequireApplicationName:
Type: String
Default: false
Expand All @@ -130,9 +151,13 @@ Resources:
Location: parameters/main.yaml
Parameters:
StackName: !Ref AWS::StackName
Environment: !Ref Environment
EnableNotificationsInternalValue: !Ref EnableNotificationsInternal
EnableNotificationsExternalValue: !Ref EnableNotificationsExternal
EnabledSiteODSCodesValue: !Ref EnabledSiteODSCodesValue
EnabledSystemsValue: !Ref EnabledSystemsValue
BlockedSiteODSCodesValue: !Ref BlockedSiteODSCodesValue
NotifyRoutingPlanIDValue: !Ref NotifyRoutingPlanIDValue
NotifyAPIBaseURLValue: !Ref NotifyAPIBaseURLValue

Tables:
Type: AWS::Serverless::Application
Expand Down
66 changes: 25 additions & 41 deletions SAMtemplates/parameters/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ Parameters:
StackName:
Type: String

Environment:
Type: String

EnableNotificationsInternalValue:
Type: String
Default: false
Expand All @@ -23,8 +20,25 @@ Parameters:
- true
- false

Conditions:
IsProd: !Equals [ !Ref Environment, prod ]
EnabledSiteODSCodesValue:
Type: String
Default: " "

EnabledSystemsValue:
Type: String
Default: " "

BlockedSiteODSCodesValue:
Type: String
Default: " "

NotifyRoutingPlanIDValue:
Type: String
Default: " "

NotifyAPIBaseURLValue:
Type: String
Default: " "

Resources:
EnabledSiteODSCodesParameter:
Expand All @@ -33,69 +47,39 @@ Resources:
Name: !Sub ${StackName}-PSUNotifyEnabledSiteODSCodes
Description: "List of site ODS codes for which notifications are enabled"
Type: String
Value: !If
- IsProd
- > # Prod notification enabled
FA565
- > # Non-prod
FA565
Value: !Ref EnabledSiteODSCodesValue

EnabledSystemsParameter:
Type: AWS::SSM::Parameter
Properties:
Name: !Sub ${StackName}-PSUNotifyEnabledSystems
Description: "List of application names for which notifications are enabled"
Type: String
Value: !If
- IsProd
- > # Prod notification enabled
Apotec Ltd - Apotec CRM - Production,
CrxPatientApp,
nhsPrescriptionApp,
Titan PSU Prod
- > # Non-prod
Internal Test System,
Apotec Ltd - Apotec CRM - Production,
CrxPatientApp,
nhsPrescriptionApp,
Titan PSU Prod
Value: !Ref EnabledSystemsValue

BlockedSiteODSCodesParameter:
Type: AWS::SSM::Parameter
Properties:
Name: !Sub ${StackName}-PSUNotifyBlockedSiteODSCodes
Description: "List of site ODS codes for which notifications are blocked"
Type: String
Value: !If
- IsProd
- > # Prod notification disabled
B3J1Z
- > # Non-prod
B3J1Z
Value: !Ref BlockedSiteODSCodesValue

NotifyRoutingPlanIDParameter:
Type: AWS::SSM::Parameter
Properties:
Name: !Sub ${StackName}-PSUNotifyRoutingPlanID
Description: "Notify Routing Plan ID"
Type: String
Value: !If
- IsProd
- changeme
# Non-prod value (sandbox)
- b838b13c-f98c-4def-93f0-515d4e4f4ee1
Value: !Ref NotifyRoutingPlanIDValue

NotifyAPIBaseURLParameter:
Type: AWS::SSM::Parameter
Properties:
Name: !Sub ${StackName}-PSUNotifyApiBaseUrl
Description: "Notify API Base URL"
Type: String
Value: !If
- IsProd
- https://api.service.nhs.uk
# Non-prod API URL (sandbox) (INT environment: https://int.api.service.nhs.uk/comms)
- https://sandbox.api.service.nhs.uk
Value: !Ref NotifyAPIBaseURLValue

EnableNotificationsExternal:
Type: AWS::SSM::Parameter
Expand All @@ -104,7 +88,7 @@ Resources:
Description: "Toggle on or off if we make real requests to the NHS notify service"
Type: String
Value: !Ref EnableNotificationsExternalValue

EnableNotificationsInternal:
Type: AWS::SSM::Parameter
Properties:
Expand Down