lib/ufo/stack.rb in ufo-4.1.6 vs lib/ufo/stack.rb in ufo-4.1.7
- old
+ new
@@ -112,10 +112,11 @@
ElbTargetGroup: elb_target_group,
ElbEipIds: context.elb_eip_ids,
EcsDesiredCount: current_desired_count,
EcsTaskDefinition: task_definition_arn,
+ EcsSchedulingStrategy: scheduling_strategy,
}
hash[:EcsSecurityGroups] = network[:ecs_security_groups].join(',') if network[:ecs_security_groups]
hash[:ElbSecurityGroups] = network[:elb_security_groups].join(',') if network[:elb_security_groups]
@@ -136,10 +137,18 @@
stack: @stack,
))
end
memoize :context
+ def scheduling_strategy
+ strategy = @options[:scheduling_strategy] || context.scheduling_strategy
+ strategy.upcase
+ end
+
def current_desired_count
+ # Cannot set ECS desired count when is scheduling_strategy DAEMON
+ return '' if scheduling_strategy == "DAEMON"
+
info = Info.new(@service, @options)
service = info.service
if service
service.desired_count.to_s
else