Skip to content

Commit dd2617a

Browse files
authored
Chore: [AEA-3831] - Add lambda execution policy (#70)
## Summary - Routine Change ### Details - Adds a lambda execution policy for the FHIR Validator
1 parent 2e83350 commit dd2617a

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

SAMtemplates/lambda_resources.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ Parameters:
2525
LambdaName:
2626
Type: String
2727
Description: Name of lambda we are creating for
28+
LambdaArn:
29+
Type: String
30+
Description: Arn of lambda we are creating resources for.
31+
Default: none
2832
LogRetentionDays:
2933
Type: Number
3034
Description: How long to keep logs for
@@ -58,6 +62,18 @@ Conditions:
5862
ShouldUseSplunk: !Equals [true, !Ref EnableSplunk]
5963

6064
Resources:
65+
ExecuteLambdaManagedPolicy:
66+
Type: AWS::IAM::ManagedPolicy
67+
Properties:
68+
PolicyDocument:
69+
Version: 2012-10-17
70+
Statement:
71+
- Effect: Allow
72+
Action:
73+
- lambda:InvokeFunction
74+
Resource:
75+
- !Sub ${LambdaArn}:*
76+
6177
LambdaRole:
6278
Type: "AWS::IAM::Role"
6379
Properties:
@@ -105,6 +121,11 @@ Resources:
105121
DestinationArn: !Ref SplunkDeliveryStream
106122

107123
Outputs:
124+
ExecuteLambdaPolicyArn:
125+
Description: Lambda execution policy arn
126+
Value: !GetAtt ExecuteLambdaManagedPolicy.PolicyArn
127+
Export:
128+
Name: !Join [":", [!Ref "AWS::StackName", "FHIRValidatorUKCoreExecuteLambdaPolicyArn"]]
108129
LambdaRoleArn:
109130
Description: "LambdaRole ARN"
110131
Value: !GetAtt LambdaRole.Arn

SAMtemplates/main_template.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ Resources:
4949
SplunkDeliveryStream: !ImportValue lambda-resources:SplunkDeliveryStream
5050
EnableSplunk: "true"
5151
LambdaName: !Sub "${AWS::StackName}-FHIRValidatorUKCore"
52+
LambdaArn: !Sub arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:${AWS::StackName}-FHIRValidatorUKCore
5253
LogRetentionDays: !Ref LogRetentionDays
5354

5455
FHIRValidatorUKCore:

0 commit comments

Comments
 (0)