Skip to content

Commit

Permalink
add new variable to determen the aws api requests limit
Browse files Browse the repository at this point in the history
  • Loading branch information
guyrenny committed Jul 1, 2024
1 parent 869c52c commit 130b0a7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lambda-manager/lambda_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from botocore.config import Config

config = Config(
retries = {
'max_attempts': 10,
retries = {
'max_attempts': int(os.environ.get('AWS_API_REUESTS_LIMIT', 10)),
'mode': 'standard'
}
)
Expand Down
6 changes: 6 additions & 0 deletions src/lambda-manager/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ Parameters:
Type: String
Description: instead creating one permission for each log group in the destination lambda, the code will take the prefix that you set in the parameter and create 1 permission for all of the log groups that match the prefix
Default: ""
AWSApiRequestsLimit:
Type: Number
Description: In case you got an error in the lambda which is related to ThrottlingException, then you can increase the limit of the requests that the lambda can do to the AWS API.
Default: 10
FunctionMemorySize:
Type: Number
Description: Lambda function memory limit
Expand Down Expand Up @@ -138,6 +142,8 @@ Resources:
Ref: ScanOldLogGroups
LOG_GROUP_PERMISSION_PREFIX:
Ref: LogGroupPermissionPreFix
AWS_API_REUESTS_LIMIT:
Ref: AWSApiRequestsLimit
Policies:
- Statement:
- Sid: CXLambdaUpdateConfig
Expand Down

0 comments on commit 130b0a7

Please sign in to comment.