From d4625ffa26a7cbd7aaa611a105241838cb31cf58 Mon Sep 17 00:00:00 2001 From: guyrenny Date: Wed, 13 Nov 2024 16:52:10 +0200 Subject: [PATCH] fix permissions in lambda policy --- template.yaml | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/template.yaml b/template.yaml index 5e6e11aa..f05b967e 100644 --- a/template.yaml +++ b/template.yaml @@ -619,7 +619,12 @@ Resources: - IsPrivateLink - Effect: Allow Action: - - "EC2:CreateNetworkInterface" + - 'ec2:CreateNetworkInterface' + - 'ec2:DescribeNetworkInterfaces' + - 'ec2:DescribeVpcs' + - 'ec2:DeleteNetworkInterface' + - 'ec2:DescribeSubnets' + - 'ec2:DescribeSecurityGroups' Resource: "*" - !Ref AWS::NoValue @@ -701,6 +706,19 @@ Resources: Resource: !Ref MSKClusterArn - !Ref AWS::NoValue + - !If + - UseMSK + - Effect: Allow + Action: + - 'ec2:CreateNetworkInterface' + - 'ec2:DescribeNetworkInterfaces' + - 'ec2:DescribeVpcs' + - 'ec2:DeleteNetworkInterface' + - 'ec2:DescribeSubnets' + - 'ec2:DescribeSecurityGroups' + Resource: "*" + - !Ref AWS::NoValue + # Secrets Manager Access - !If - ApiKeyIsArn @@ -733,10 +751,13 @@ Resources: Action: - 'sqs:SendMessage' - 'sqs:GetQueueAttributes' + - 'sqs:GetQueueUrl' - 'sqs:ReceiveMessage' - 'sqs:DeleteMessage' Resource: !GetAtt DeadLetterQueue.Arn - !Ref AWS::NoValue + - !If + - DLQEnabled - Effect: Allow Action: - 's3:PutObject' @@ -748,6 +769,7 @@ Resources: Resource: - !Sub arn:aws:s3:::${DLQS3Bucket} - !Sub arn:aws:s3:::${DLQS3Bucket}/* + - !Ref AWS::NoValue WaitAfterRoleUpdate: Type: Custom::Waiter