diff --git a/src/lambda-manager/lambda_function.py b/src/lambda-manager/lambda_function.py index 014ee96..94e9212 100644 --- a/src/lambda-manager/lambda_function.py +++ b/src/lambda-manager/lambda_function.py @@ -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' } ) diff --git a/src/lambda-manager/template.yaml b/src/lambda-manager/template.yaml index 126ca6d..d1f0845 100644 --- a/src/lambda-manager/template.yaml +++ b/src/lambda-manager/template.yaml @@ -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 @@ -138,6 +142,8 @@ Resources: Ref: ScanOldLogGroups LOG_GROUP_PERMISSION_PREFIX: Ref: LogGroupPermissionPreFix + AWS_API_REUESTS_LIMIT: + Ref: AWSApiRequestsLimit Policies: - Statement: - Sid: CXLambdaUpdateConfig