我想在LogConfiguration
中为AWS::ECS::TaskDefinition
添加标签。请在下面的ECS cloudformation片段中找到。
TaskDefinitionGreen:
Type: AWS::ECS::TaskDefinition
Properties:
Family: !Sub '${AWS::StackName}-${ServiceName}-${StageName}-${Branch}'
TaskRoleArn: !Ref MSRole
ContainerDefinitions:
- Name: !Sub '${ServiceName}-${StageName}-${Branch}-g'
Image: !Sub '${TagGreen}'
Essential: true
MemoryReservation: !Ref MemoryReservation
Memory: !Ref Memory
PortMappings:
- ContainerPort: 8080
Environment:
- Name: Tag
Value: !Ref TagGreen
- Name: AWS_REGION
Value: !Ref "AWS::Region"
- Name: Branch
Value: !Ref Branch
- Name: StageName
Value: !Ref StageName
- Name: SERVER_PORT
Value: 8080
LogConfiguration:
LogDriver: awslogs
Options:
awslogs-group: !Sub "${ServiceName}-${StageName}-${Branch}"
awslogs-region: !Ref AWS::Region
awslogs-create-group: true
awslogs-stream-prefix: green