Add payment service

This commit is contained in:
Cedric Ziel
2020-05-11 15:51:35 +02:00
parent a9206d7479
commit f97fa7a455

View File

@@ -46,6 +46,10 @@ Parameters:
Type: String
Default: ratings
Description: The cart service name
PaymentServiceName:
Type: String
Default: payment
Description: The payment service name
ImageUrl:
Type: String
Default: nginx
@@ -91,6 +95,10 @@ Parameters:
Type: Number
Default: 80
Description: What port number the application inside the docker container is binding to
PaymentContainerPort:
Type: Number
Default: 8080
Description: What port number the application inside the docker container is binding to
ContainerCpu:
Type: Number
Default: 256
@@ -422,6 +430,39 @@ Resources:
DesiredCount: 1
TaskDefinition: !Ref 'RatingsTaskDefinition'
# payment service
PaymentTaskDefinition:
Type: AWS::ECS::TaskDefinition
DependsOn: ['RabbitMqService']
Properties:
Family: !Ref 'PaymentServiceName'
Cpu: !Ref 'ContainerCpu'
Memory: !Ref 'ContainerMemory'
TaskRoleArn:
Fn::If:
- 'HasCustomRole'
- !Ref 'Role'
- !Ref "AWS::NoValue"
ContainerDefinitions:
- Name: !Ref 'PaymentServiceName'
Cpu: !Ref 'ContainerCpu'
Memory: !Ref 'ContainerMemory'
Image: robotshop/rs-payment
PortMappings:
- ContainerPort: !Ref 'PaymentContainerPort'
LogConfiguration:
LogDriver: json-file
PaymentService:
Type: AWS::ECS::Service
DependsOn: LoadBalancerRule
Properties:
ServiceName: !Ref 'PaymentServiceName'
Cluster:
Fn::ImportValue:
!Join [':', [!Ref 'StackName', 'ClusterName']]
DesiredCount: 1
TaskDefinition: !Ref 'PaymentTaskDefinition'
WebTaskDefinition:
Type: AWS::ECS::TaskDefinition
Properties: