From 4e3c2e0cd5287c6f670487da077a4e5189076ec3 Mon Sep 17 00:00:00 2001 From: Ryan Causey Date: Mon, 15 Jun 2020 14:18:38 -0700 Subject: [PATCH] Backport of boto client configuration change to version 0.48.2 * Allow customizing the boto client configuration * Originally from https://github.com/Miserlou/Zappa/pull/2121 --- 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 ee68a29a5..690406940 100755 --- a/zappa/cli.py +++ b/zappa/cli.py @@ -2093,6 +2093,7 @@ def load_settings(self, settings_file=None, session=None): self.context_header_mappings = self.stage_config.get('context_header_mappings', {}) self.xray_tracing = self.stage_config.get('xray_tracing', False) self.desired_role_arn = self.stage_config.get('role_arn') + 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) @@ -2111,7 +2112,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 1f1f2934b..32b5d72d3 100644 --- a/zappa/core.py +++ b/zappa/core.py @@ -252,7 +252,8 @@ def __init__(self, runtime='python2.7', # 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. @@ -295,6 +296,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: