Skip to content

Commit

Permalink
Backport of boto client configuration change to version 0.48.2
Browse files Browse the repository at this point in the history
* Allow customizing the boto client configuration
* Originally from Miserlou#2121
  • Loading branch information
Ryan Causey committed Jun 15, 2020
1 parent c46d464 commit 4e3c2e0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion zappa/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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:
Expand Down
4 changes: 3 additions & 1 deletion zappa/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 4e3c2e0

Please sign in to comment.