From 0a5d1bb5f9ec3f4aaf6607e26099d46af9f3f635 Mon Sep 17 00:00:00 2001 From: zac Date: Wed, 3 Apr 2019 11:11:36 +0200 Subject: [PATCH] Add support for SchedulingStrategy. --- ecs-service.cfndsl.rb | 5 +++-- ecs-service.config.yaml | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ecs-service.cfndsl.rb b/ecs-service.cfndsl.rb index 90a4a1e..dcb1a02 100644 --- a/ecs-service.cfndsl.rb +++ b/ecs-service.cfndsl.rb @@ -89,7 +89,7 @@ # add docker volumes if task.key?('mounts') task['mounts'].each do |mount| - if mount.is_a? String + if mount.is_a? String parts = mount.split(':',2) mount_points << { ContainerPath: FnSub(parts[0]), SourceVolume: FnSub(parts[1]), ReadOnly: (parts[2] == 'ro' ? true : false) } else @@ -132,7 +132,7 @@ # add docker volumes if defined?(volumes) volumes.each do |volume| - if volume.is_a? String + if volume.is_a? String parts = volume.split(':') object = { Name: FnSub(parts[0])} object.merge!({ Host: { SourcePath: FnSub(parts[1]) }}) if parts[1] @@ -328,6 +328,7 @@ MaximumPercent: Ref('MaximumPercent') }) TaskDefinition Ref('Task') + SchedulingStrategy scheduling_strategy if defined? scheduling_strategy if service_loadbalancer.any? Role Ref('Role') diff --git a/ecs-service.config.yaml b/ecs-service.config.yaml index f7876cd..27166ad 100644 --- a/ecs-service.config.yaml +++ b/ecs-service.config.yaml @@ -6,6 +6,7 @@ log_retention: 7 # network_mode: awsvpc # # health_check_grace_period: 60 +# scheduling_strategy: DAEMON # # cpu: 256 # memory: 256