Configure Deployment controller

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
Nicolas De Loof 2020-08-06 10:22:55 +02:00
parent e7bc8081ba
commit 35019564e4
No known key found for this signature in database
GPG Key ID: 9858809D6F8F6E7E
2 changed files with 17 additions and 16 deletions

View File

@ -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,

View File

@ -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"