Skip to content

Commit d08a52a

Browse files
author
Ryan Causey
committed
Allow customizing the boto client configuration
1 parent 93804a1 commit d08a52a

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

zappa/cli.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2104,6 +2104,7 @@ def load_settings(self, settings_file=None, session=None):
21042104
self.xray_tracing = self.stage_config.get('xray_tracing', False)
21052105
self.desired_role_arn = self.stage_config.get('role_arn')
21062106
self.layers = self.stage_config.get('layers', None)
2107+
self.boto_client_config = self.stage_config.get('boto_client_config', {})
21072108

21082109
# Load ALB-related settings
21092110
self.use_alb = self.stage_config.get('alb_enabled', False)
@@ -2122,7 +2123,8 @@ def load_settings(self, settings_file=None, session=None):
21222123
runtime=self.runtime,
21232124
tags=self.tags,
21242125
endpoint_urls=self.stage_config.get('aws_endpoint_urls',{}),
2125-
xray_tracing=self.xray_tracing
2126+
xray_tracing=self.xray_tracing,
2127+
boto_client_config=self.boto_client_config,
21262128
)
21272129

21282130
for setting in CUSTOM_SETTINGS:

zappa/core.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,8 @@ def __init__(self,
250250
runtime='python3.6', # Detected at runtime in CLI
251251
tags=(),
252252
endpoint_urls={},
253-
xray_tracing=False
253+
xray_tracing=False,
254+
boto_client_config={},
254255
):
255256
"""
256257
Instantiate this new Zappa instance, loading any custom credentials if necessary.
@@ -300,6 +301,7 @@ def __init__(self,
300301
'connect_timeout': 5,
301302
'read_timeout': 300
302303
}
304+
long_config_dict.update(boto_client_config)
303305
long_config = botocore.client.Config(**long_config_dict)
304306

305307
if load_credentials:

0 commit comments

Comments
 (0)