forked from caktus/aws-web-stacks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path__init__.py
71 lines (62 loc) · 2.38 KB
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import datetime
import os
USE_DOKKU = os.environ.get("USE_DOKKU") == "on"
USE_EB = os.environ.get("USE_EB") == "on"
USE_EC2 = os.environ.get("USE_EC2") == "on"
USE_ECS = os.environ.get("USE_ECS") == "on"
USE_EKS = os.environ.get("USE_EKS") == "on"
USE_GOVCLOUD = os.environ.get("USE_GOVCLOUD") == "on"
USE_NAT_GATEWAY = os.environ.get("USE_NAT_GATEWAY") == "on"
if USE_EKS:
from . import sftp # noqa: F401
from . import assets # noqa: F401
from . import vpc # noqa: F401
from . import template
from . import repository # noqa: F401
from . import eks # noqa: F401
from . import cache # noqa: F401
from . import database # noqa: F401
from . import logs # noqa: F401
if not USE_GOVCLOUD:
# make sure this isn't added to the template for GovCloud, as it's not
# supported in this region
from . import search # noqa: F401
if USE_NAT_GATEWAY:
from . import bastion # noqa: F401
else:
from . import sftp # noqa: F401
from . import assets # noqa: F401
from . import cache # noqa: F401
from . import database # noqa: F401
from . import logs # noqa: F401
from . import vpc # noqa: F401
from . import template
if not USE_GOVCLOUD:
# make sure this isn't added to the template for GovCloud, as it's not
# supported in this region
from . import search # noqa: F401
if USE_NAT_GATEWAY:
from . import bastion # noqa: F401
if USE_ECS:
from . import repository # noqa: F401
from . import ecs_cluster # noqa: F401
elif USE_EB:
from . import repository # noqa: F401
from . import eb # noqa: F401
elif USE_DOKKU:
from . import dokku # noqa: F401
elif USE_EC2 or USE_GOVCLOUD:
# USE_GOVCLOUD and USE_EC2 both provide EC2 instances
from . import instances # noqa: F401
# Must be last to tag all resources
from . import tags # noqa: F401
# Since we're outputting YAML, we can include comments
print("# This Cloudformation stack template was generated by")
print("# https://github.com/caktus/aws-web-stacks")
print("# at %s" % datetime.datetime.now())
print("# with parameters:")
parms_used = sorted(parm for parm in os.environ.keys() if parm.startswith("USE_") or parm == "DEFAULTS_FILE")
for parm in parms_used:
print("#\t%s = %s" % (parm, os.environ[parm]))
print()
print(template.template.to_yaml())