File tree Expand file tree Collapse file tree 3 files changed +14
-10
lines changed
Expand file tree Collapse file tree 3 files changed +14
-10
lines changed Original file line number Diff line number Diff line change 2323else : # 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
3030print (template .template .to_json ())
Original file line number Diff line number Diff line change 2929from .template import template
3030
3131if 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
4242if origin_domain_name :
4343 app_uses_cloudfront = template .add_parameter (
Original file line number Diff line number Diff line change 3434else :
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
4044else :
4145 app_distribution = None
You can’t perform that action at this time.
0 commit comments