Skip to content

Commit 2a812b9

Browse files
authored
Merge pull request caktus#97 from caktus/add-s3-to-eks
Add assets to EKS
2 parents e3e3599 + bcbc26e commit 2a812b9

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

CHANGELOG.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ Change Log
77

88
* Optionally create RDS, Redis, memcached, elasticsearch services when creating
99
an EKS cluster.
10+
* Include standard aws-web-stacks public and private asset buckets when using EKS.
11+
* Make AssetsCloudFrontCertArn empty by default so it's optional
12+
* Make SFTPUserRole and SFTPUserScopeDownPolicy key off use_sftp_condition
1013
* TBD
1114

1215

stack/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
USE_NAT_GATEWAY = os.environ.get("USE_NAT_GATEWAY") == "on"
1111

1212
if USE_EKS:
13+
from . import sftp # noqa: F401
14+
from . import assets # noqa: F401
1315
from . import vpc # noqa: F401
1416
from . import template
1517
from . import repository # noqa: F401

stack/assets.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@
298298
"region, and (3) you wish to serve static media over HTTPS, you must manually create an "
299299
"ACM certificate in the us-east-1 region and provide its ARN here.",
300300
Type="String",
301+
Default="",
301302
),
302303
group="Static Media",
303304
label="CloudFront SSL Certificate ARN",
@@ -435,6 +436,7 @@
435436
# This is for applying when adding users to the transfer server. It's not used directly in the stack creation,
436437
# other than adding it to IAM for later use.
437438
"SFTPUserScopeDownPolicy",
439+
Condition=use_sftp_condition,
438440
PolicyDocument=dict(
439441
Version="2012-10-17",
440442
Statement=If(
@@ -474,6 +476,7 @@
474476
# to be used later when adding users to the transfer server.
475477
"SFTPUserRole",
476478
template=template,
479+
Condition=use_sftp_condition,
477480
AssumeRolePolicyDocument=dict(
478481
Statement=[
479482
dict(

stack/containers.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@
55
from troposphere import Ref, iam
66

77
from stack import USE_DOKKU, USE_EB, USE_ECS, USE_EKS
8+
from stack.assets import assets_management_policy
9+
from stack.logs import logging_policy
810
from stack.template import template
911
from stack.utils import ParameterWithDefaults as Parameter
1012

11-
if not USE_EKS:
12-
from stack.assets import assets_management_policy
13-
from stack.logs import logging_policy
14-
1513
if not USE_DOKKU and not USE_EB:
1614
desired_container_instances = Ref(
1715
template.add_parameter(
@@ -52,10 +50,8 @@
5250
)
5351
)
5452

55-
if USE_EKS:
56-
container_policies = []
57-
else:
58-
container_policies = [assets_management_policy, logging_policy]
53+
container_policies = [assets_management_policy, logging_policy]
54+
5955
if USE_ECS:
6056
container_policies.extend(
6157
[

0 commit comments

Comments
 (0)