Skip to content

Commit 4f8f3fc

Browse files
committed
Add environment variable support
1 parent 4368cd1 commit 4f8f3fc

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

lambda_uploader/config.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
DEFAULT_PARAMS = {u'requirements': [], u'publish': False,
3030
u'alias': None, u'alias_description': None,
3131
u'ignore': [], u'extra_files': [], u'vpc': None,
32-
u's3_bucket': None, u's3_key': None, u'runtime': 'python2.7'}
32+
u's3_bucket': None, u's3_key': None, u'runtime': 'python2.7',
33+
u'variables': {}}
3334

3435

3536
class Config(object):

lambda_uploader/uploader.py

+4
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ def __init__(self, config, profile_name):
3838
returns the package version
3939
'''
4040
def upload_existing(self, pkg):
41+
environment = {'Variables': self._config.variables}
4142
self._validate_package_size(pkg.zip_file)
4243
with open(pkg.zip_file, "rb") as fil:
4344
zip_file = fil.read()
@@ -69,6 +70,7 @@ def upload_existing(self, pkg):
6970
Timeout=self._config.timeout,
7071
MemorySize=self._config.memory,
7172
VpcConfig=self._vpc_config,
73+
Environment=environment,
7274
)
7375
LOG.debug("AWS update_function_configuration response: %s"
7476
% response)
@@ -90,6 +92,7 @@ def upload_existing(self, pkg):
9092
returns the package version
9193
'''
9294
def upload_new(self, pkg):
95+
environment = {'Variables': self._config.variables}
9396
code = {}
9497
if self._config.s3_bucket:
9598
code = {'S3Bucket': self._config.s3_bucket,
@@ -113,6 +116,7 @@ def upload_new(self, pkg):
113116
MemorySize=self._config.memory,
114117
Publish=self._config.publish,
115118
VpcConfig=self._vpc_config,
119+
Environment=environment,
116120
)
117121
LOG.debug("AWS create_function response: %s" % response)
118122

setup.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
from setuptools import setup, find_packages
66

77
INSTALL_REQUIRES = [
8-
'boto3==1.4.0',
8+
'boto3>=1.4.1',
9+
'botocore>=1.4.76',
910
'virtualenv',
1011
]
1112

0 commit comments

Comments
 (0)