simple-cloudformation-conversion.golden 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. AWSTemplateFormatVersion: 2010-09-09
  2. Resources:
  3. CloudMap:
  4. Properties:
  5. Description: Service Map for Docker Compose project TestSimpleConvert
  6. Name: TestSimpleConvert.local
  7. Vpc: vpc-123
  8. Type: AWS::ServiceDiscovery::PrivateDnsNamespace
  9. Cluster:
  10. Properties:
  11. ClusterName: TestSimpleConvert
  12. Tags:
  13. - Key: com.docker.compose.project
  14. Value: TestSimpleConvert
  15. Type: AWS::ECS::Cluster
  16. Default80Ingress:
  17. Properties:
  18. CidrIp: 0.0.0.0/0
  19. Description: simple:80/tcp on default network
  20. FromPort: 80
  21. GroupId:
  22. Ref: DefaultNetwork
  23. IpProtocol: TCP
  24. ToPort: 80
  25. Type: AWS::EC2::SecurityGroupIngress
  26. DefaultNetwork:
  27. Properties:
  28. GroupDescription: TestSimpleConvert Security Group for default network
  29. Tags:
  30. - Key: com.docker.compose.project
  31. Value: TestSimpleConvert
  32. - Key: com.docker.compose.network
  33. Value: TestSimpleConvert_default
  34. VpcId: vpc-123
  35. Type: AWS::EC2::SecurityGroup
  36. DefaultNetworkIngress:
  37. Properties:
  38. Description: Allow communication within network default
  39. GroupId:
  40. Ref: DefaultNetwork
  41. IpProtocol: "-1"
  42. SourceSecurityGroupId:
  43. Ref: DefaultNetwork
  44. Type: AWS::EC2::SecurityGroupIngress
  45. LoadBalancer:
  46. Properties:
  47. Scheme: internet-facing
  48. SecurityGroups:
  49. - Ref: DefaultNetwork
  50. Subnets:
  51. - subnet1
  52. - subnet2
  53. Tags:
  54. - Key: com.docker.compose.project
  55. Value: TestSimpleConvert
  56. Type: application
  57. Type: AWS::ElasticLoadBalancingV2::LoadBalancer
  58. LogGroup:
  59. Properties:
  60. LogGroupName: /docker-compose/TestSimpleConvert
  61. Type: AWS::Logs::LogGroup
  62. SimpleService:
  63. DependsOn:
  64. - SimpleTCP80Listener
  65. Properties:
  66. Cluster:
  67. Fn::GetAtt:
  68. - Cluster
  69. - Arn
  70. DeploymentConfiguration:
  71. MaximumPercent: 200
  72. MinimumHealthyPercent: 100
  73. DeploymentController:
  74. Type: ECS
  75. DesiredCount: 1
  76. LaunchType: FARGATE
  77. LoadBalancers:
  78. - ContainerName: simple
  79. ContainerPort: 80
  80. TargetGroupArn:
  81. Ref: SimpleTCP80TargetGroup
  82. NetworkConfiguration:
  83. AwsvpcConfiguration:
  84. AssignPublicIp: ENABLED
  85. SecurityGroups:
  86. - Ref: DefaultNetwork
  87. Subnets:
  88. - subnet1
  89. - subnet2
  90. PlatformVersion: 1.4.0
  91. PropagateTags: SERVICE
  92. SchedulingStrategy: REPLICA
  93. ServiceRegistries:
  94. - RegistryArn:
  95. Fn::GetAtt:
  96. - SimpleServiceDiscoveryEntry
  97. - Arn
  98. Tags:
  99. - Key: com.docker.compose.project
  100. Value: TestSimpleConvert
  101. - Key: com.docker.compose.service
  102. Value: simple
  103. TaskDefinition:
  104. Ref: SimpleTaskDefinition
  105. Type: AWS::ECS::Service
  106. SimpleServiceDiscoveryEntry:
  107. Properties:
  108. Description: '"simple" service discovery entry in Cloud Map'
  109. DnsConfig:
  110. DnsRecords:
  111. - TTL: 60
  112. Type: A
  113. RoutingPolicy: MULTIVALUE
  114. HealthCheckCustomConfig:
  115. FailureThreshold: 1
  116. Name: simple
  117. NamespaceId:
  118. Ref: CloudMap
  119. Type: AWS::ServiceDiscovery::Service
  120. SimpleTCP80Listener:
  121. Properties:
  122. DefaultActions:
  123. - ForwardConfig:
  124. TargetGroups:
  125. - TargetGroupArn:
  126. Ref: SimpleTCP80TargetGroup
  127. Type: forward
  128. LoadBalancerArn:
  129. Ref: LoadBalancer
  130. Port: 80
  131. Protocol: HTTP
  132. Type: AWS::ElasticLoadBalancingV2::Listener
  133. SimpleTCP80TargetGroup:
  134. Properties:
  135. Port: 80
  136. Protocol: HTTP
  137. Tags:
  138. - Key: com.docker.compose.project
  139. Value: TestSimpleConvert
  140. TargetType: ip
  141. VpcId: vpc-123
  142. Type: AWS::ElasticLoadBalancingV2::TargetGroup
  143. SimpleTaskDefinition:
  144. Properties:
  145. ContainerDefinitions:
  146. - Command:
  147. - .compute.internal
  148. - TestSimpleConvert.local
  149. Essential: false
  150. Image: docker/ecs-searchdomain-sidecar:1.0
  151. LogConfiguration:
  152. LogDriver: awslogs
  153. Options:
  154. awslogs-group:
  155. Ref: LogGroup
  156. awslogs-region:
  157. Ref: AWS::Region
  158. awslogs-stream-prefix: TestSimpleConvert
  159. Name: Simple_ResolvConf_InitContainer
  160. - DependsOn:
  161. - Condition: SUCCESS
  162. ContainerName: Simple_ResolvConf_InitContainer
  163. Essential: true
  164. Image: nginx
  165. LinuxParameters: {}
  166. LogConfiguration:
  167. LogDriver: awslogs
  168. Options:
  169. awslogs-group:
  170. Ref: LogGroup
  171. awslogs-region:
  172. Ref: AWS::Region
  173. awslogs-stream-prefix: TestSimpleConvert
  174. Name: simple
  175. PortMappings:
  176. - ContainerPort: 80
  177. HostPort: 80
  178. Protocol: tcp
  179. Cpu: "256"
  180. ExecutionRoleArn:
  181. Ref: SimpleTaskExecutionRole
  182. Family: TestSimpleConvert-simple
  183. Memory: "512"
  184. NetworkMode: awsvpc
  185. RequiresCompatibilities:
  186. - FARGATE
  187. Type: AWS::ECS::TaskDefinition
  188. SimpleTaskExecutionRole:
  189. Properties:
  190. AssumeRolePolicyDocument:
  191. Statement:
  192. - Action:
  193. - sts:AssumeRole
  194. Condition: {}
  195. Effect: Allow
  196. Principal:
  197. Service: ecs-tasks.amazonaws.com
  198. Version: 2012-10-17
  199. ManagedPolicyArns:
  200. - arn:aws:iam::aws:policy/service-role/AmazonECSTaskExecutionRolePolicy
  201. - arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly
  202. Tags:
  203. - Key: com.docker.compose.project
  204. Value: TestSimpleConvert
  205. - Key: com.docker.compose.service
  206. Value: simple
  207. Type: AWS::IAM::Role