Add shipping service
This commit is contained in:
@@ -38,6 +38,10 @@ Parameters:
|
|||||||
Type: String
|
Type: String
|
||||||
Default: mysql
|
Default: mysql
|
||||||
Description: The cart service name
|
Description: The cart service name
|
||||||
|
ShippingServiceName:
|
||||||
|
Type: String
|
||||||
|
Default: shipping
|
||||||
|
Description: The cart service name
|
||||||
ImageUrl:
|
ImageUrl:
|
||||||
Type: String
|
Type: String
|
||||||
Default: nginx
|
Default: nginx
|
||||||
@@ -75,6 +79,10 @@ Parameters:
|
|||||||
Type: Number
|
Type: Number
|
||||||
Default: 3306
|
Default: 3306
|
||||||
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
|
||||||
|
ShippingContainerPort:
|
||||||
|
Type: Number
|
||||||
|
Default: 8080
|
||||||
|
Description: What port number the application inside the docker container is binding to
|
||||||
ContainerCpu:
|
ContainerCpu:
|
||||||
Type: Number
|
Type: Number
|
||||||
Default: 256
|
Default: 256
|
||||||
@@ -340,6 +348,39 @@ Resources:
|
|||||||
DesiredCount: 1
|
DesiredCount: 1
|
||||||
TaskDefinition: !Ref 'MySqlTaskDefinition'
|
TaskDefinition: !Ref 'MySqlTaskDefinition'
|
||||||
|
|
||||||
|
# shipping service
|
||||||
|
ShippingTaskDefinition:
|
||||||
|
Type: AWS::ECS::TaskDefinition
|
||||||
|
DependsOn: ['MySqlService']
|
||||||
|
Properties:
|
||||||
|
Family: !Ref 'ShippingServiceName'
|
||||||
|
Cpu: !Ref 'ContainerCpu'
|
||||||
|
Memory: !Ref 'ContainerMemory'
|
||||||
|
TaskRoleArn:
|
||||||
|
Fn::If:
|
||||||
|
- 'HasCustomRole'
|
||||||
|
- !Ref 'Role'
|
||||||
|
- !Ref "AWS::NoValue"
|
||||||
|
ContainerDefinitions:
|
||||||
|
- Name: !Ref 'ShippingServiceName'
|
||||||
|
Cpu: !Ref 'ContainerCpu'
|
||||||
|
Memory: !Ref 'ContainerMemory'
|
||||||
|
Image: robotshop/rs-shipping
|
||||||
|
PortMappings:
|
||||||
|
- ContainerPort: !Ref 'ShippingContainerPort'
|
||||||
|
LogConfiguration:
|
||||||
|
LogDriver: json-file
|
||||||
|
ShippingService:
|
||||||
|
Type: AWS::ECS::Service
|
||||||
|
DependsOn: LoadBalancerRule
|
||||||
|
Properties:
|
||||||
|
ServiceName: !Ref 'ShippingServiceName'
|
||||||
|
Cluster:
|
||||||
|
Fn::ImportValue:
|
||||||
|
!Join [':', [!Ref 'StackName', 'ClusterName']]
|
||||||
|
DesiredCount: 1
|
||||||
|
TaskDefinition: !Ref 'ShippingTaskDefinition'
|
||||||
|
|
||||||
WebTaskDefinition:
|
WebTaskDefinition:
|
||||||
Type: AWS::ECS::TaskDefinition
|
Type: AWS::ECS::TaskDefinition
|
||||||
Properties:
|
Properties:
|
||||||
|
Reference in New Issue
Block a user