diff --git a/ecs/pkg/amazon/cloudformation.go b/ecs/pkg/amazon/cloudformation.go index 9df247500..ebd948aff 100644 --- a/ecs/pkg/amazon/cloudformation.go +++ b/ecs/pkg/amazon/cloudformation.go @@ -167,9 +167,13 @@ func (c client) Convert(project *compose.Project) (*cloudformation.Template, err serviceSecurityGroups = append(serviceSecurityGroups, cloudformation.Ref(logicalName)) } + desiredCount := 1 + if service.Deploy != nil && service.Deploy.Replicas != nil { + desiredCount = int(*service.Deploy.Replicas) + } template.Resources[fmt.Sprintf("%sService", normalizeResourceName(service.Name))] = &ecs.Service{ Cluster: cluster, - DesiredCount: 1, + DesiredCount: desiredCount, LaunchType: ecsapi.LaunchTypeFargate, NetworkConfiguration: &ecs.Service_NetworkConfiguration{ AwsvpcConfiguration: &ecs.Service_AwsVpcConfiguration{ diff --git a/ecs/pkg/amazon/convert.go b/ecs/pkg/amazon/convert.go index 807f23ca5..5d74df29e 100644 --- a/ecs/pkg/amazon/convert.go +++ b/ecs/pkg/amazon/convert.go @@ -317,14 +317,10 @@ func getImage(image string) string { func getRepoCredentials(service types.ServiceConfig) *ecs.TaskDefinition_RepositoryCredentials { // extract registry and namespace string from image name - credential := "" for key, value := range service.Extras { if key == "x-aws-pull_credentials" { - credential = value.(string) + return &ecs.TaskDefinition_RepositoryCredentials{CredentialsParameter: value.(string)} } } - if credential != "" { - return &ecs.TaskDefinition_RepositoryCredentials{CredentialsParameter: credential} - } return nil }