Skip to content

Commit 8e8515f

Browse files
committed
Optionally create services with EKS
- RDS - Elasticsearch - Memcached - Redis all can be optionally created alongside an EKS cluster.
1 parent ebab460 commit 8e8515f

File tree

4 files changed

+29
-13
lines changed

4 files changed

+29
-13
lines changed

stack/__init__.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,17 @@
1414
from . import template
1515
from . import repository # noqa: F401
1616
from . import eks # noqa: F401
17+
from . import cache # noqa: F401
18+
from . import database # noqa: F401
19+
from . import logs # noqa: F401
20+
if not USE_GOVCLOUD:
21+
# make sure this isn't added to the template for GovCloud, as it's not
22+
# supported in this region
23+
from . import search # noqa: F401
24+
25+
if USE_NAT_GATEWAY:
26+
from . import bastion # noqa: F401
27+
1728
else:
1829
from . import sftp # noqa: F401
1930
from . import assets # noqa: F401
@@ -51,8 +62,8 @@
5162
print("# https://github.com/caktus/aws-web-stacks")
5263
print("# at %s" % datetime.datetime.now())
5364
print("# with parameters:")
54-
use_parms = sorted(parm for parm in os.environ.keys() if parm.startswith("USE_"))
55-
for parm in use_parms:
65+
parms_used = sorted(parm for parm in os.environ.keys() if parm.startswith("USE_") or parm == "DEFAULTS_FILE")
66+
for parm in parms_used:
5667
print("#\t%s = %s" % (parm, os.environ[parm]))
5768
print()
5869
print(template.template.to_yaml())

stack/eks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
[
9494
Output(
9595
"ClusterEndpoint",
96-
Description="The connection endpoint for the cluster API.",
96+
Description="The connection endpoint for the EKS cluster API.",
9797
Value=GetAtt(cluster, "Endpoint"),
9898
),
9999
]

stack/repository.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@
1717
repository = Repository(
1818
"ApplicationRepository",
1919
template=template,
20-
RepositoryName=Ref(AWS_STACK_NAME),
20+
# Do we need to specify a repository name? The stack name might not be
21+
# a valid repository name, and if we just leave it out, AWS will make one
22+
# up for us.
23+
#RepositoryName=Ref(AWS_STACK_NAME),
2124
# Allow all account users to manage images.
2225
RepositoryPolicyText=Policy(
2326
Version="2008-10-17",

stack/security_groups.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,17 @@
5959
SourceSecurityGroupId=Ref(load_balancer_security_group),
6060
))
6161

62-
if not USE_NAT_GATEWAY:
63-
# Allow direct administrator access via SSH.
64-
ingress_rules.append(SecurityGroupRule(
65-
IpProtocol="tcp",
66-
FromPort="22",
67-
ToPort="22",
68-
Description="Administrator SSH Access",
69-
CidrIp=administrator_ip_address,
70-
))
62+
if not USE_NAT_GATEWAY:
63+
# Allow direct administrator access via SSH.
64+
ingress_rules.append(SecurityGroupRule(
65+
IpProtocol="tcp",
66+
FromPort="22",
67+
ToPort="22",
68+
Description="Administrator SSH Access",
69+
CidrIp=administrator_ip_address,
70+
))
71+
else:
72+
ingress_rules = []
7173

7274
container_security_group = SecurityGroup(
7375
# NOTE: If creating an EKS cluster, eks.py will modify this security group.

0 commit comments

Comments
 (0)