simple-cloudformation-conversion.golden 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  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. "Fn::GetAtt": [
  102. "Cluster",
  103. "Arn"
  104. ]
  105. },
  106. "DeploymentConfiguration": {
  107. "MaximumPercent": 200,
  108. "MinimumHealthyPercent": 100
  109. },
  110. "DeploymentController": {
  111. "Type": "ECS"
  112. },
  113. "DesiredCount": 1,
  114. "LaunchType": "FARGATE",
  115. "LoadBalancers": [
  116. {
  117. "ContainerName": "simple",
  118. "ContainerPort": 80,
  119. "TargetGroupArn": {
  120. "Ref": "SimpleTCP80TargetGroup"
  121. }
  122. }
  123. ],
  124. "NetworkConfiguration": {
  125. "AwsvpcConfiguration": {
  126. "AssignPublicIp": "ENABLED",
  127. "SecurityGroups": [
  128. {
  129. "Ref": "DefaultNetwork"
  130. }
  131. ],
  132. "Subnets": [
  133. "subnet1",
  134. "subnet2"
  135. ]
  136. }
  137. },
  138. "PlatformVersion": "1.4.0",
  139. "PropagateTags": "SERVICE",
  140. "SchedulingStrategy": "REPLICA",
  141. "ServiceRegistries": [
  142. {
  143. "RegistryArn": {
  144. "Fn::GetAtt": [
  145. "SimpleServiceDiscoveryEntry",
  146. "Arn"
  147. ]
  148. }
  149. }
  150. ],
  151. "Tags": [
  152. {
  153. "Key": "com.docker.compose.project",
  154. "Value": "TestSimpleConvert"
  155. },
  156. {
  157. "Key": "com.docker.compose.service",
  158. "Value": "simple"
  159. }
  160. ],
  161. "TaskDefinition": {
  162. "Ref": "SimpleTaskDefinition"
  163. }
  164. },
  165. "Type": "AWS::ECS::Service"
  166. },
  167. "SimpleServiceDiscoveryEntry": {
  168. "Properties": {
  169. "Description": "\"simple\" service discovery entry in Cloud Map",
  170. "DnsConfig": {
  171. "DnsRecords": [
  172. {
  173. "TTL": 60,
  174. "Type": "A"
  175. }
  176. ],
  177. "RoutingPolicy": "MULTIVALUE"
  178. },
  179. "HealthCheckCustomConfig": {
  180. "FailureThreshold": 1
  181. },
  182. "Name": "simple",
  183. "NamespaceId": {
  184. "Ref": "CloudMap"
  185. }
  186. },
  187. "Type": "AWS::ServiceDiscovery::Service"
  188. },
  189. "SimpleTCP80Listener": {
  190. "Properties": {
  191. "DefaultActions": [
  192. {
  193. "ForwardConfig": {
  194. "TargetGroups": [
  195. {
  196. "TargetGroupArn": {
  197. "Ref": "SimpleTCP80TargetGroup"
  198. }
  199. }
  200. ]
  201. },
  202. "Type": "forward"
  203. }
  204. ],
  205. "LoadBalancerArn": {
  206. "Ref": "LoadBalancer"
  207. },
  208. "Port": 80,
  209. "Protocol": "HTTP"
  210. },
  211. "Type": "AWS::ElasticLoadBalancingV2::Listener"
  212. },
  213. "SimpleTCP80TargetGroup": {
  214. "Properties": {
  215. "Port": 80,
  216. "Protocol": "HTTP",
  217. "Tags": [
  218. {
  219. "Key": "com.docker.compose.project",
  220. "Value": "TestSimpleConvert"
  221. }
  222. ],
  223. "TargetType": "ip",
  224. "VpcId": "vpc-123"
  225. },
  226. "Type": "AWS::ElasticLoadBalancingV2::TargetGroup"
  227. },
  228. "SimpleTaskDefinition": {
  229. "Properties": {
  230. "ContainerDefinitions": [
  231. {
  232. "Command": [
  233. ".compute.internal",
  234. "TestSimpleConvert.local"
  235. ],
  236. "Essential": "false",
  237. "Image": "docker/ecs-searchdomain-sidecar",
  238. "LogConfiguration": {
  239. "LogDriver": "awslogs",
  240. "Options": {
  241. "awslogs-group": {
  242. "Ref": "LogGroup"
  243. },
  244. "awslogs-region": {
  245. "Ref": "AWS::Region"
  246. },
  247. "awslogs-stream-prefix": "TestSimpleConvert"
  248. }
  249. },
  250. "Name": "Simple_ResolvConf_InitContainer"
  251. },
  252. {
  253. "DependsOn": [
  254. {
  255. "Condition": "SUCCESS",
  256. "ContainerName": "Simple_ResolvConf_InitContainer"
  257. }
  258. ],
  259. "Essential": true,
  260. "Image": "nginx",
  261. "LinuxParameters": {},
  262. "LogConfiguration": {
  263. "LogDriver": "awslogs",
  264. "Options": {
  265. "awslogs-group": {
  266. "Ref": "LogGroup"
  267. },
  268. "awslogs-region": {
  269. "Ref": "AWS::Region"
  270. },
  271. "awslogs-stream-prefix": "TestSimpleConvert"
  272. }
  273. },
  274. "Name": "simple",
  275. "PortMappings": [
  276. {
  277. "ContainerPort": 80,
  278. "HostPort": 80,
  279. "Protocol": "tcp"
  280. }
  281. ]
  282. }
  283. ],
  284. "Cpu": "256",
  285. "ExecutionRoleArn": {
  286. "Ref": "SimpleTaskExecutionRole"
  287. },
  288. "Family": "TestSimpleConvert-simple",
  289. "Memory": "512",
  290. "NetworkMode": "awsvpc",
  291. "RequiresCompatibilities": [
  292. "FARGATE"
  293. ]
  294. },
  295. "Type": "AWS::ECS::TaskDefinition"
  296. },
  297. "SimpleTaskExecutionRole": {
  298. "Properties": {
  299. "AssumeRolePolicyDocument": {
  300. "Statement": [
  301. {
  302. "Action": [
  303. "sts:AssumeRole"
  304. ],
  305. "Condition": {},
  306. "Effect": "Allow",
  307. "Principal": {
  308. "Service": "ecs-tasks.amazonaws.com"
  309. }
  310. }
  311. ],
  312. "Version": "2012-10-17"
  313. },
  314. "ManagedPolicyArns": [
  315. "arn:aws:iam::aws:policy/service-role/AmazonECSTaskExecutionRolePolicy",
  316. "arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly"
  317. ],
  318. "Tags": [
  319. {
  320. "Key": "com.docker.compose.project",
  321. "Value": "TestSimpleConvert"
  322. },
  323. {
  324. "Key": "com.docker.compose.service",
  325. "Value": "simple"
  326. }
  327. ]
  328. },
  329. "Type": "AWS::IAM::Role"
  330. }
  331. }
  332. }