Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow customizing the boto client configuration #2121

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion zappa/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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:
Expand Down
4 changes: 3 additions & 1 deletion zappa/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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:
Expand Down