Skip to content

Commit 2363277

Browse files
author
Erik
committed
Push environment variables from the config file into the actual environment when calling invoke
1 parent 51782e9 commit 2363277

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

aws_lambda/aws_lambda.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ def invoke(src, alt_event=None, verbose=False):
110110
path_to_config_file = os.path.join(src, 'config.yaml')
111111
cfg = read(path_to_config_file, loader=yaml.load)
112112

113+
# Load environment variables from the config file into the actual environment.
114+
for key, value in cfg.get('environment_variables').items():
115+
os.environ[key] = value
116+
113117
# Load and parse event file.
114118
if alt_event:
115119
path_to_event_file = os.path.join(src, alt_event)

0 commit comments

Comments
 (0)