当我以cloudformation更新堆栈以进行任务定义时,它将注销当前的活动任务定义,并且一次仅存在一个活动任务定义。
下面是代码:
AWSTemplateFormatVersion: 2010-09-09
Resources:
TaskDefinition:
Type: AWS::ECS::TaskDefinition
Properties:
RequiresCompatibilities:
- FARGATE
NetworkMode: awsvpc
Cpu: 1024
ExecutionRoleArn: "arn:aws:iam::XXXXXXXXXXXX:role/ecsTaskExecutionRole"
Family: 'server1'
Memory: 2048
ContainerDefinitions:
-
Name: nginx-container
WorkingDirectory: '/var'
Cpu: 256
Memory: 512
Essential: true
Image: Nginx
PortMappings:
- ContainerPort: 80
LogConfiguration:
LogDriver: awslogs
Options:
awslogs-group: sks-nginx
awslogs-region: us-west-2
awslogs-stream-prefix: nginx-stream
先前的任务定义变为非活动状态,如何阻止先前的任务定义变为非活动状态。