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 { for _, dependency := range service.DependsOn {
dependsOn = append(dependsOn, serviceResourceName(dependency)) dependsOn = append(dependsOn, serviceResourceName(dependency))
} }
template.Resources[serviceResourceName(service.Name)] = &ecs.Service{ template.Resources[serviceResourceName(service.Name)] = &ecs.Service{
AWSCloudFormationDependsOn: dependsOn, AWSCloudFormationDependsOn: dependsOn,
Cluster: cluster, Cluster: cluster,
DesiredCount: desiredCount, DesiredCount: desiredCount,
LaunchType: ecsapi.LaunchTypeFargate, DeploymentController: &ecs.Service_DeploymentController{
LoadBalancers: serviceLB, Type: ecsapi.DeploymentControllerTypeEcs,
},
DeploymentConfiguration: &ecs.Service_DeploymentConfiguration{
MaximumPercent: 200,
MinimumHealthyPercent: 100,
},
LaunchType: ecsapi.LaunchTypeFargate,
LoadBalancers: serviceLB,
NetworkConfiguration: &ecs.Service_NetworkConfiguration{ NetworkConfiguration: &ecs.Service_NetworkConfiguration{
AwsvpcConfiguration: &ecs.Service_AwsVpcConfiguration{ AwsvpcConfiguration: &ecs.Service_AwsVpcConfiguration{
AssignPublicIp: ecsapi.AssignPublicIpEnabled, AssignPublicIp: ecsapi.AssignPublicIpEnabled,

View File

@ -87,6 +87,13 @@
} }
] ]
}, },
"DeploymentConfiguration": {
"MaximumPercent": 200,
"MinimumHealthyPercent": 100
},
"DeploymentController": {
"Type": "ECS"
},
"DesiredCount": 1, "DesiredCount": 1,
"LaunchType": "FARGATE", "LaunchType": "FARGATE",
"LoadBalancers": [ "LoadBalancers": [
@ -220,10 +227,6 @@
"Properties": { "Properties": {
"ContainerDefinitions": [ "ContainerDefinitions": [
{ {
"DockerLabels": {
"com.docker.compose.project": "TestSimpleConvert",
"com.docker.compose.service": "simple"
},
"Environment": [ "Environment": [
{ {
"Name": "LOCALDOMAIN", "Name": "LOCALDOMAIN",
@ -275,16 +278,6 @@
"NetworkMode": "awsvpc", "NetworkMode": "awsvpc",
"RequiresCompatibilities": [ "RequiresCompatibilities": [
"FARGATE" "FARGATE"
],
"Tags": [
{
"Key": "com.docker.compose.project",
"Value": "TestSimpleConvert"
},
{
"Key": "com.docker.compose.service",
"Value": "simple"
}
] ]
}, },
"Type": "AWS::ECS::TaskDefinition" "Type": "AWS::ECS::TaskDefinition"