I am trying to create a Task in AWS ECS that does not belong to a service. In other word, I am trying to create a Task directly under Cluster. In the AWS Console, this can be done from [ECS Cluster Page]->Task Tab->Create Task or by selecting "Application Type" as "Task" from [ECS Cluster Page]->Create Service. The created task will be displayed directly in the Task Tab of the Cluster Page, and the "Task Group" value of the Task will be displayed as "family:abcde..." (not "service:abcde...").
How can I do something equivalent to this using Cloudformation? I created a Stack like the one below using AWS::ECS::Service, but the Service and Task were created at the same time. I also couldn't find a property setting of AWS::ECS::Service equivalent to Application Type: Task in the AWS Console.
AWSTemplateFormatVersion: 2010-09-09
Resources:
ECSTaskDefinition:
Type: 'AWS::ECS::TaskDefinition'
Properties:
...
ECSService:
Type: 'AWS::ECS::Service'
Properties:
ServiceName: test-service
Cluster: test-cluster
DesiredCount: 1
CapacityProviderStrategy:
- Base: 0
Weight: 1
CapacityProvider: FARGATE_SPOT
NetworkConfiguration:
AwsvpcConfiguration:
AssignPublicIp: ENABLED
SecurityGroups:
- ...
Subnets:
- ...
TaskDefinition: !Ref ECSTaskDefinition