Skip to content

Commit

Permalink
Add to dlq test permission to access S3 bucket, fix permission to pri…
Browse files Browse the repository at this point in the history
…vatelink
  • Loading branch information
guyrenny committed Nov 13, 2024
1 parent 17451e6 commit a66530c
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,7 @@ Resources:
PolicyDocument:
Version: "2012-10-17"
Statement:

# Create and write to log group for the lambda logs
- Effect: Allow
Action:
Expand All @@ -613,7 +614,16 @@ Resources:
- 'logs:PutLogEvents'
Resource: !Sub 'arn:aws:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/lambda/*'

# Assume Role Policy
# use privateLink
- !If
- IsPrivateLink
- Effect: Allow
Action:
- "EC2:CreateNetworkInterface"
Resource: "*"
- !Ref AWS::NoValue

# Assume Role Policy
- !If
- IsLambdaAssumeRoleEnable
- Effect: Allow
Expand Down Expand Up @@ -727,6 +737,17 @@ Resources:
- 'sqs:DeleteMessage'
Resource: !GetAtt DeadLetterQueue.Arn
- !Ref AWS::NoValue
- Effect: Allow
Action:
- 's3:PutObject'
- 's3:PutObjectAcl'
- 's3:AbortMultipartUpload'
- 's3:DeleteObject'
- 's3:PutObjectTagging'
- 's3:PutObjectVersionTagging'
Resource:
- !Sub arn:aws:s3:::${DLQS3Bucket}
- !Sub arn:aws:s3:::${DLQS3Bucket}/*

WaitAfterRoleUpdate:
Type: Custom::Waiter
Expand Down Expand Up @@ -966,7 +987,6 @@ Resources:
SamResourceId: ConfigureLambda

LambdaLogGroup:
DependsOn: CustomResourceFunction
DeletionPolicy: Retain
UpdateReplacePolicy: Retain
Type: 'AWS::Logs::LogGroup'
Expand Down

0 comments on commit a66530c

Please sign in to comment.