Skip to content

Commit

Permalink
Merge pull request #56 from Samseppiol/master
Browse files Browse the repository at this point in the history
Add platform version for fargate efs, add extra hosts for containers hostfile
  • Loading branch information
Guslington authored Aug 13, 2020
2 parents d854f31 + 2222cca commit 6f24c44
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 1 deletion.
1 change: 1 addition & 0 deletions ecs-service.cfhighlander.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
ComponentParam 'SecurityGroupBackplane'
ComponentParam 'EnableFargate', 'false'
ComponentParam 'DisableLaunchType', 'false'
ComponentParam 'PlatformVersion', platform_version if defined? platform_version
end

task_definition.each do |task_def, task|
Expand Down
3 changes: 3 additions & 0 deletions ecs-service.cfndsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
task_def.merge!({ Ulimits: task['ulimits'] }) if task.has_key?('ulimits')



if !(task['env_vars'].nil?)
task['env_vars'].each do |name,value|
split_value = value.to_s.split(/\${|}/)
Expand Down Expand Up @@ -177,6 +178,7 @@
task_def.merge!({Privileged: task['privileged'] }) if task.key?('privileged')
task_def.merge!({User: task['user'] }) if task.key?('user')
task_def.merge!({DependsOn: depends_on }) if depends_on.length > 0
task_def.merge!({ ExtraHosts: task['extra_hosts'] }) if task.has_key?('extra_hosts')


if task.key?('secrets')
Expand Down Expand Up @@ -469,6 +471,7 @@
DependsOn rule_names if rule_names.any?
if awsvpc_enabled
LaunchType FnIf('IsEmptyLaunchType', Ref('AWS::NoValue'), FnIf('IsFargate', 'FARGATE', 'EC2'))
PlatformVersion Ref('PlatformVersion') if defined?(platform_version)
end
Cluster Ref("EcsCluster")
HealthCheckGracePeriodSeconds health_check_grace_period if !health_check_grace_period.nil?
Expand Down
16 changes: 16 additions & 0 deletions tests/extra_hosts.test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
test_metadata:
type: config
name: extra_hosts
description: testing host entries added to the containers hostfile

task_definition:
nginx:
repo: nginx
image: nginx
extra_hosts:
-
Hostname: example.com
IpAddress: 127.0.0.1
-
Hostname: example2.com
IpAddress: 127.0.0.2
2 changes: 2 additions & 0 deletions tests/fargate.test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ network_mode: awsvpc
cpu: 1024
memory: 2048

platform_version: '1.4.0'

task_definition:
nginx:
repo: nginx
Expand Down
6 changes: 5 additions & 1 deletion tests/volumes-ref.test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ volumes:
DockerVolumeConfiguration:
Driver: rexray/s3fs
Scope: shared

- Name:
Fn::Sub: ${EnvironmentName}-MyEFSMount
EFSVolumeConfiguration:
FilesystemId: fs-12345
RootDirectory: /my/desired/path

task_definition:
sftp:
Expand Down

0 comments on commit 6f24c44

Please sign in to comment.