simple-cloudformation-conversion.golden 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  1. {
  2. "AWSTemplateFormatVersion": "2010-09-09",
  3. "Resources": {
  4. "CloudMap": {
  5. "Properties": {
  6. "Description": "Service Map for Docker Compose project TestSimpleConvert",
  7. "Name": "TestSimpleConvert.local",
  8. "Vpc": "vpc-123"
  9. },
  10. "Type": "AWS::ServiceDiscovery::PrivateDnsNamespace"
  11. },
  12. "Cluster": {
  13. "Properties": {
  14. "ClusterName": "TestSimpleConvert",
  15. "Tags": [
  16. {
  17. "Key": "com.docker.compose.project",
  18. "Value": "TestSimpleConvert"
  19. }
  20. ]
  21. },
  22. "Type": "AWS::ECS::Cluster"
  23. },
  24. "Default80Ingress": {
  25. "Properties": {
  26. "CidrIp": "0.0.0.0/0",
  27. "Description": "simple:80/tcp on default nextwork",
  28. "FromPort": 80,
  29. "GroupId": {
  30. "Ref": "DefaultNetwork"
  31. },
  32. "IpProtocol": "TCP",
  33. "ToPort": 80
  34. },
  35. "Type": "AWS::EC2::SecurityGroupIngress"
  36. },
  37. "DefaultNetwork": {
  38. "Properties": {
  39. "GroupDescription": "TestSimpleConvert Security Group for default network",
  40. "Tags": [
  41. {
  42. "Key": "com.docker.compose.project",
  43. "Value": "TestSimpleConvert"
  44. },
  45. {
  46. "Key": "com.docker.compose.network",
  47. "Value": "default"
  48. }
  49. ],
  50. "VpcId": "vpc-123"
  51. },
  52. "Type": "AWS::EC2::SecurityGroup"
  53. },
  54. "DefaultNetworkIngress": {
  55. "Properties": {
  56. "Description": "Allow communication within network default",
  57. "GroupId": {
  58. "Ref": "DefaultNetwork"
  59. },
  60. "IpProtocol": "-1",
  61. "SourceSecurityGroupId": {
  62. "Ref": "DefaultNetwork"
  63. }
  64. },
  65. "Type": "AWS::EC2::SecurityGroupIngress"
  66. },
  67. "LoadBalancer": {
  68. "Properties": {
  69. "Scheme": "internet-facing",
  70. "SecurityGroups": [
  71. {
  72. "Ref": "DefaultNetwork"
  73. }
  74. ],
  75. "Subnets": [
  76. "subnet1",
  77. "subnet2"
  78. ],
  79. "Tags": [
  80. {
  81. "Key": "com.docker.compose.project",
  82. "Value": "TestSimpleConvert"
  83. }
  84. ],
  85. "Type": "application"
  86. },
  87. "Type": "AWS::ElasticLoadBalancingV2::LoadBalancer"
  88. },
  89. "LogGroup": {
  90. "Properties": {
  91. "LogGroupName": "/docker-compose/TestSimpleConvert"
  92. },
  93. "Type": "AWS::Logs::LogGroup"
  94. },
  95. "SimpleService": {
  96. "DependsOn": [
  97. "SimpleTCP80Listener"
  98. ],
  99. "Properties": {
  100. "Cluster": {
  101. "Ref": "Cluster"
  102. },
  103. "DeploymentConfiguration": {
  104. "MaximumPercent": 200,
  105. "MinimumHealthyPercent": 100
  106. },
  107. "DeploymentController": {
  108. "Type": "ECS"
  109. },
  110. "DesiredCount": 1,
  111. "LaunchType": "FARGATE",
  112. "LoadBalancers": [
  113. {
  114. "ContainerName": "simple",
  115. "ContainerPort": 80,
  116. "TargetGroupArn": {
  117. "Ref": "SimpleTCP80TargetGroup"
  118. }
  119. }
  120. ],
  121. "NetworkConfiguration": {
  122. "AwsvpcConfiguration": {
  123. "AssignPublicIp": "ENABLED",
  124. "SecurityGroups": [
  125. {
  126. "Ref": "DefaultNetwork"
  127. }
  128. ],
  129. "Subnets": [
  130. "subnet1",
  131. "subnet2"
  132. ]
  133. }
  134. },
  135. "PlatformVersion": "1.4.0",
  136. "PropagateTags": "SERVICE",
  137. "SchedulingStrategy": "REPLICA",
  138. "ServiceRegistries": [
  139. {
  140. "RegistryArn": {
  141. "Fn::GetAtt": [
  142. "SimpleServiceDiscoveryEntry",
  143. "Arn"
  144. ]
  145. }
  146. }
  147. ],
  148. "Tags": [
  149. {
  150. "Key": "com.docker.compose.project",
  151. "Value": "TestSimpleConvert"
  152. },
  153. {
  154. "Key": "com.docker.compose.service",
  155. "Value": "simple"
  156. }
  157. ],
  158. "TaskDefinition": {
  159. "Ref": "SimpleTaskDefinition"
  160. }
  161. },
  162. "Type": "AWS::ECS::Service"
  163. },
  164. "SimpleServiceDiscoveryEntry": {
  165. "Properties": {
  166. "Description": "\"simple\" service discovery entry in Cloud Map",
  167. "DnsConfig": {
  168. "DnsRecords": [
  169. {
  170. "TTL": 60,
  171. "Type": "A"
  172. }
  173. ],
  174. "RoutingPolicy": "MULTIVALUE"
  175. },
  176. "HealthCheckCustomConfig": {
  177. "FailureThreshold": 1
  178. },
  179. "Name": "simple",
  180. "NamespaceId": {
  181. "Ref": "CloudMap"
  182. }
  183. },
  184. "Type": "AWS::ServiceDiscovery::Service"
  185. },
  186. "SimpleTCP80Listener": {
  187. "Properties": {
  188. "DefaultActions": [
  189. {
  190. "ForwardConfig": {
  191. "TargetGroups": [
  192. {
  193. "TargetGroupArn": {
  194. "Ref": "SimpleTCP80TargetGroup"
  195. }
  196. }
  197. ]
  198. },
  199. "Type": "forward"
  200. }
  201. ],
  202. "LoadBalancerArn": {
  203. "Ref": "LoadBalancer"
  204. },
  205. "Port": 80,
  206. "Protocol": "HTTP"
  207. },
  208. "Type": "AWS::ElasticLoadBalancingV2::Listener"
  209. },
  210. "SimpleTCP80TargetGroup": {
  211. "Properties": {
  212. "Port": 80,
  213. "Protocol": "HTTP",
  214. "Tags": [
  215. {
  216. "Key": "com.docker.compose.project",
  217. "Value": "TestSimpleConvert"
  218. }
  219. ],
  220. "TargetType": "ip",
  221. "VpcId": "vpc-123"
  222. },
  223. "Type": "AWS::ElasticLoadBalancingV2::TargetGroup"
  224. },
  225. "SimpleTaskDefinition": {
  226. "Properties": {
  227. "ContainerDefinitions": [
  228. {
  229. "Command": [
  230. ".compute.internal",
  231. "TestSimpleConvert.local"
  232. ],
  233. "Essential": "false",
  234. "Image": "docker/ecs-searchdomain-sidecar",
  235. "LogConfiguration": {
  236. "LogDriver": "awslogs",
  237. "Options": {
  238. "awslogs-group": {
  239. "Ref": "LogGroup"
  240. },
  241. "awslogs-region": {
  242. "Ref": "AWS::Region"
  243. },
  244. "awslogs-stream-prefix": "TestSimpleConvert"
  245. }
  246. },
  247. "Name": "Simple_ResolvConf_InitContainer"
  248. },
  249. {
  250. "DependsOn": [
  251. {
  252. "Condition": "SUCCESS",
  253. "ContainerName": "Simple_ResolvConf_InitContainer"
  254. }
  255. ],
  256. "Essential": true,
  257. "Image": "nginx",
  258. "LinuxParameters": {},
  259. "LogConfiguration": {
  260. "LogDriver": "awslogs",
  261. "Options": {
  262. "awslogs-group": {
  263. "Ref": "LogGroup"
  264. },
  265. "awslogs-region": {
  266. "Ref": "AWS::Region"
  267. },
  268. "awslogs-stream-prefix": "TestSimpleConvert"
  269. }
  270. },
  271. "Name": "simple",
  272. "PortMappings": [
  273. {
  274. "ContainerPort": 80,
  275. "HostPort": 80,
  276. "Protocol": "tcp"
  277. }
  278. ]
  279. }
  280. ],
  281. "Cpu": "256",
  282. "ExecutionRoleArn": {
  283. "Ref": "SimpleTaskExecutionRole"
  284. },
  285. "Family": "TestSimpleConvert-simple",
  286. "Memory": "512",
  287. "NetworkMode": "awsvpc",
  288. "RequiresCompatibilities": [
  289. "FARGATE"
  290. ]
  291. },
  292. "Type": "AWS::ECS::TaskDefinition"
  293. },
  294. "SimpleTaskExecutionRole": {
  295. "Properties": {
  296. "AssumeRolePolicyDocument": {
  297. "Statement": [
  298. {
  299. "Action": [
  300. "sts:AssumeRole"
  301. ],
  302. "Effect": "Allow",
  303. "Principal": {
  304. "Service": "ecs-tasks.amazonaws.com"
  305. }
  306. }
  307. ],
  308. "Version": "2012-10-17"
  309. },
  310. "ManagedPolicyArns": [
  311. "arn:aws:iam::aws:policy/service-role/AmazonECSTaskExecutionRolePolicy",
  312. "arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly"
  313. ],
  314. "Tags": [
  315. {
  316. "Key": "com.docker.compose.project",
  317. "Value": "TestSimpleConvert"
  318. },
  319. {
  320. "Key": "com.docker.compose.service",
  321. "Value": "simple"
  322. }
  323. ]
  324. },
  325. "Type": "AWS::IAM::Role"
  326. }
  327. }
  328. }