From 35019564e43bed2c5e84b4221cd9866fc0ffd241 Mon Sep 17 00:00:00 2001 From: Nicolas De Loof Date: Thu, 6 Aug 2020 10:22:55 +0200 Subject: [PATCH] Configure Deployment controller Signed-off-by: Nicolas De Loof --- ecs/pkg/amazon/backend/cloudformation.go | 12 +++++++++-- .../simple-cloudformation-conversion.golden | 21 +++++++------------ 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/ecs/pkg/amazon/backend/cloudformation.go b/ecs/pkg/amazon/backend/cloudformation.go index 2c6d4bc5f..74602318d 100644 --- a/ecs/pkg/amazon/backend/cloudformation.go +++ b/ecs/pkg/amazon/backend/cloudformation.go @@ -163,12 +163,20 @@ func (b Backend) Convert(project *types.Project) (*cloudformation.Template, erro for _, dependency := range service.DependsOn { dependsOn = append(dependsOn, serviceResourceName(dependency)) } + template.Resources[serviceResourceName(service.Name)] = &ecs.Service{ AWSCloudFormationDependsOn: dependsOn, Cluster: cluster, DesiredCount: desiredCount, - LaunchType: ecsapi.LaunchTypeFargate, - LoadBalancers: serviceLB, + DeploymentController: &ecs.Service_DeploymentController{ + Type: ecsapi.DeploymentControllerTypeEcs, + }, + DeploymentConfiguration: &ecs.Service_DeploymentConfiguration{ + MaximumPercent: 200, + MinimumHealthyPercent: 100, + }, + LaunchType: ecsapi.LaunchTypeFargate, + LoadBalancers: serviceLB, NetworkConfiguration: &ecs.Service_NetworkConfiguration{ AwsvpcConfiguration: &ecs.Service_AwsVpcConfiguration{ AssignPublicIp: ecsapi.AssignPublicIpEnabled, diff --git a/ecs/pkg/amazon/backend/testdata/simple/simple-cloudformation-conversion.golden b/ecs/pkg/amazon/backend/testdata/simple/simple-cloudformation-conversion.golden index c941d5fef..c61fc6498 100644 --- a/ecs/pkg/amazon/backend/testdata/simple/simple-cloudformation-conversion.golden +++ b/ecs/pkg/amazon/backend/testdata/simple/simple-cloudformation-conversion.golden @@ -87,6 +87,13 @@ } ] }, + "DeploymentConfiguration": { + "MaximumPercent": 200, + "MinimumHealthyPercent": 100 + }, + "DeploymentController": { + "Type": "ECS" + }, "DesiredCount": 1, "LaunchType": "FARGATE", "LoadBalancers": [ @@ -220,10 +227,6 @@ "Properties": { "ContainerDefinitions": [ { - "DockerLabels": { - "com.docker.compose.project": "TestSimpleConvert", - "com.docker.compose.service": "simple" - }, "Environment": [ { "Name": "LOCALDOMAIN", @@ -275,16 +278,6 @@ "NetworkMode": "awsvpc", "RequiresCompatibilities": [ "FARGATE" - ], - "Tags": [ - { - "Key": "com.docker.compose.project", - "Value": "TestSimpleConvert" - }, - { - "Key": "com.docker.compose.service", - "Value": "simple" - } ] }, "Type": "AWS::ECS::TaskDefinition"