在AWS :: ECS :: TaskDefinition中为awslogs添加标签

时间:2018-08-19 10:37:33

标签: amazon-cloudformation amazon-cloudwatch amazon-ecs aws-fargate

我想在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

0 个答案:

没有答案