Add mysql service
This commit is contained in:
@@ -34,6 +34,10 @@ Parameters:
|
|||||||
Type: String
|
Type: String
|
||||||
Default: cart
|
Default: cart
|
||||||
Description: The cart service name
|
Description: The cart service name
|
||||||
|
MySqlServiceName:
|
||||||
|
Type: String
|
||||||
|
Default: mysql
|
||||||
|
Description: The cart service name
|
||||||
ImageUrl:
|
ImageUrl:
|
||||||
Type: String
|
Type: String
|
||||||
Default: nginx
|
Default: nginx
|
||||||
@@ -67,6 +71,10 @@ Parameters:
|
|||||||
Type: Number
|
Type: Number
|
||||||
Default: 8080
|
Default: 8080
|
||||||
Description: What port number the application inside the docker container is binding to
|
Description: What port number the application inside the docker container is binding to
|
||||||
|
MySqlContainerPort:
|
||||||
|
Type: Number
|
||||||
|
Default: 3306
|
||||||
|
Description: What port number the application inside the docker container is binding to
|
||||||
ContainerCpu:
|
ContainerCpu:
|
||||||
Type: Number
|
Type: Number
|
||||||
Default: 256
|
Default: 256
|
||||||
@@ -296,6 +304,42 @@ Resources:
|
|||||||
DesiredCount: 1
|
DesiredCount: 1
|
||||||
TaskDefinition: !Ref 'CartTaskDefinition'
|
TaskDefinition: !Ref 'CartTaskDefinition'
|
||||||
|
|
||||||
|
# mysql service
|
||||||
|
MySqlTaskDefinition:
|
||||||
|
Type: AWS::ECS::TaskDefinition
|
||||||
|
Properties:
|
||||||
|
Family: !Ref 'MySqlServiceName'
|
||||||
|
Cpu: !Ref 'ContainerCpu'
|
||||||
|
Memory: !Ref 'ContainerMemory'
|
||||||
|
TaskRoleArn:
|
||||||
|
Fn::If:
|
||||||
|
- 'HasCustomRole'
|
||||||
|
- !Ref 'Role'
|
||||||
|
- !Ref "AWS::NoValue"
|
||||||
|
ContainerDefinitions:
|
||||||
|
- Name: !Ref 'MySqlServiceName'
|
||||||
|
Cpu: !Ref 'ContainerCpu'
|
||||||
|
Memory: !Ref 'ContainerMemory'
|
||||||
|
LinuxParameters:
|
||||||
|
Capabilities:
|
||||||
|
Add:
|
||||||
|
- NET_ADMIN
|
||||||
|
Image: robotshop/rs-mysql-db
|
||||||
|
PortMappings:
|
||||||
|
- ContainerPort: !Ref 'MySqlContainerPort'
|
||||||
|
LogConfiguration:
|
||||||
|
LogDriver: json-file
|
||||||
|
MySqlService:
|
||||||
|
Type: AWS::ECS::Service
|
||||||
|
DependsOn: LoadBalancerRule
|
||||||
|
Properties:
|
||||||
|
ServiceName: !Ref 'MySqlServiceName'
|
||||||
|
Cluster:
|
||||||
|
Fn::ImportValue:
|
||||||
|
!Join [':', [!Ref 'StackName', 'ClusterName']]
|
||||||
|
DesiredCount: 1
|
||||||
|
TaskDefinition: !Ref 'MySqlTaskDefinition'
|
||||||
|
|
||||||
WebTaskDefinition:
|
WebTaskDefinition:
|
||||||
Type: AWS::ECS::TaskDefinition
|
Type: AWS::ECS::TaskDefinition
|
||||||
Properties:
|
Properties:
|
||||||
|
Reference in New Issue
Block a user