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

2123 Fix endpoint_url when use_apigateway is false #2124

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
30 changes: 13 additions & 17 deletions zappa/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1022,11 +1022,14 @@ def update(self, source_zip=None, no_upload=False):
# but we're also updating a few of the APIGW settings.
endpoint_url = self.deploy_api_gateway(api_id)

if self.stage_config.get('domain', None):
endpoint_url = self.stage_config.get('domain')
if self.domain:
endpoint_url = self.domain

else:
endpoint_url = None
if endpoint_url:
if self.base_path and not endpoint_url.endswith('/' + self.base_path):
endpoint_url += '/' + self.base_path
if endpoint_url and not endpoint_url.startswith('https://'):
endpoint_url = 'https://' + endpoint_url

self.schedule()

Expand All @@ -1036,17 +1039,13 @@ def update(self, source_zip=None, no_upload=False):

self.callback('post')

if endpoint_url and 'https://' not in endpoint_url:
endpoint_url = 'https://' + endpoint_url

if self.base_path:
endpoint_url += '/' + self.base_path

deployed_string = "Your updated Zappa deployment is " + click.style("live", fg='green', bold=True) + "!"
if self.use_apigateway:

if endpoint_url:
deployed_string = deployed_string + ": " + click.style("{}".format(endpoint_url), bold=True)

api_url = None
api_url = None
if self.use_apigateway:
if endpoint_url and 'amazonaws.com' not in endpoint_url:
api_url = self.zappa.get_api_url(
self.lambda_name,
Expand All @@ -1055,11 +1054,8 @@ def update(self, source_zip=None, no_upload=False):
if endpoint_url != api_url:
deployed_string = deployed_string + " (" + api_url + ")"

if self.stage_config.get('touch', True):
if api_url:
self.touch_endpoint(api_url)
elif endpoint_url:
self.touch_endpoint(endpoint_url)
if self.stage_config.get('touch', True) and (api_url or endpoint_url):
self.touch_endpoint(api_url or endpoint_url)

click.echo(deployed_string)

Expand Down