Created ECS service for auth task
This commit is contained in:
parent
9b1a6fa279
commit
9549c7f409
infrastructure/cloudformation/dt
49
infrastructure/cloudformation/dt/auth_task.yaml
Normal file
49
infrastructure/cloudformation/dt/auth_task.yaml
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
AWSTemplateFormatVersion: '2010-09-09'
|
||||||
|
Description: Defend Togeher ECS Task
|
||||||
|
Parameters:
|
||||||
|
LogGroupName:
|
||||||
|
Type: String
|
||||||
|
Description: The AWS CloudWatch log group to output logs to.
|
||||||
|
Default: "/ecs/dt"
|
||||||
|
|
||||||
|
environment:
|
||||||
|
Type: String
|
||||||
|
Description: Name of the environment to use in naming.
|
||||||
|
Default: production
|
||||||
|
|
||||||
|
DockerTag:
|
||||||
|
Description: Tag in DockerHub to deploy
|
||||||
|
Type: String
|
||||||
|
Default: "latest"
|
||||||
|
|
||||||
|
Resources:
|
||||||
|
|
||||||
|
LogGroup:
|
||||||
|
Type: AWS::Logs::LogGroup
|
||||||
|
Properties:
|
||||||
|
RetentionInDays: 7
|
||||||
|
LogGroupName: !Sub "${LogGroupName}-auth/${environment}"
|
||||||
|
|
||||||
|
TaskDefinition:
|
||||||
|
Type: AWS::ECS::TaskDefinition
|
||||||
|
Properties:
|
||||||
|
ContainerDefinitions:
|
||||||
|
- Name: defend-together-authorizer
|
||||||
|
Essential: 'true'
|
||||||
|
Image: !Sub "josephbmanley/defend-together-authorizer:${DockerTag}"
|
||||||
|
MemoryReservation: 250
|
||||||
|
PortMappings:
|
||||||
|
- HostPort: 7778
|
||||||
|
ContainerPort: 7778
|
||||||
|
Protocol: tcp
|
||||||
|
LogConfiguration:
|
||||||
|
LogDriver: awslogs
|
||||||
|
Options:
|
||||||
|
awslogs-region:
|
||||||
|
Ref: AWS::Region
|
||||||
|
awslogs-group:
|
||||||
|
Ref: LogGroup
|
||||||
|
Outputs:
|
||||||
|
TaskArn:
|
||||||
|
Description: ARN of the TaskDefinition
|
||||||
|
Value: !Ref TaskDefinition
|
@ -104,13 +104,15 @@ Resources:
|
|||||||
SubnetIds: !Join [",", !Split [" ", !Ref PublicSubnets]]
|
SubnetIds: !Join [",", !Split [" ", !Ref PublicSubnets]]
|
||||||
Project: "DT"
|
Project: "DT"
|
||||||
|
|
||||||
#-------------------
|
#----------------------
|
||||||
# ECS Task & Service
|
# ECS Tasks & Services
|
||||||
#-------------------
|
#----------------------
|
||||||
|
|
||||||
|
# Game Server
|
||||||
TaskDefinition:
|
TaskDefinition:
|
||||||
Type: AWS::CloudFormation::Stack
|
Type: AWS::CloudFormation::Stack
|
||||||
Properties:
|
Properties:
|
||||||
TemplateURL: !Sub 'https://s3.${AWS::Region}.amazonaws.com/sumu-stacks/dt/${release}/cloudformation/dt/task.yaml'
|
TemplateURL: !Sub 'https://s3.${AWS::Region}.amazonaws.com/sumu-stacks/dt/${release}/cloudformation/dt/sever_task.yaml'
|
||||||
Parameters:
|
Parameters:
|
||||||
environment: !Ref environment
|
environment: !Ref environment
|
||||||
LogGroupName: !Ref LogGroup
|
LogGroupName: !Ref LogGroup
|
||||||
@ -124,7 +126,21 @@ Resources:
|
|||||||
Cluster: !GetAtt EcsCluster.Outputs.Cluster
|
Cluster: !GetAtt EcsCluster.Outputs.Cluster
|
||||||
DesiredCount: 1
|
DesiredCount: 1
|
||||||
TaskDefinition: !GetAtt TaskDefinition.Outputs.TaskArn
|
TaskDefinition: !GetAtt TaskDefinition.Outputs.TaskArn
|
||||||
LoadBalancers:
|
|
||||||
- ContainerName: "defend-together"
|
# Auth Server
|
||||||
ContainerPort: 7777
|
AuthTaskDefinition:
|
||||||
TargetGroupArn: !GetAtt LoadBalancing.Outputs.TargetGroup
|
Type: AWS::CloudFormation::Stack
|
||||||
|
Properties:
|
||||||
|
TemplateURL: !Sub 'https://s3.${AWS::Region}.amazonaws.com/sumu-stacks/dt/${release}/cloudformation/dt/auth_task.yaml'
|
||||||
|
Parameters:
|
||||||
|
environment: !Ref environment
|
||||||
|
LogGroupName: !Ref LogGroup
|
||||||
|
DockerTag: !Ref DockerTag
|
||||||
|
RedisHostname: !GetAtt RedisCache.Outputs.Endpoint
|
||||||
|
|
||||||
|
AuthService:
|
||||||
|
Type: AWS::ECS::Service
|
||||||
|
Properties:
|
||||||
|
Cluster: !GetAtt EcsCluster.Outputs.Cluster
|
||||||
|
DesiredCount: 1
|
||||||
|
TaskDefinition: !GetAtt AuthTaskDefinition.Outputs.TaskArn
|
Reference in New Issue
Block a user