Skip to content

Commit 4e3c2e0

Browse files
author
Ryan Causey
committed
Backport of boto client configuration change to version 0.48.2
* Allow customizing the boto client configuration * Originally from Miserlou#2121
1 parent c46d464 commit 4e3c2e0

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

zappa/cli.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2093,6 +2093,7 @@ def load_settings(self, settings_file=None, session=None):
20932093
self.context_header_mappings = self.stage_config.get('context_header_mappings', {})
20942094
self.xray_tracing = self.stage_config.get('xray_tracing', False)
20952095
self.desired_role_arn = self.stage_config.get('role_arn')
2096+
self.boto_client_config = self.stage_config.get('boto_client_config', {})
20962097

20972098
# Load ALB-related settings
20982099
self.use_alb = self.stage_config.get('alb_enabled', False)
@@ -2111,7 +2112,8 @@ def load_settings(self, settings_file=None, session=None):
21112112
runtime=self.runtime,
21122113
tags=self.tags,
21132114
endpoint_urls=self.stage_config.get('aws_endpoint_urls',{}),
2114-
xray_tracing=self.xray_tracing
2115+
xray_tracing=self.xray_tracing,
2116+
boto_client_config=self.boto_client_config,
21152117
)
21162118

21172119
for setting in CUSTOM_SETTINGS:

zappa/core.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,8 @@ def __init__(self,
252252
runtime='python2.7', # Detected at runtime in CLI
253253
tags=(),
254254
endpoint_urls={},
255-
xray_tracing=False
255+
xray_tracing=False,
256+
boto_client_config={},
256257
):
257258
"""
258259
Instantiate this new Zappa instance, loading any custom credentials if necessary.
@@ -295,6 +296,7 @@ def __init__(self,
295296
'connect_timeout': 5,
296297
'read_timeout': 300
297298
}
299+
long_config_dict.update(boto_client_config)
298300
long_config = botocore.client.Config(**long_config_dict)
299301

300302
if load_credentials:

0 commit comments

Comments
 (0)