Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WORKFLOWS-42] Send tower container logs to Cloudwatch #60

Merged
merged 2 commits into from
Sep 9, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions templates/nextflow-ecs-task-definition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,17 @@ Parameters:
TowerConfigFileName:
Type: String
Description: Name of the tower config YAML file
AwslogsStreamPrefix:
Type: String
Description: Prefix used for CloudWatch log streams
Default: 'tower'
Resources:
TowerTaskLogGroup:
Type: AWS::Logs::LogGroup
Properties:
LogGroupName: '/aws/ecs/task/nf-tower'
RetentionInDays: 30

TowerTask:
Type: AWS::ECS::TaskDefinition
Properties:
Expand All @@ -134,6 +144,12 @@ Resources:
HostPort: 6379
Command:
- --appendonly yes
LogConfiguration:
LogDriver: awslogs
Options:
awslogs-region: !Sub '${AWS::Region}'
awslogs-group: !Ref TowerTaskLogGroup
awslogs-stream-prefix: !Ref AwslogsStreamPrefix
- Name: !Ref CronContainerName
Image: !Ref CronContainerImage
Memory: 2000
Expand Down Expand Up @@ -192,6 +208,12 @@ Resources:
- ContainerPath: !Ref EfsVolumeMountPath
ReadOnly: true
SourceVolume: !Ref EfsVolumeName
LogConfiguration:
LogDriver: awslogs
Options:
awslogs-region: !Sub '${AWS::Region}'
awslogs-group: !Ref TowerTaskLogGroup
awslogs-stream-prefix: !Ref AwslogsStreamPrefix
- Name: !Ref FrontendContainerName
Image: !Ref FrontendContainerImage
Memory: 2000
Expand All @@ -205,6 +227,12 @@ Resources:
DependsOn:
- ContainerName: !Ref BackendContainerName
Condition: START
LogConfiguration:
LogDriver: awslogs
Options:
awslogs-region: !Sub '${AWS::Region}'
awslogs-group: !Ref TowerTaskLogGroup
awslogs-stream-prefix: !Ref AwslogsStreamPrefix
- Name: !Ref BackendContainerName
Hostname: !Ref BackendContainerName
Memory: 2000
Expand Down Expand Up @@ -271,6 +299,12 @@ Resources:
- ContainerPath: !Ref EfsVolumeMountPath
ReadOnly: true
SourceVolume: !Ref EfsVolumeName
LogConfiguration:
LogDriver: awslogs
Options:
awslogs-region: !Sub '${AWS::Region}'
awslogs-group: !Ref TowerTaskLogGroup
awslogs-stream-prefix: !Ref AwslogsStreamPrefix

Outputs:

Expand Down