@@ -25,14 +25,18 @@ Parameters:
2525 Type : String
2626 Default : none
2727
28- # PrescriptionNotificationStatesTableName:
29- # Type: String
30- # Default: none
28+ PrescriptionNotificationStatesTableName :
29+ Type : String
30+ Default : none
3131
3232 NHSNotifyPrescriptionsSQSQueueUrl :
3333 Type : String
3434 Default : none
3535
36+ SQSSaltSecret :
37+ Type : String
38+ Default : none
39+
3640 EnabledSiteODSCodesParam :
3741 Type : AWS::SSM::Parameter::Value<String>
3842
@@ -41,7 +45,7 @@ Parameters:
4145
4246 BlockedSiteODSCodesParam :
4347 Type : AWS::SSM::Parameter::Value<String>
44-
48+
4549 LogLevel :
4650 Type : String
4751
@@ -69,17 +73,6 @@ Conditions:
6973 - !Ref DeployCheckPrescriptionStatusUpdate
7074
7175Resources :
72- SQSSaltSecret :
73- Type : AWS::SecretsManager::Secret
74- Properties :
75- Name : !Sub ${StackName}-SqsSalt
76- Description : Auto-generated salt for SQS_SALT
77- GenerateSecretString :
78- SecretStringTemplate : " {}"
79- GenerateStringKey : salt
80- PasswordLength : 32
81- ExcludePunctuation : true
82-
8376 UpdatePrescriptionStatus :
8477 Type : AWS::Serverless::Function
8578 Properties :
@@ -393,7 +386,7 @@ Resources:
393386 Variables :
394387 LOG_LEVEL : !Ref LogLevel
395388 NHS_NOTIFY_PRESCRIPTIONS_SQS_QUEUE_URL : !Ref NHSNotifyPrescriptionsSQSQueueUrl
396- # TABLE_NAME: !Ref PrescriptionNotificationStatesTableName
389+ TABLE_NAME : !Ref PrescriptionNotificationStatesTableName
397390 Events :
398391 ScheduleEvent :
399392 Type : ScheduleV2
@@ -436,9 +429,58 @@ Resources:
436429 - - Fn::ImportValue : !Sub ${StackName}-WriteNHSNotifyPrescriptionsSQSQueuePolicyArn
437430 - Fn::ImportValue : !Sub ${StackName}-ReadNHSNotifyPrescriptionsSQSQueuePolicyArn
438431 - Fn::ImportValue : !Sub ${StackName}-UseNotificationSQSQueueKMSKeyPolicyArn
439- # - Fn::ImportValue: !Sub ${StackName}:tables:${PrescriptionNotificationStatesTableName}:TableReadPolicyArn
440- # - Fn::ImportValue: !Sub ${StackName}:tables:${PrescriptionNotificationStatesTableName}:TableWritePolicyArn
441- # - Fn::ImportValue: !Sub ${StackName}:tables:UsePrescriptionNotificationStatesKMSKeyPolicyArn
432+ - Fn::ImportValue : !Sub ${StackName}:tables:${PrescriptionNotificationStatesTableName}:TableReadPolicyArn
433+ - Fn::ImportValue : !Sub ${StackName}:tables:${PrescriptionNotificationStatesTableName}:TableWritePolicyArn
434+ - Fn::ImportValue : !Sub ${StackName}:tables:UsePrescriptionNotificationStatesKMSKeyPolicyArn
435+
436+ NHSNotifyUpdateCallback :
437+ Type : AWS::Serverless::Function
438+ Properties :
439+ FunctionName : !Sub ${StackName}-NHSNotifyUpdateCallback
440+ CodeUri : ../../packages/
441+ Handler : lambdaHandler.handler
442+ Role : !GetAtt NHSNotifyUpdateCallbackResources.Outputs.LambdaRoleArn
443+ Environment :
444+ Variables :
445+ LOG_LEVEL : !Ref LogLevel
446+ TABLE_NAME : !Ref PrescriptionNotificationStatesTableName
447+ APP_NAME_SECRET : secrets-PSU-Notify-Application-Name
448+ API_KEY_SECRET : secrets-PSU-Notify-API-Key
449+ Metadata :
450+ BuildMethod : esbuild
451+ guard :
452+ SuppressedRules :
453+ - LAMBDA_DLQ_CHECK
454+ - LAMBDA_INSIDE_VPC
455+ - LAMBDA_CONCURRENCY_CHECK
456+ BuildProperties :
457+ Minify : true
458+ Target : es2020
459+ Sourcemap : true
460+ tsconfig : nhsNotifyUpdateCallback/tsconfig.json
461+ packages : bundle
462+ EntryPoints :
463+ - nhsNotifyUpdateCallback/src/lambdaHandler.ts
464+
465+ NHSNotifyUpdateCallbackResources :
466+ Type : AWS::Serverless::Application
467+ Properties :
468+ Location : lambda_resources.yaml
469+ Parameters :
470+ StackName : !Ref StackName
471+ LambdaName : !Sub ${StackName}-NHSNotifyUpdateCallback
472+ LambdaArn : !Sub arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:${StackName}-NHSNotifyUpdateCallback
473+ IncludeAdditionalPolicies : true
474+ AdditionalPolicies : !Join
475+ - " ,"
476+ - - Fn::ImportValue : !Sub ${StackName}:tables:${PrescriptionNotificationStatesTableName}:TableReadPolicyArn
477+ - Fn::ImportValue : !Sub ${StackName}:tables:${PrescriptionNotificationStatesTableName}:TableWritePolicyArn
478+ - Fn::ImportValue : !Sub ${StackName}:tables:UsePrescriptionNotificationStatesKMSKeyPolicyArn
479+ LogRetentionInDays : !Ref LogRetentionInDays
480+ CloudWatchKMSKeyId : !ImportValue account-resources:CloudwatchLogsKmsKeyArn
481+ EnableSplunk : !Ref EnableSplunk
482+ SplunkSubscriptionFilterRole : !ImportValue lambda-resources:SplunkSubscriptionFilterRole
483+ SplunkDeliveryStreamArn : !ImportValue lambda-resources:SplunkDeliveryStream
442484
443485Outputs :
444486 UpdatePrescriptionStatusFunctionName :
@@ -506,3 +548,11 @@ Outputs:
506548 NotifyProcessorFunctionArn :
507549 Description : The function ARN of the NHS Notify lambda
508550 Value : !GetAtt NotifyProcessor.Arn
551+
552+ NHSNotifyUpdateCallbackFunctionName :
553+ Description : The function name of the NHSNotifyUpdateCallback lambda
554+ Value : !Ref NHSNotifyUpdateCallback
555+
556+ NHSNotifyUpdateCallbackFunctionArn :
557+ Description : The function ARN of the NHSNotifyUpdateCallback lambda
558+ Value : !GetAtt NHSNotifyUpdateCallback.Arn
0 commit comments