Skip to content

Commit cd985da

Browse files
committed
Revert "add CloudFront app distribution support for the Dokku stack"
This reverts commit a26c081.
1 parent d0f9d78 commit cd985da

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

stack/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
else: # USE_GOVCLOUD and USE_EC2 both provide EC2 instances
2424
from . import instances # noqa: F401
2525

26-
# only non-GovCloud can have a CDN for the app server
27-
if os.environ.get('USE_GOVCLOUD') != 'on':
26+
# only non-GovCloud stacks with a load balancer can have a CDN for the app server
27+
if os.environ.get('USE_GOVCLOUD') != 'on' and os.environ.get('USE_DOKKU') != 'on':
2828
from . import cdn # noqa: F401
2929

3030
print(template.template.to_json())

stack/cdn.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@
2929
from .template import template
3030

3131
if os.getenv('USE_EB') == 'on':
32-
# if we're using EB, use the EB endpoint URL
3332
origin_domain_name = GetAtt("EBEnvironment", "EndpointURL")
34-
elif os.getenv('USE_DOKKU') == 'on':
35-
# if we're using Dokku, point the CloudFront distribution to the Elastic IP
36-
origin_domain_name = Ref("Eip")
37-
else:
38-
# otherwise, use the load balancer DNS name
33+
elif os.getenv('USE_DOKKU') != 'on':
34+
# only import load_balancer if it's needed (not supported by Dokku stack yet)
3935
from .load_balancer import load_balancer
4036
origin_domain_name = GetAtt(load_balancer, "DNSName")
37+
else:
38+
origin_domain_name = None
39+
app_distribution = None
40+
app_uses_cloudfront_condition = None
4141

4242
if origin_domain_name:
4343
app_uses_cloudfront = template.add_parameter(

stack/environment.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,12 @@
3434
else:
3535
es_domain = None
3636

37-
if os.getenv('USE_GOVCLOUD') != 'on':
38-
# GovCloud doesn't support CloudFront
37+
38+
if os.getenv('USE_GOVCLOUD') != 'on' and os.getenv('USE_EB') != 'on':
39+
# GovCloud doesn't support CloudFront, and with Elastic Beanstalk
40+
# attempting to add an environment variable pointing to to the distrubtion
41+
# creates a circular dependency (because it's not possible to create the
42+
# EB load balancer separately from the EB application itself)
3943
from .cdn import app_distribution, app_uses_cloudfront_condition
4044
else:
4145
app_distribution = None

0 commit comments

Comments
 (0)