Skip to content

Instantly share code, notes, and snippets.

@nathanpeck
Created February 7, 2018 16:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nathanpeck/975fe512cb33f26343c16c1bb0922baf to your computer and use it in GitHub Desktop.
Save nathanpeck/975fe512cb33f26343c16c1bb0922baf to your computer and use it in GitHub Desktop.
TaskDefinition:
Type: AWS::ECS::TaskDefinition
Properties:
Family: !Ref 'ServiceName'
Cpu: !Ref 'ContainerCpu'
Memory: !Ref 'ContainerMemory'
NetworkMode: awsvpc
RequiresCompatibilities:
- FARGATE
ExecutionRoleArn:
Fn::ImportValue:
!Join [':', [!Ref 'EnvironmentName', 'ECSTaskExecutionRole']]
ContainerDefinitions:
- Name: !Ref 'ServiceName'
Cpu: !Ref 'ContainerCpu'
Memory: !Ref 'ContainerMemory'
Image: !Ref 'ImageUrl'
Environment:
- Name: REDIS_ENDPOINT
Value:
Fn::ImportValue:
!Join [':', [!Ref 'EnvironmentName', 'RedisEndpoint']]
PortMappings:
- ContainerPort: !Ref 'ContainerPort'
LogConfiguration:
LogDriver: 'awslogs'
Options:
awslogs-group: !Join ['-', [!Ref 'EnvironmentName', 'service', !Ref 'ServiceName']]
awslogs-region: !Ref 'AWS::Region'
awslogs-stream-prefix: !Ref 'ServiceName'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment