Skip to content

Commit 18c65f8

Browse files
committed
fix for checkov errors; added DLQ and concurrency
1 parent 09ae608 commit 18c65f8

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

aws_sra_examples/solutions/genai/bedrock_org/templates/sra-bedrock-org-main.yaml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,14 @@ Resources:
412412
Action:
413413
- 'sts:AssumeRole'
414414
Policies:
415+
- PolicyName: !Sub '${pSRASolutionName}-DLQAccess'
416+
PolicyDocument:
417+
Version: "2012-10-17"
418+
Statement:
419+
- Effect: Allow
420+
Action:
421+
- sqs:SendMessage
422+
Resource: !GetAtt rBedrockOrgDLQ.Arn
415423
- PolicyDocument:
416424
Version: '2012-10-17'
417425
Statement:
@@ -615,6 +623,11 @@ Resources:
615623

616624
rBedrockOrgLambdaFunction:
617625
Type: AWS::Lambda::Function
626+
Metadata:
627+
checkov:
628+
skip:
629+
- id: CKV_AWS_117
630+
comment: "This Lambda does not require VPC access as it only interacts with public AWS services."
618631
Properties:
619632
FunctionName: !Ref pSRASolutionName
620633
Runtime: python3.12
@@ -628,7 +641,10 @@ Resources:
628641
S3Key: !Sub ${pSRASolutionName}/lambda_code/${pSRASolutionName}.zip
629642
Timeout: 900
630643
MemorySize: 512
631-
644+
ReservedConcurrentExecutions: 10
645+
DeadLetterConfig:
646+
TargetArn: !GetAtt rBedrockOrgDLQ.Arn
647+
632648
rBedrockOrgLambdaCustomResource:
633649
Type: Custom::LambdaCustomResource
634650
Properties:
@@ -667,6 +683,16 @@ Resources:
667683
Principal: cloudformation.amazonaws.com
668684
SourceArn: !Sub 'arn:${AWS::Partition}:cloudformation:${AWS::Region}:${AWS::AccountId}:stackSet/${AWS::StackName}/*'
669685

686+
rBedrockOrgDLQ:
687+
Type: AWS::SQS::Queue
688+
DeletionPolicy: Delete
689+
UpdateReplacePolicy: Delete
690+
Properties:
691+
QueueName: !Sub "${pSRASolutionName}-DLQ"
692+
KmsMasterKeyId: alias/aws/sqs
693+
MessageRetentionPeriod: 1209600 # 14 days
694+
695+
670696
Outputs:
671697
BedrockOrgLambdaFunctionArn:
672698
Description: ARN of the Lambda function

0 commit comments

Comments
 (0)