Skip to content

Commit

Permalink
Merge pull request #53 from cintiadrrezdy/master
Browse files Browse the repository at this point in the history
Allow empty launchtype (uses default capacity provider)
  • Loading branch information
Guslington authored Apr 14, 2020
2 parents ccce4e0 + fea17dd commit 4affa04
Show file tree
Hide file tree
Showing 2 changed files with 3 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 @@ -36,6 +36,7 @@
ComponentParam 'SubnetIds', type: 'CommaDelimitedList'
ComponentParam 'SecurityGroupBackplane'
ComponentParam 'EnableFargate', 'false'
ComponentParam 'DisableLaunchType', 'false'
end

task_definition.each do |task_def, task|
Expand Down
3 changes: 2 additions & 1 deletion ecs-service.cfndsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
if network_mode == 'awsvpc'
awsvpc_enabled = true
Condition('IsFargate', FnEquals(Ref('EnableFargate'), 'true'))
Condition('IsEmptyLaunchType', FnEquals(Ref('DisableLaunchType'), 'true'))
end

tags = []
Expand Down Expand Up @@ -464,7 +465,7 @@
ECS_Service('Service') do
DependsOn rule_names if rule_names.any?
if awsvpc_enabled
LaunchType FnIf('IsFargate', 'FARGATE', 'EC2')
LaunchType FnIf('IsEmptyLaunchType', Ref('AWS::NoValue'), FnIf('IsFargate', 'FARGATE', 'EC2'))
end
Cluster Ref("EcsCluster")
HealthCheckGracePeriodSeconds health_check_grace_period if !health_check_grace_period.nil?
Expand Down

0 comments on commit 4affa04

Please sign in to comment.