Skip to content

Commit ea8cbdc

Browse files
author
Cream Crumpets
authored
Strong cast environment variables to type string
If an environment variable is added to the config, which is just a number, it is decoded from YAML into an int which causes a botocore.exceptions.ParamValidationError Here is the relevant part of the stack trace: botocore/validate.py", line 291, in serialize_to_request raise ParamValidationError(report=report.generate_report()) botocore.exceptions.ParamValidationError: Parameter validation failed: Invalid type for parameter Environment.Variables.lowThreshold, value: 5, type: <class 'int'>, valid types: <class 'str'>
1 parent 1a089de commit ea8cbdc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

aws_lambda/aws_lambda.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ def update_function(cfg, path_to_zip_file, *use_s3, **s3_file):
585585
kwargs.update(
586586
Environment={
587587
'Variables': {
588-
key: get_environment_variable_value(value)
588+
key: str(get_environment_variable_value(value))
589589
for key, value
590590
in cfg.get('environment_variables').items()
591591
},

0 commit comments

Comments
 (0)