From d08a52a30cbbdc81f01220e68c746b60b05282ee Mon Sep 17 00:00:00 2001 From: Ryan Causey Date: Mon, 15 Jun 2020 14:18:38 -0700 Subject: [PATCH] Allow customizing the boto client configuration --- zappa/cli.py | 4 +++- zappa/core.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/zappa/cli.py b/zappa/cli.py index 2820eacba..0fe561cf6 100755 --- a/zappa/cli.py +++ b/zappa/cli.py @@ -2104,6 +2104,7 @@ def load_settings(self, settings_file=None, session=None): self.xray_tracing = self.stage_config.get('xray_tracing', False) self.desired_role_arn = self.stage_config.get('role_arn') self.layers = self.stage_config.get('layers', None) + self.boto_client_config = self.stage_config.get('boto_client_config', {}) # Load ALB-related settings self.use_alb = self.stage_config.get('alb_enabled', False) @@ -2122,7 +2123,8 @@ def load_settings(self, settings_file=None, session=None): runtime=self.runtime, tags=self.tags, endpoint_urls=self.stage_config.get('aws_endpoint_urls',{}), - xray_tracing=self.xray_tracing + xray_tracing=self.xray_tracing, + boto_client_config=self.boto_client_config, ) for setting in CUSTOM_SETTINGS: diff --git a/zappa/core.py b/zappa/core.py index faa8779fb..198e63b61 100644 --- a/zappa/core.py +++ b/zappa/core.py @@ -250,7 +250,8 @@ def __init__(self, runtime='python3.6', # Detected at runtime in CLI tags=(), endpoint_urls={}, - xray_tracing=False + xray_tracing=False, + boto_client_config={}, ): """ Instantiate this new Zappa instance, loading any custom credentials if necessary. @@ -300,6 +301,7 @@ def __init__(self, 'connect_timeout': 5, 'read_timeout': 300 } + long_config_dict.update(boto_client_config) long_config = botocore.client.Config(**long_config_dict) if load_credentials: