Add cart service
This commit is contained in:
@@ -30,6 +30,10 @@ Parameters:
|
|||||||
Type: String
|
Type: String
|
||||||
Default: user
|
Default: user
|
||||||
Description: The user service name
|
Description: The user service name
|
||||||
|
CartServiceName:
|
||||||
|
Type: String
|
||||||
|
Default: cart
|
||||||
|
Description: The cart service name
|
||||||
ImageUrl:
|
ImageUrl:
|
||||||
Type: String
|
Type: String
|
||||||
Default: nginx
|
Default: nginx
|
||||||
@@ -59,6 +63,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
|
||||||
|
CartContainerPort:
|
||||||
|
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
|
||||||
@@ -255,6 +263,39 @@ Resources:
|
|||||||
DesiredCount: 1
|
DesiredCount: 1
|
||||||
TaskDefinition: !Ref 'UserTaskDefinition'
|
TaskDefinition: !Ref 'UserTaskDefinition'
|
||||||
|
|
||||||
|
# cart service
|
||||||
|
CartTaskDefinition:
|
||||||
|
Type: AWS::ECS::TaskDefinition
|
||||||
|
DependsOn: ['RedisService']
|
||||||
|
Properties:
|
||||||
|
Family: !Ref 'CartServiceName'
|
||||||
|
Cpu: !Ref 'ContainerCpu'
|
||||||
|
Memory: !Ref 'ContainerMemory'
|
||||||
|
TaskRoleArn:
|
||||||
|
Fn::If:
|
||||||
|
- 'HasCustomRole'
|
||||||
|
- !Ref 'Role'
|
||||||
|
- !Ref "AWS::NoValue"
|
||||||
|
ContainerDefinitions:
|
||||||
|
- Name: !Ref 'CartServiceName'
|
||||||
|
Cpu: !Ref 'ContainerCpu'
|
||||||
|
Memory: !Ref 'ContainerMemory'
|
||||||
|
Image: robotshop/rs-cart
|
||||||
|
PortMappings:
|
||||||
|
- ContainerPort: !Ref 'CartContainerPort'
|
||||||
|
LogConfiguration:
|
||||||
|
LogDriver: json-file
|
||||||
|
CartService:
|
||||||
|
Type: AWS::ECS::Service
|
||||||
|
DependsOn: LoadBalancerRule
|
||||||
|
Properties:
|
||||||
|
ServiceName: !Ref 'CartServiceName'
|
||||||
|
Cluster:
|
||||||
|
Fn::ImportValue:
|
||||||
|
!Join [':', [!Ref 'StackName', 'ClusterName']]
|
||||||
|
DesiredCount: 1
|
||||||
|
TaskDefinition: !Ref 'CartTaskDefinition'
|
||||||
|
|
||||||
WebTaskDefinition:
|
WebTaskDefinition:
|
||||||
Type: AWS::ECS::TaskDefinition
|
Type: AWS::ECS::TaskDefinition
|
||||||
Properties:
|
Properties:
|
||||||
|
Reference in New Issue
Block a user