ufo 5.0.6 → 6.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (458) hide show
  1. checksums.yaml +4 -4
  2. data/.cody/README.md +19 -0
  3. data/.cody/acceptance/bin/build.sh +90 -0
  4. data/.cody/acceptance/buildspec.yml +10 -0
  5. data/.cody/acceptance/project.rb +11 -0
  6. data/.cody/acceptance/role.rb +28 -0
  7. data/.cody/shared/script/install/ufo.sh +40 -0
  8. data/.cody/shared/script/install.sh +5 -0
  9. data/.github/workflows/main.yml +28 -0
  10. data/CHANGELOG.md +11 -1
  11. data/Gemfile +0 -2
  12. data/README.md +1 -32
  13. data/lib/templates/docker/Dockerfile +4 -0
  14. data/lib/templates/helper/%underscore_name%_helper.rb.tt +6 -0
  15. data/lib/templates/init/.ufo/config/web/base.rb +6 -0
  16. data/lib/templates/init/.ufo/config/web/dev.rb +6 -0
  17. data/lib/templates/init/.ufo/config/web/prod.rb +6 -0
  18. data/lib/templates/init/.ufo/config.rb.tt +39 -0
  19. data/lib/templates/init/.ufo/resources/iam_roles/execution_role.rb +23 -0
  20. data/lib/templates/init/.ufo/resources/iam_roles/task_role.rb +20 -0
  21. data/lib/templates/init/.ufo/resources/task_definitions/web.yml +29 -0
  22. data/lib/templates/init/.ufo/vars/base.rb +20 -0
  23. data/lib/templates/init/.ufo/vars/dev.rb +4 -0
  24. data/lib/templates/init/.ufo/vars/prod.rb +4 -0
  25. data/lib/ufo/aws_services.rb +118 -0
  26. data/lib/ufo/booter.rb +27 -0
  27. data/lib/ufo/cfn/base.rb +7 -0
  28. data/lib/ufo/cfn/deploy.rb +54 -0
  29. data/lib/ufo/{stack → cfn/stack}/builder/base.rb +12 -23
  30. data/lib/ufo/cfn/stack/builder/conditions.rb +25 -0
  31. data/lib/ufo/{stack → cfn/stack}/builder/outputs.rb +2 -2
  32. data/lib/ufo/cfn/stack/builder/parameters.rb +34 -0
  33. data/lib/ufo/cfn/stack/builder/resources/base.rb +4 -0
  34. data/lib/ufo/cfn/stack/builder/resources/dns.rb +47 -0
  35. data/lib/ufo/{stack/builder/resources/ecs.rb → cfn/stack/builder/resources/ecs_service.rb} +24 -10
  36. data/lib/ufo/cfn/stack/builder/resources/elb.rb +35 -0
  37. data/lib/ufo/cfn/stack/builder/resources/iam_roles/base.rb +32 -0
  38. data/lib/ufo/cfn/stack/builder/resources/iam_roles/execution_role.rb +4 -0
  39. data/lib/ufo/cfn/stack/builder/resources/iam_roles/task_role.rb +4 -0
  40. data/lib/ufo/cfn/stack/builder/resources/listener.rb +65 -0
  41. data/lib/ufo/cfn/stack/builder/resources/listener_ssl.rb +44 -0
  42. data/lib/ufo/cfn/stack/builder/resources/scaling/base.rb +5 -0
  43. data/lib/ufo/cfn/stack/builder/resources/scaling/policy.rb +27 -0
  44. data/lib/ufo/cfn/stack/builder/resources/scaling/role.rb +33 -0
  45. data/lib/ufo/cfn/stack/builder/resources/scaling/target.rb +22 -0
  46. data/lib/ufo/cfn/stack/builder/resources/security_group/base.rb +4 -0
  47. data/lib/ufo/{stack → cfn/stack}/builder/resources/security_group/ecs.rb +4 -4
  48. data/lib/ufo/{stack → cfn/stack}/builder/resources/security_group/ecs_rule.rb +2 -2
  49. data/lib/ufo/{stack → cfn/stack}/builder/resources/security_group/elb.rb +5 -6
  50. data/lib/ufo/{stack → cfn/stack}/builder/resources/target_group.rb +4 -4
  51. data/lib/ufo/{stack → cfn/stack}/builder/resources/task_definition/reconstructor.rb +4 -4
  52. data/lib/ufo/{stack → cfn/stack}/builder/resources/task_definition.rb +4 -4
  53. data/lib/ufo/cfn/stack/builder/resources.rb +24 -0
  54. data/lib/ufo/cfn/stack/builder.rb +30 -0
  55. data/lib/ufo/{stack → cfn/stack}/custom_properties.rb +21 -5
  56. data/lib/ufo/cfn/stack/params.rb +51 -0
  57. data/lib/ufo/{stack → cfn/stack}/status.rb +2 -2
  58. data/lib/ufo/cfn/stack/template.rb +8 -0
  59. data/lib/ufo/cfn/stack/vars.rb +110 -0
  60. data/lib/ufo/cfn/stack/vpc.rb +31 -0
  61. data/lib/ufo/cfn/stack.rb +175 -0
  62. data/lib/ufo/cli/base.rb +18 -0
  63. data/lib/ufo/cli/build.rb +30 -0
  64. data/lib/ufo/cli/cancel.rb +18 -0
  65. data/lib/ufo/cli/central/update.rb +80 -0
  66. data/lib/ufo/cli/central.rb +12 -0
  67. data/lib/ufo/cli/clean.rb +17 -0
  68. data/lib/ufo/cli/destroy.rb +31 -0
  69. data/lib/ufo/{docker.rb → cli/docker.rb} +18 -18
  70. data/lib/ufo/cli/exec.rb +82 -0
  71. data/lib/ufo/cli/help/central/update.md +20 -0
  72. data/lib/ufo/{help → cli/help}/completion.md +0 -0
  73. data/lib/ufo/{help → cli/help}/completion_script.md +0 -0
  74. data/lib/ufo/cli/help/destroy.md +9 -0
  75. data/lib/ufo/cli/help/docker/base.md +39 -0
  76. data/lib/ufo/{help → cli/help}/docker/build.md +9 -9
  77. data/lib/ufo/{help → cli/help}/docker/clean.md +8 -8
  78. data/lib/ufo/{help → cli/help}/docker/compile.md +0 -0
  79. data/lib/ufo/cli/help/docker/name.md +16 -0
  80. data/lib/ufo/{help → cli/help}/docker/push.md +0 -0
  81. data/lib/ufo/cli/help/docker.md +6 -0
  82. data/lib/ufo/{help → cli/help}/help.md +1 -1
  83. data/lib/ufo/cli/help/init.md +27 -0
  84. data/lib/ufo/{help → cli/help}/logs.md +5 -4
  85. data/lib/ufo/cli/help/ps.md +12 -0
  86. data/lib/ufo/cli/help/releases.md +15 -0
  87. data/lib/ufo/cli/help/rollback.md +40 -0
  88. data/lib/ufo/cli/help/scale.md +7 -0
  89. data/lib/ufo/cli/help/ship.md +41 -0
  90. data/lib/ufo/cli/help/stop.md +3 -0
  91. data/lib/ufo/cli/help.rb +62 -0
  92. data/lib/ufo/{logs.rb → cli/logs.rb} +13 -6
  93. data/lib/ufo/cli/new/concerns.rb +16 -0
  94. data/lib/ufo/cli/new/helper.rb +24 -0
  95. data/lib/ufo/cli/new/init.rb +68 -0
  96. data/lib/ufo/{sequence.rb → cli/new/sequence.rb} +26 -4
  97. data/lib/ufo/cli/new.rb +10 -0
  98. data/lib/ufo/cli/opts.rb +35 -0
  99. data/lib/ufo/cli/ps/errors.rb +116 -0
  100. data/lib/ufo/{ps → cli/ps}/task.rb +22 -29
  101. data/lib/ufo/cli/ps.rb +157 -0
  102. data/lib/ufo/{releases.rb → cli/releases.rb} +4 -4
  103. data/lib/ufo/{rollback.rb → cli/rollback.rb} +24 -12
  104. data/lib/ufo/cli/scale.rb +76 -0
  105. data/lib/ufo/cli/ship.rb +28 -0
  106. data/lib/ufo/cli/status.rb +8 -0
  107. data/lib/ufo/cli/stop.rb +49 -0
  108. data/lib/ufo/{tasks.rb → cli/tasks.rb} +2 -2
  109. data/lib/ufo/{upgrade.rb → cli/upgrade.rb} +2 -2
  110. data/lib/ufo/cli.rb +83 -172
  111. data/lib/ufo/command.rb +56 -1
  112. data/lib/ufo/concerns/autoscaling.rb +11 -0
  113. data/lib/ufo/concerns/names.rb +9 -0
  114. data/lib/ufo/concerns.rb +26 -0
  115. data/lib/ufo/config/inits.rb +13 -0
  116. data/lib/ufo/config.rb +190 -0
  117. data/lib/ufo/core.rb +32 -44
  118. data/lib/ufo/docker/builder.rb +44 -40
  119. data/lib/ufo/docker/cleaner.rb +9 -12
  120. data/lib/ufo/docker/compiler.rb +10 -4
  121. data/lib/ufo/docker/concerns.rb +7 -0
  122. data/lib/ufo/docker/dockerfile.rb +13 -9
  123. data/lib/ufo/docker/pusher.rb +13 -25
  124. data/lib/ufo/docker/state.rb +63 -0
  125. data/lib/ufo/ecr/auth.rb +8 -7
  126. data/lib/ufo/ecr/cleaner.rb +10 -14
  127. data/lib/ufo/ext/core/module.rb +31 -0
  128. data/lib/ufo/ext/core/nil_class.rb +11 -0
  129. data/lib/ufo/ext.rb +2 -0
  130. data/lib/ufo/{role → iam_role}/builder.rb +1 -1
  131. data/lib/ufo/{role → iam_role}/dsl.rb +8 -2
  132. data/lib/ufo/{role → iam_role}/registry.rb +1 -1
  133. data/lib/ufo/info.rb +22 -4
  134. data/lib/ufo/layering/layer.rb +95 -0
  135. data/lib/ufo/layering.rb +23 -0
  136. data/lib/ufo/log_group.rb +18 -10
  137. data/lib/ufo/logger/formatter.rb +13 -0
  138. data/lib/ufo/logger.rb +32 -0
  139. data/lib/ufo/names.rb +69 -0
  140. data/lib/ufo/param.rb +2 -1
  141. data/lib/ufo/task_definition/builder.rb +7 -0
  142. data/lib/ufo/task_definition/context.rb +45 -0
  143. data/lib/ufo/task_definition/erb/base.rb +18 -0
  144. data/lib/ufo/task_definition/erb/json.rb +28 -0
  145. data/lib/ufo/task_definition/erb/yaml.rb +18 -0
  146. data/lib/ufo/task_definition/erb.rb +78 -0
  147. data/lib/ufo/task_definition/helpers/aws_data_helper.rb +18 -0
  148. data/lib/ufo/task_definition/helpers/core.rb +50 -0
  149. data/lib/ufo/task_definition/helpers/ssm/fetcher.rb +39 -0
  150. data/lib/ufo/task_definition/helpers/ssm.rb +8 -0
  151. data/lib/ufo/task_definition/helpers/stack_output.rb +23 -0
  152. data/lib/ufo/{dsl/helper → task_definition/helpers}/vars.rb +40 -19
  153. data/lib/ufo/task_definition/helpers/vpc.rb +48 -0
  154. data/lib/ufo/task_definition/helpers.rb +5 -0
  155. data/lib/ufo/task_definition.rb +19 -0
  156. data/lib/ufo/upgrade/upgrade3.rb +1 -1
  157. data/lib/ufo/upgrade/upgrade4.rb +3 -3
  158. data/lib/ufo/utils/execute.rb +30 -0
  159. data/lib/ufo/utils/logging.rb +7 -0
  160. data/lib/ufo/utils/pretty.rb +18 -0
  161. data/lib/ufo/utils/squeezer.rb +1 -1
  162. data/lib/ufo/utils/sure.rb +23 -0
  163. data/lib/ufo/version.rb +1 -1
  164. data/lib/ufo/yaml/loader.rb +48 -0
  165. data/lib/ufo/yaml/validator.rb +51 -0
  166. data/lib/ufo/yaml.rb +13 -0
  167. data/lib/ufo.rb +14 -3
  168. data/spec/spec_helper.rb +4 -26
  169. data/spec/{lib → ufo}/ecr_auth_spec.rb +0 -0
  170. data/spec/{lib → ufo}/ecr_cleaner_spec.rb +0 -2
  171. data/spec/{lib/role → ufo/iam_role}/builder_spec.rb +5 -5
  172. data/spec/{lib/role → ufo/iam_role}/dsl_spec.rb +3 -3
  173. data/spec/{lib → ufo}/logs_spec.rb +2 -2
  174. data/ufo.gemspec +9 -3
  175. metadata +245 -341
  176. data/.circleci/bin/commit_docs.sh +0 -26
  177. data/.circleci/config.yml +0 -78
  178. data/.gitmodules +0 -0
  179. data/docs/.gitignore +0 -5
  180. data/docs/CNAME +0 -1
  181. data/docs/Gemfile +0 -4
  182. data/docs/LICENSE +0 -21
  183. data/docs/README.md +0 -20
  184. data/docs/_config.yml +0 -75
  185. data/docs/_docs/aws-ecs-task-execution-role.md +0 -28
  186. data/docs/_docs/conventions.md +0 -47
  187. data/docs/_docs/extras/codebuild-iam-role.md +0 -46
  188. data/docs/_docs/extras/dockerfile-erb.md +0 -60
  189. data/docs/_docs/extras/ecs-network-mode.md +0 -37
  190. data/docs/_docs/extras/load-balancer.md +0 -83
  191. data/docs/_docs/extras/minimal-deploy-iam.md +0 -79
  192. data/docs/_docs/extras/notification-arns.md +0 -21
  193. data/docs/_docs/extras/redirection-support.md +0 -27
  194. data/docs/_docs/extras/route53-support.md +0 -27
  195. data/docs/_docs/extras/security-groups.md +0 -36
  196. data/docs/_docs/extras/ssl-support.md +0 -20
  197. data/docs/_docs/faq.md +0 -100
  198. data/docs/_docs/fargate.md +0 -5
  199. data/docs/_docs/helpers.md +0 -24
  200. data/docs/_docs/iam-roles.md +0 -112
  201. data/docs/_docs/install.md +0 -25
  202. data/docs/_docs/more/auto-completion.md +0 -24
  203. data/docs/_docs/more/automated-cleanup.md +0 -14
  204. data/docs/_docs/more/customize-cloudformation.md +0 -35
  205. data/docs/_docs/more/migrations.md +0 -25
  206. data/docs/_docs/more/run-in-pieces.md +0 -30
  207. data/docs/_docs/more/single-task.md +0 -25
  208. data/docs/_docs/more/stuck-cloudformation.md +0 -29
  209. data/docs/_docs/more/why-cloudformation.md +0 -21
  210. data/docs/_docs/next-steps.md +0 -16
  211. data/docs/_docs/quick-start-ec2.md +0 -86
  212. data/docs/_docs/secrets.md +0 -135
  213. data/docs/_docs/settings/aws_profile.md +0 -36
  214. data/docs/_docs/settings/cfn.md +0 -12
  215. data/docs/_docs/settings/cluster.md +0 -66
  216. data/docs/_docs/settings/manage-security-groups.md +0 -24
  217. data/docs/_docs/settings/network.md +0 -45
  218. data/docs/_docs/settings.md +0 -55
  219. data/docs/_docs/ssl_errors.md +0 -40
  220. data/docs/_docs/structure.md +0 -41
  221. data/docs/_docs/tutorial-ufo-docker-build.md +0 -61
  222. data/docs/_docs/tutorial-ufo-init.md +0 -86
  223. data/docs/_docs/tutorial-ufo-ship.md +0 -95
  224. data/docs/_docs/tutorial-ufo-ships.md +0 -38
  225. data/docs/_docs/tutorial-ufo-tasks-build.md +0 -177
  226. data/docs/_docs/tutorial.md +0 -14
  227. data/docs/_docs/ufo-current.md +0 -49
  228. data/docs/_docs/ufo-env-extra.md +0 -22
  229. data/docs/_docs/ufo-env.md +0 -46
  230. data/docs/_docs/ufo-logs.md +0 -49
  231. data/docs/_docs/ufo-task-params.md +0 -43
  232. data/docs/_docs/ufo-tasks-register.md +0 -21
  233. data/docs/_docs/upgrading/upgrade4.5.md +0 -52
  234. data/docs/_docs/upgrading/upgrade4.md +0 -48
  235. data/docs/_docs/upgrading/upgrade5.md +0 -19
  236. data/docs/_docs/upgrading.md +0 -13
  237. data/docs/_docs/variables.md +0 -55
  238. data/docs/_includes/about.html +0 -19
  239. data/docs/_includes/banner/foot.html +0 -2
  240. data/docs/_includes/banner/head.html +0 -5
  241. data/docs/_includes/cfn-customize.md +0 -53
  242. data/docs/_includes/commands.html +0 -80
  243. data/docs/_includes/contact.html +0 -17
  244. data/docs/_includes/contact_disqus.html +0 -16
  245. data/docs/_includes/contact_static.html +0 -17
  246. data/docs/_includes/content.html +0 -26
  247. data/docs/_includes/css/bootstrap.min.css +0 -7
  248. data/docs/_includes/css/main.css +0 -501
  249. data/docs/_includes/css/quotes.css +0 -102
  250. data/docs/_includes/css/syntax.css +0 -65
  251. data/docs/_includes/css/table.css +0 -53
  252. data/docs/_includes/css/timeline.css +0 -201
  253. data/docs/_includes/css/ufo.css +0 -218
  254. data/docs/_includes/edit-on-github.html +0 -11
  255. data/docs/_includes/example.html +0 -63
  256. data/docs/_includes/footer.html +0 -44
  257. data/docs/_includes/google_analytics.html +0 -10
  258. data/docs/_includes/head.html +0 -32
  259. data/docs/_includes/header.html +0 -15
  260. data/docs/_includes/js.html +0 -32
  261. data/docs/_includes/js_disqus.html +0 -21
  262. data/docs/_includes/modals.html +0 -40
  263. data/docs/_includes/nav.html +0 -27
  264. data/docs/_includes/prev_next.md +0 -19
  265. data/docs/_includes/quotes.html +0 -19
  266. data/docs/_includes/reference.md +0 -5
  267. data/docs/_includes/repo_push_access.md +0 -11
  268. data/docs/_includes/subnav.html +0 -78
  269. data/docs/_includes/summary.html +0 -22
  270. data/docs/_includes/ufo-ship-options.md +0 -12
  271. data/docs/_includes/uses.html +0 -19
  272. data/docs/_layouts/default.html +0 -13
  273. data/docs/_layouts/style.css +0 -6
  274. data/docs/_reference/ufo-apps.md +0 -37
  275. data/docs/_reference/ufo-cancel.md +0 -24
  276. data/docs/_reference/ufo-completion.md +0 -46
  277. data/docs/_reference/ufo-completion_script.md +0 -27
  278. data/docs/_reference/ufo-current.md +0 -93
  279. data/docs/_reference/ufo-deploy.md +0 -76
  280. data/docs/_reference/ufo-destroy.md +0 -36
  281. data/docs/_reference/ufo-docker-base.md +0 -71
  282. data/docs/_reference/ufo-docker-build.md +0 -91
  283. data/docs/_reference/ufo-docker-clean.md +0 -44
  284. data/docs/_reference/ufo-docker-compile.md +0 -19
  285. data/docs/_reference/ufo-docker-help.md +0 -15
  286. data/docs/_reference/ufo-docker-name.md +0 -37
  287. data/docs/_reference/ufo-docker-push.md +0 -49
  288. data/docs/_reference/ufo-docker.md +0 -38
  289. data/docs/_reference/ufo-init.md +0 -125
  290. data/docs/_reference/ufo-logs.md +0 -40
  291. data/docs/_reference/ufo-network-help.md +0 -15
  292. data/docs/_reference/ufo-network-init.md +0 -39
  293. data/docs/_reference/ufo-network.md +0 -26
  294. data/docs/_reference/ufo-ps.md +0 -56
  295. data/docs/_reference/ufo-releases.md +0 -40
  296. data/docs/_reference/ufo-resources.md +0 -44
  297. data/docs/_reference/ufo-rollback.md +0 -61
  298. data/docs/_reference/ufo-scale.md +0 -50
  299. data/docs/_reference/ufo-ship.md +0 -129
  300. data/docs/_reference/ufo-ships.md +0 -68
  301. data/docs/_reference/ufo-status.md +0 -23
  302. data/docs/_reference/ufo-stop.md +0 -31
  303. data/docs/_reference/ufo-task.md +0 -56
  304. data/docs/_reference/ufo-tasks-build.md +0 -178
  305. data/docs/_reference/ufo-tasks-help.md +0 -15
  306. data/docs/_reference/ufo-tasks-register.md +0 -29
  307. data/docs/_reference/ufo-tasks.md +0 -35
  308. data/docs/_reference/ufo-upgrade-help.md +0 -15
  309. data/docs/_reference/ufo-upgrade-v2to3.md +0 -15
  310. data/docs/_reference/ufo-upgrade-v33to34.md +0 -15
  311. data/docs/_reference/ufo-upgrade-v3to4.md +0 -27
  312. data/docs/_reference/ufo-upgrade-v43to45.md +0 -15
  313. data/docs/_reference/ufo-upgrade.md +0 -29
  314. data/docs/_reference/ufo-version.md +0 -23
  315. data/docs/articles.md +0 -14
  316. data/docs/bin/web +0 -4
  317. data/docs/css/font-awesome/css/font-awesome.css +0 -1566
  318. data/docs/css/font-awesome/css/font-awesome.min.css +0 -4
  319. data/docs/css/font-awesome/fonts/FontAwesome.otf +0 -0
  320. data/docs/css/font-awesome/fonts/fontawesome-webfont.eot +0 -0
  321. data/docs/css/font-awesome/fonts/fontawesome-webfont.svg +0 -504
  322. data/docs/css/font-awesome/fonts/fontawesome-webfont.ttf +0 -0
  323. data/docs/css/font-awesome/fonts/fontawesome-webfont.woff +0 -0
  324. data/docs/docs.md +0 -29
  325. data/docs/img/docs/cloudformation-resources.png +0 -0
  326. data/docs/img/logos/boltops-logo-full.png +0 -0
  327. data/docs/img/logos/boltops-logo.png +0 -0
  328. data/docs/img/logos/ufo-logo-2.png +0 -0
  329. data/docs/img/logos/ufo-logo.png +0 -0
  330. data/docs/img/logos/ufo-site-header.png +0 -0
  331. data/docs/img/logos/ufo.jpg +0 -0
  332. data/docs/img/tutorials/ecs-console-task-definitions.png +0 -0
  333. data/docs/img/tutorials/ecs-console-ufo-ship.png +0 -0
  334. data/docs/img/tutorials/ecs-console-ufo-ships.png +0 -0
  335. data/docs/index.html +0 -10
  336. data/docs/js/bootstrap.js +0 -2114
  337. data/docs/js/bootstrap.min.js +0 -6
  338. data/docs/js/cbpAnimatedHeader.js +0 -44
  339. data/docs/js/cbpAnimatedHeader.min.js +0 -11
  340. data/docs/js/classie.js +0 -80
  341. data/docs/js/contact_me.js +0 -70
  342. data/docs/js/contact_me_static.js +0 -23
  343. data/docs/js/freelancer.js +0 -37
  344. data/docs/js/jqBootstrapValidation.js +0 -912
  345. data/docs/js/jquery-1.11.0.js +0 -4
  346. data/docs/js/jquery.easing.min.js +0 -44
  347. data/docs/js/nav.js +0 -53
  348. data/docs/quick-start.md +0 -133
  349. data/docs/reference.md +0 -29
  350. data/docs/style.css +0 -3
  351. data/docs/utils/ssl-doctor.rb +0 -89
  352. data/docs/utils/test-aws-api-access.rb +0 -11
  353. data/docs/utils/update-cert-chains.sh +0 -11
  354. data/lib/template/.env +0 -3
  355. data/lib/template/.secrets +0 -5
  356. data/lib/template/.ufo/iam_roles/execution_role.rb +0 -7
  357. data/lib/template/.ufo/iam_roles/task_role.rb +0 -21
  358. data/lib/template/.ufo/params.yml.tt +0 -27
  359. data/lib/template/.ufo/settings/cfn/default.yml.tt +0 -72
  360. data/lib/template/.ufo/settings/network/default.yml.tt +0 -26
  361. data/lib/template/.ufo/settings.yml.tt +0 -26
  362. data/lib/template/.ufo/task_definitions.rb.tt +0 -61
  363. data/lib/template/.ufo/templates/fargate.json.erb +0 -39
  364. data/lib/template/.ufo/templates/main.json.erb +0 -43
  365. data/lib/template/.ufo/variables/base.rb.tt +0 -19
  366. data/lib/template/.ufo/variables/development.rb +0 -8
  367. data/lib/template/.ufo/variables/production.rb +0 -7
  368. data/lib/template/Dockerfile +0 -15
  369. data/lib/template/bin/deploy.tt +0 -7
  370. data/lib/ufo/apps/cfn_map.rb +0 -70
  371. data/lib/ufo/apps/cluster.rb +0 -24
  372. data/lib/ufo/apps/service.rb +0 -56
  373. data/lib/ufo/apps.rb +0 -56
  374. data/lib/ufo/aws_service.rb +0 -36
  375. data/lib/ufo/base.rb +0 -35
  376. data/lib/ufo/cancel.rb +0 -23
  377. data/lib/ufo/current.rb +0 -104
  378. data/lib/ufo/default/settings.yml +0 -24
  379. data/lib/ufo/default/templates/main.json.erb +0 -39
  380. data/lib/ufo/destroy.rb +0 -41
  381. data/lib/ufo/docker/variables.rb +0 -26
  382. data/lib/ufo/dsl/helper.rb +0 -79
  383. data/lib/ufo/dsl/outputter.rb +0 -43
  384. data/lib/ufo/dsl/task_definition.rb +0 -108
  385. data/lib/ufo/dsl.rb +0 -96
  386. data/lib/ufo/help/apps.md +0 -12
  387. data/lib/ufo/help/balancer.md +0 -3
  388. data/lib/ufo/help/completions.md +0 -16
  389. data/lib/ufo/help/completions_script.md +0 -1
  390. data/lib/ufo/help/current.md +0 -65
  391. data/lib/ufo/help/deploy.md +0 -38
  392. data/lib/ufo/help/destroy.md +0 -9
  393. data/lib/ufo/help/docker/base.md +0 -49
  394. data/lib/ufo/help/docker/name.md +0 -16
  395. data/lib/ufo/help/docker.md +0 -6
  396. data/lib/ufo/help/init.md +0 -91
  397. data/lib/ufo/help/network/init.md +0 -13
  398. data/lib/ufo/help/ps.md +0 -27
  399. data/lib/ufo/help/releases.md +0 -16
  400. data/lib/ufo/help/resources.md +0 -20
  401. data/lib/ufo/help/rollback.md +0 -35
  402. data/lib/ufo/help/scale.md +0 -26
  403. data/lib/ufo/help/ship.md +0 -95
  404. data/lib/ufo/help/ships.md +0 -35
  405. data/lib/ufo/help/stop.md +0 -7
  406. data/lib/ufo/help/task.md +0 -27
  407. data/lib/ufo/help/tasks/build.md +0 -158
  408. data/lib/ufo/help/tasks/register.md +0 -14
  409. data/lib/ufo/help/tasks.md +0 -7
  410. data/lib/ufo/help/upgrade/v3to4.md +0 -3
  411. data/lib/ufo/help.rb +0 -9
  412. data/lib/ufo/init.rb +0 -119
  413. data/lib/ufo/network/fetch.rb +0 -48
  414. data/lib/ufo/network/helper.rb +0 -23
  415. data/lib/ufo/network/init.rb +0 -26
  416. data/lib/ufo/network.rb +0 -21
  417. data/lib/ufo/ps.rb +0 -129
  418. data/lib/ufo/scale.rb +0 -28
  419. data/lib/ufo/setting/profile.rb +0 -44
  420. data/lib/ufo/setting/security_groups.rb +0 -22
  421. data/lib/ufo/setting.rb +0 -75
  422. data/lib/ufo/settings.rb +0 -20
  423. data/lib/ufo/ship.rb +0 -103
  424. data/lib/ufo/stack/builder/conditions.rb +0 -23
  425. data/lib/ufo/stack/builder/parameters.rb +0 -45
  426. data/lib/ufo/stack/builder/resources/base.rb +0 -4
  427. data/lib/ufo/stack/builder/resources/dns.rb +0 -17
  428. data/lib/ufo/stack/builder/resources/elb.rb +0 -45
  429. data/lib/ufo/stack/builder/resources/listener.rb +0 -42
  430. data/lib/ufo/stack/builder/resources/listener_ssl.rb +0 -16
  431. data/lib/ufo/stack/builder/resources/roles/base.rb +0 -22
  432. data/lib/ufo/stack/builder/resources/roles/execution_role.rb +0 -4
  433. data/lib/ufo/stack/builder/resources/roles/task_role.rb +0 -4
  434. data/lib/ufo/stack/builder/resources/security_group/base.rb +0 -4
  435. data/lib/ufo/stack/builder/resources.rb +0 -20
  436. data/lib/ufo/stack/builder.rb +0 -26
  437. data/lib/ufo/stack/context.rb +0 -253
  438. data/lib/ufo/stack/helper.rb +0 -55
  439. data/lib/ufo/stack/template_body.rb +0 -13
  440. data/lib/ufo/stack.rb +0 -213
  441. data/lib/ufo/status.rb +0 -56
  442. data/lib/ufo/stop.rb +0 -49
  443. data/lib/ufo/task.rb +0 -225
  444. data/lib/ufo/tasks/builder.rb +0 -40
  445. data/lib/ufo/tasks/register.rb +0 -90
  446. data/lib/ufo/template_scope.rb +0 -57
  447. data/lib/ufo/util.rb +0 -69
  448. data/spec/lib/apps_spec.rb +0 -20
  449. data/spec/lib/builder_spec.rb +0 -23
  450. data/spec/lib/cli_spec.rb +0 -73
  451. data/spec/lib/completion_spec.rb +0 -18
  452. data/spec/lib/ps_spec.rb +0 -14
  453. data/spec/lib/register_spec.rb +0 -49
  454. data/spec/lib/setting_spec.rb +0 -18
  455. data/spec/lib/ship_spec.rb +0 -46
  456. data/spec/lib/stack/status_spec.rb +0 -76
  457. data/spec/lib/stop_spec.rb +0 -13
  458. data/spec/lib/task_spec.rb +0 -54
@@ -1,86 +0,0 @@
1
- ---
2
- title: 'Quick Start: EC2'
3
- nav_order: 2
4
- ---
5
-
6
- ## What is ECS EC2?
7
-
8
- ECS EC2 is a way to run Docker containers on your own EC2 instances. This difference between ECS EC2 and ECS Fargate is who manages the servers. With ECS Fargate, AWS manages the EC2 instances for you and provides an interesting "serverless" option. With ECS EC2, you manage the EC2 instances and are responsible for maintenance. The pro with ECS EC2 is more control and cost savings, since you're not paying for the overhead for AWS Fargate maintenance. Refer to [Heroku vs ECS Fargate vs EC2 On-Demand vs EC2 Spot Pricing Comparison](https://blog.boltops.com/2018/04/22/heroku-vs-ecs-fargate-vs-ec2-on-demand-vs-ec2-spot-pricing-comparison) for a pricing comparison.
9
-
10
- ## Let's Go
11
-
12
- In a hurry? No sweat! Here's a quick start to using ufo that takes only a few minutes. For this example, we will use a Sinatra app from [tongueroo/demo-ufo](https://github.com/tongueroo/demo-ufo). The `ufo init` command sets up the ufo directory structure in your project. The `ufo ship` command deploys your code to an AWS ECS service. The `ufo ps` and `ufo scale` command shows you how to verify and scale additional containers.
13
-
14
- gem install ufo
15
- git clone https://github.com/tongueroo/demo-ufo.git demo
16
- cd demo
17
- aws ecr create-repository --repository-name demo/sinatra
18
- ECR_REPO=$(aws ecr describe-repositories --repository-name demo/sinatra | jq -r '.repositories[].repositoryUri')
19
- ufo init --image $ECR_REPO
20
- ufo current --service demo-web
21
- ufo ship
22
- ufo ps
23
- ufo scale 2
24
-
25
- This quickstart assumes:
26
-
27
- * You have push access to the repo. Refer to the Notes "Repo Push Access" section below for more info.
28
- * You are using ECS EC2 and have an ECS cluster with EC2 Container instances running. Refer to the Notes "ECS EC2 vs ECS Fargate" section below for more info.
29
- * The ECS Cluster is in the default VPC. If it is not you need to use the `--vpc-id`, `--ecs-subnets`, and `--elb-subnets` options in the [ufo init]({% link _reference/ufo-init.md %}) command.
30
-
31
- ## What Happened
32
-
33
- The `ufo ship demo-web` command does the following:
34
-
35
- 1. Builds the Docker image and pushes it to a registry
36
- 2. Builds the ECS task definitions and registry them to ECS
37
- 3. Updates the ECS Service
38
- 4. Creates an ELB and connects it to the ECS Service
39
-
40
- You should see something similar to this:
41
-
42
- ```
43
- $ ufo init --app=demo --image=tongueroo/demo-ufo
44
- Setting up ufo project...
45
- create .env
46
- create .ufo/settings.yml
47
- create .ufo/task_definitions.rb
48
- create .ufo/templates/main.json.erb
49
- create .ufo/variables/base.rb
50
- create .ufo/variables/development.rb
51
- create .ufo/variables/production.rb
52
- create Dockerfile
53
- create bin/deploy
54
- append .gitignore
55
- Starter ufo files created.
56
- $ ufo ship demo-web
57
- Building docker image with:
58
- docker build -t 112233445566.dkr.ecr.us-west-2.amazonaws.com/demo/sinatra:ufo-2017-09-10T15-00-19-c781aaf -f Dockerfile .
59
- ....
60
- Software shipped!
61
- $ ufo ps
62
- +----------+------+-------------+---------------+---------+-------+
63
- | Id | Name | Release | Started | Status | Notes |
64
- +----------+------+-------------+---------------+---------+-------+
65
- | f590ee5e | web | demo-web:85 | 1 minutes ago | RUNNING | |
66
- +----------+------+-------------+---------------+---------+-------+
67
- $ ufo scale 2
68
- Scale demo-web service in development cluster to 2
69
- $
70
- ```
71
-
72
- Congratulations! You have successfully deployed code to AWS ECS with ufo. It was really that simple 😁
73
-
74
- {% include repo_push_access.md %}
75
-
76
- ## ECS EC2 vs ECS Fargate
77
-
78
- Ufo does not create the EC2 servers themselves to run the ECS tasks. If you use `ufo ship` to deploy an application to ECS EC2 and have not set up the EC2 servers, then the CloudFormation update will not be able to provision the ECS tasks and eventually roll back. Essentially it cannot create the ECS tasks because there are no EC2 servers to run them.
79
-
80
- Refer to the AWS [Creating a Cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/create_cluster.html) docs to create an ECS cluster. Also refer to [ECS Terms Tutorial](https://blog.boltops.com/2017/09/08/aws-ecs-terms-tutorial) for an explanation of ECS terms.
81
-
82
- If you would like not to manage the EC2 server fleet, you are looking for ECS Fargate instead of ECS EC2. ECS Fargate allows you to run ECS Tasks and AWS will manage the EC2 server fleet for you. Refer to the [Quick Start: Fargate]({% link quick-start.md %}) docs and use those quick start like commands instead. The pricing for Fargate is more because AWS manages the server fleet for you. Refer to [Heroku vs ECS Fargate vs EC2 On-Demand vs EC2 Spot Pricing Comparison](https://blog.boltops.com/2018/04/22/heroku-vs-ecs-fargate-vs-ec2-on-demand-vs-ec2-spot-pricing-comparison) for a pricing comparison.
83
-
84
- Learn more in the next sections.
85
-
86
- {% include prev_next.md %}
@@ -1,135 +0,0 @@
1
- ---
2
- title: Secrets
3
- nav_order: 20
4
- ---
5
-
6
- ## What are Secrets?
7
-
8
- [ECS supports injecting secrets or sensitive data](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data.html) into the the environment as variables. ECS decrypts the secrets straight from AWS to the ECS task environment. It never passes through the machine calling `ufo ship` IE: your laptop, a deploy server, or CodeBuild, etc.
9
-
10
- ECS supports 2 storage backends for secrets:
11
-
12
- 1. [Secrets Manager](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data-secrets.html#secrets-envvar)
13
- 2. [Systems Manager Parameter Store](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data-parameters.html#secrets-envvar-parameters)
14
-
15
- Here are both of the formats:
16
-
17
- Secrets manager format:
18
-
19
- ```json
20
- {
21
- "containerDefinitions": [{
22
- "secrets": [{
23
- "name": "environment_variable_name",
24
- "valueFrom": "arn:aws:secretsmanager:region:aws_account_id:secret:secret_name-AbCdEf"
25
- }]
26
- }]
27
- }
28
- ```
29
-
30
- Parameter store format:
31
-
32
- ```json
33
- {
34
- "containerDefinitions": [{
35
- "secrets": [{
36
- "name": "environment_variable_name",
37
- "valueFrom": "arn:aws:ssm:region:aws_account_id:parameter/parameter_name"
38
- }]
39
- }]
40
- }
41
- ```
42
-
43
- ## UFO Support
44
-
45
- Ufo supports both forms of secrets. You create a `.secrets` file and can reference it in the `.ufo/templates/main.json.erb`
46
-
47
- ```json
48
- {
49
- "family": "<%= @family %>",
50
- # ...
51
- <% if @secrets %>
52
- "secrets": <%= helper.secrets_file(".secrets") %>,
53
- <% end %>
54
- }
55
- ```
56
-
57
- The `.secrets` file is like an env file that will understand a secrets-smart format. Example:
58
-
59
- NAME1=SSM:my/parameter_name
60
- NAME2=SECRETSMANAGER:/my/secret_name-AbCdEf
61
-
62
- The `SSM:` and `SECRETSMANAGER:` prefix will be expanded to the full ARN. You can also just specify the full ARN.
63
-
64
- NAME1=arn:aws:ssm:region:aws_account_id:parameter/my/parameter_name
65
- NAME2=arn:aws:secretsmanager:region:aws_account_id:secret:my/secret_name-AbCdEf
66
-
67
- In turn, this generates:
68
-
69
- ```json
70
- {
71
- "containerDefinitions": [{
72
- "secrets": [
73
- {
74
- "name": "NAME1",
75
- "valueFrom": "arn:aws:ssm:us-west-2:111111111111:parameter/demo/development/foo"
76
- },
77
- {
78
- "name": "NAME2",
79
- "valueFrom": "arn:aws:secretsmanager:us-west-2:111111111111:secret:/demo/development/my-secret-test-qRoJel"
80
- }
81
- ]
82
- }]
83
- }
84
- ```
85
-
86
- ## SSM Parameter Names with Leading Slash
87
-
88
- If your SSM parameter has a leading slash then do **not** include when using it in the .secrets file. Example:
89
-
90
- aws ssm get-parameter --name /demo/development/foo
91
-
92
- So use:
93
-
94
- FOO=SSM:demo/development/foo
95
-
96
- The extra slash seems to confuse ECS. For secretsmanager names, you do include the leading slash.
97
-
98
- ## Substitution
99
-
100
- Ufo also does a simple substition on the value. For example, the `:UFO_ENV` is replaced with the actual value of `UFO_ENV=development`. Example:
101
-
102
- NAME1=SSM:demo/:UFO_ENV/parameter_name
103
- NAME2=SECRETSMANAGER:demo/:UFO_ENV/secret_name-AbCdEf
104
-
105
- Expands to:
106
-
107
- NAME1=arn:aws:ssm:region:aws_account_id:parameter/demo/development/parameter_name
108
- NAME2=arn:aws:secretsmanager:region:aws_account_id:secret:/demo/development/secret_name-AbCdEf
109
-
110
- ## IAM Permission
111
-
112
- If you're using secrets, you'll need to provide an IAM execution role so the EC2 instance has permission to read the secrets. Here's a starter example:
113
-
114
- .ufo/iam_roles/execution_role.rb
115
-
116
- ```ruby
117
- managed_iam_policy("AmazonEC2ContainerRegistryReadOnly")
118
- managed_iam_policy("AmazonSSMReadOnlyAccess")
119
- managed_iam_policy("CloudWatchLogsFullAccess")
120
- managed_iam_policy("SecretsManagerReadWrite")
121
- ```
122
-
123
- More info [ECS IAM Roles]({% link _docs/iam-roles.md %})
124
-
125
- ## Debugging Tip
126
-
127
- Be sure that the secrets exist. If they do not you will see an error like this in the ecs-agent.log:
128
-
129
- /var/log/ecs/ecs-agent.log
130
-
131
- level=info time=2020-06-26T00:59:46Z msg="Managed task [arn:aws:ecs:us-west-2:111111111111:task/development/91828be6a02b48f982cd9122db5e39b2]: error transitioning resource [ssmsecret] to [CREATED]: fetching secret data from SSM Parameter Store in us-west-2: invalid parameters: /my-parameter-name" module=task_manager.go
132
-
133
- Sometimes there is even no error message in the ecs-agent.log. As a debugging step, try removing all secrets and seeing if that the container will start up.
134
-
135
- {% include prev_next.md %}
@@ -1,36 +0,0 @@
1
- ---
2
- title: Settings AWS_PROFILE
3
- short_title: AWS Profile
4
- categories: settings
5
- nav_order: 13
6
- ---
7
-
8
- ## AWS_PROFILE support
9
-
10
- An interesting option is `aws_profile`. Here's an example:
11
-
12
- ```yaml
13
- development:
14
- aws_profile: dev_profile
15
-
16
- production:
17
- aws_profile: prod_profile
18
- ```
19
-
20
- This provides a way to tightly bind `UFO_ENV` to `AWS_PROFILE`. This prevents you from forgetting to switch your `UFO_ENV` when switching your `AWS_PROFILE` thereby accidentally launching a stack in the wrong environment.
21
-
22
-
23
- AWS_PROFILE | UFO_ENV | Notes
24
- --- | --- | ---
25
- dev_profile | development
26
- prod_profile | production
27
- whatever | development | default since whatever is not found in settings.yml
28
-
29
- The binding is two-way. So:
30
-
31
- UFO_ENV=production ufo ship # will deploy to the AWS_PROFILE=prod_profile
32
- AWS_PROFILE=prod_profile ufo ship # will deploy to the UFO_ENV=production
33
-
34
- This behavior prevents you from switching `AWS_PROFILE`s, forgetting to switch `UFO_ENV` and then accidentally deploying a production based docker image to development and vice versa because you forgot to also switch `UFO_ENV` to its respective environment.
35
-
36
- {% include prev_next.md %}
@@ -1,12 +0,0 @@
1
- ---
2
- title: Settings Cfn
3
- short_title: Cfn
4
- categories: settings
5
- nav_order: 14
6
- ---
7
-
8
- ## Customizing Resources
9
-
10
- {% include cfn-customize.md %}
11
-
12
- {% include prev_next.md %}
@@ -1,66 +0,0 @@
1
- ---
2
- title: Settings Cluster
3
- short_title: Cluster
4
- categories: settings
5
- nav_order: 15
6
- ---
7
-
8
- Normally, the ECS cluster defaults to whatever UFO_ENV is set to by [convention]({% link _docs/conventions.md %}). For example, when `UFO_ENV=production` the ECS Cluster is `production` and when `UFO_ENV=development` the ECS Cluster is `development`. There are several ways to override this behavior. Let's go through some examples.
9
-
10
- ## CLI Override
11
-
12
- By default, these are all the same:
13
-
14
- ufo ship demo-web
15
- UFO_ENV=development ufo ship demo-web # same
16
- UFO_ENV=development ufo ship demo-web --cluster development # same
17
-
18
- If you use a specific `UFO_ENV=production`, these are the same
19
-
20
- UFO_ENV=production ufo ship demo-web
21
- UFO_ENV=production ufo ship demo-web --cluster production # same
22
-
23
- Override the convention by explicitly specifying the `--cluster` option in the CLI.
24
-
25
- ufo ship demo-web --cluster custom-cluster # override the cluster
26
- UFO_ENV=production ufo ship demo-web --cluster production-cluster # override the cluster
27
-
28
- The cavaet is that you must remember to specify `--cluster`. A wrapper `bin/deploy` script could be useful here.
29
-
30
- ## Environment Cluster Setting
31
-
32
- If you don't want to specify the `--cluster` option in the command repeatedly, you can configure the cluster based on the the UFO_ENV. Setting the `cluster` option in the `settings.yml` file:
33
-
34
- ```yaml
35
- development:
36
- cluster: dev
37
-
38
- production:
39
- cluster: prod
40
- ```
41
-
42
- ## Service Cluster Setting
43
-
44
- Another interesting way of specifying the cluster to use is with the `service_cluster` option. The `service_cluster` option takes a Hash value. Here's an example:
45
-
46
- ```yaml
47
- base:
48
- service_cluster:
49
- demo-web: web-fleet
50
- demo-worker: worker-fleet
51
- ```
52
-
53
- In this example, ufo will deploy the demo-web service to the web-fleet ECS cluster and the demo-worker service to the worker-fleet ECS cluster.
54
-
55
- Also since the service_cluster is configured in the base section, it is used for all `UFO_ENV=development`, `UFO_ENV=production`, etc.
56
-
57
- ## Precendence
58
-
59
- The precedence of the settings from highest to lowest is:
60
-
61
- * cli option
62
- * service_cluster service specific setting
63
- * cluster environment setting
64
- * UFO_ENV default convention
65
-
66
- {% include prev_next.md %}
@@ -1,24 +0,0 @@
1
- ---
2
- title: Managed Security Groups
3
- short_title: Security Groups
4
- categories: settings
5
- nav_order: 16
6
- ---
7
-
8
- Ufo creates and manages two security groups. One for the ELB and one for the ECS tasks. Details here: [UFO Security Groups]({% link _docs/extras/security-groups.md %}).
9
-
10
- You can disable the creation of managed security groups with: `managed_security_groups: false`. Example:
11
-
12
- ```yaml
13
- base:
14
- image: tongueroo/demo-ufo
15
- managed_security_groups: false
16
- ```
17
-
18
- ## Why?
19
-
20
- Security Groups managed by UFO are transient. If you delete the UFO app and recreate it entirely. Any manual changes to the security groups will be lost.
21
-
22
- You can precreate security groups and add them generated UFO CloudFormation template, see [Settings Network]({% link _docs/settings/network.md %}). So then you won't lose any manual changes. If you're taking this approach, it's nice to have UFO not create any managed security groups at all. This removes security group clutter.
23
-
24
- {% include prev_next.md %}
@@ -1,45 +0,0 @@
1
- ---
2
- title: Settings Network
3
- short_title: Network
4
- categories: settings
5
- nav_order: 17
6
- ---
7
-
8
- The settings.yml file references a network settings file with the `network_profile` option. This file has configurations that are related to the network. The source code for the starter template file is at [network/default.yml.tt](https://github.com/tongueroo/ufo/blob/master/lib/template/.ufo/settings/network/default.yml.tt) Here's an example network settings file.
9
-
10
- ```
11
- ---
12
- vpc: vpc-11111111
13
- ecs_subnets: # at least 2 subnets required
14
- - subnet-11111111
15
- - subnet-22222222
16
- elb_subnets: # defaults to same subnets as ecs_subnets when not set
17
- - subnet-33333333
18
- - subnet-44444444
19
-
20
- # Optional existing security group ids to add in addition to the ones created by ufo.
21
- # elb_security_groups:
22
- # - sg-aaa
23
- # ecs_security_groups:
24
- # - sg-bbb
25
-
26
- # Also supports extra security groups specific to each ECS service.
27
- # So you can target security groups on a per-role basis.
28
- # ecs_security_groups:
29
- # demo-web:
30
- # - sg-bbb
31
- # - sg-ccc
32
- # demo-worker:
33
- # - sg-bbb
34
- # - sg-ccc
35
- ```
36
-
37
- Option | Description
38
- --- | ---
39
- vpc | Used to create ecs and elb security groups, target group in the CloudFormation template.
40
- ecs_subnets | Used to assign a subnet mapping to the ECS service created in CloudFormation when the network mode is awsvpc. Also used to in .ufo/params.yml as part of the run_task api call that is made by `ufo task`.
41
- elb_subnets | Used to create elb load balancer. Defaults to same subnets as ecs_subnets when not set.
42
- ecs_security_groups | Additional security groups to associate with the ECS tasks.
43
- elb_security_groups | Additional security groups to associate with the ELB.
44
-
45
- {% include prev_next.md %}
@@ -1,55 +0,0 @@
1
- ---
2
- title: Settings
3
- nav_order: 12
4
- ---
5
-
6
- The behavior of ufo can be configured with a `settings.yml` file. A starter project `.ufo/settings.yml` file is generated as part of the `ufo init` command. There are can be multiple settings files. The options from the files get merged and respected in the following precedence:
7
-
8
- 1. current folder - The current folder's `.ufo/settings.yml` values take the highest precedence.
9
- 2. user - The user's `~/.ufo/settings.yml` values take the second highest precedence.
10
- 3. default - The [default settings](https://github.com/tongueroo/ufo/blob/master/lib/ufo/default/settings.yml) bundled with the tool takes the lowest precedence.
11
-
12
- Let's take a look at an example `settings.yml`:
13
-
14
- ```yaml
15
- base:
16
- image: tongueroo/demo-ufo
17
- # clean_keep: 30 # cleans up docker images on your docker server.
18
- # ecr_keep: 30 # cleans up images on ECR and keeps this remaining amount. Defaults to keep all.
19
- # network_profile: default # .ufo/settings/network/default.yml file
20
- # cfn_profile: default # .ufo/settings/cfn/default.yml file
21
-
22
- development:
23
- # cluster: dev # uncomment if you want the cluster name be other than the default
24
- # the default is to match UFO_ENV. So UFO_ENV=development means the ECS
25
- # cluster will be name development
26
- # The aws_profile tightly binds UFO_ENV to AWS_PROFILE and vice-versa.
27
- # aws_profile: dev_profile
28
-
29
- production:
30
- # cluster: prod
31
- # aws_profile: prod_profile
32
- ```
33
-
34
- The table below covers each setting:
35
-
36
- Setting | Description
37
- ------------- | -------------
38
- aws_profile | If you have the `AWS_PROFILE` environment variable set, this will ensure that you are deploying the right `UFO_ENV` to the right AWS environment. It is explained below.
39
- cfn_profile | The name of the cfn profile settings file to use. Maps to .ufo/settings/cfn/NAME.yml file. Will match an `UFO_ENV` file if it exists. IE: .ufo/settings/cfn/development.yml. Otherwise it defaults to .ufo/settings/cfn/default.yml.
40
- clean_keep | Docker images generated from ufo are cleaned up automatically for you at the end of `ufo ship`. This controls how many docker images to keep around. The default is 3.
41
- cluster | By convention, the ECS cluster that ufo deploys to matches the `UFO_ENV`. If `UFO=development`, then `ufo ship` deploys to the `development` ECS cluster. This is option overrides this convention.
42
- ecr_keep | If you are using AWS ECR, then the ECR images can also be automatically cleaned up at the end of `ufo ship`. By default this is set to `nil` and all AWS ECR are kept.
43
- image | The `image` value is the name that ufo will use for the Docker image name to be built. Only provide the basename part of the image name without the tag because ufo automatically generates the tag for you. For example, `tongueroo/demo-ufo` is correct and `tongueroo/demo-ufo:my-tag` is incorrect.
44
- managed\_security\_groups | Create managed security groups for application ELBs. Defaults to true. If you disable it with false then no managed security groups will be created by UFO.
45
- network_profile | The name of the network profile settings file to use. Maps to .ufo/settings/network/NAME.yml file. Will match an `UFO_ENV` file if it exists. IE: .ufo/settings/network/development.yml. Otherwise it defaults to .ufo/settings/network/default.yml.
46
-
47
- ## AWS_PROFILE support
48
-
49
- An interesting option is `aws_profile`. This allows you to tightly connect an AWS_PROFILE to a UFO_ENV. The details are in the [Settings AWS_PROFILE docs]({% link _docs/settings/aws_profile.md %}).
50
-
51
- ## ECS Cluster Convention
52
-
53
- Normally, the ECS cluster defaults to whatever UFO_ENV is set to by [convention]({% link _docs/conventions.md %}). For example, when `UFO_ENV=production` the ECS Cluster is `production` and when `UFO_ENV=development` the ECS Cluster is `development`. There are several ways to override this behavior. This is detailed in the [Settings Cluster docs]({% link _docs/settings/cluster.md %}).
54
-
55
- {% include prev_next.md %}
@@ -1,40 +0,0 @@
1
- ---
2
- Title: SSL Errors
3
- ---
4
-
5
- UFO uses the AWS Ruby SDK and the underlying default SSL certificate chain configured in your active Ruby and
6
- OpenSSL to communicate to your AWS environment. This means that you _must correctly configure_ your Ruby and OpenSSL to have all the needed ROOT certificates for UFO to be able to communicate to AWS - _especially_ if you are behind a proxy or a corporate SSL-Proxy.
7
-
8
- If you are behind a corporate SSL proxy and you have not updated system, OpenSSL and Ruby certificate chains to include the needed corporate root certificates, you will see errors, such as:
9
-
10
- ```
11
- Seahorse::Client::NetworkingError: SSL_connect returned=1 errno=0 state=error: certificate verify failed (self signed certificate in certificate chain)
12
- ~/.rbenv/versions/2.6.0/lib/ruby/2.6.0/net/protocol.rb:44:in `connect_nonblock'
13
- ~/.rbenv/versions/2.6.0/lib/ruby/2.6.0/net/protocol.rb:44:in `ssl_socket_connect'
14
- ~/.rbenv/versions/2.6.0/lib/ruby/2.6.0/net/http.rb:996:in `connect'
15
- ~/.rbenv/versions/2.6.0/lib/ruby/2.6.0/net/http.rb:930:in `do_start'
16
- ~/.rbenv/versions/2.6.0/lib/ruby/2.6.0/net/http.rb:925:in `start'
17
- ```
18
-
19
- ## Helper Scripts
20
-
21
- The `docs/utils` directory has a few scripts that should be able to help you resolve these issues and track down which certs are giving you problems.
22
-
23
- - `ssl-doctor.rb` is from the very useful examples at <https://github.com/mislav/ssl-tools>, and it can help you find the missing ROOT cert in your certificate chain and give suggestion on getting OpenSSL working correctly.
24
- - `update-cert-chains.sh` will help you update your Ruby and OpenSSL chains by adding in the missing ROOT cert and also pulling in the OSX System Root to your rbenv environment.
25
- - `test-aws-api-access.rb` should now return a list of the S3 buckets for the current AWS profile that is active.
26
-
27
- ## Trouble-shooting
28
-
29
- ### Update Brew and OpenSSL
30
-
31
- - `brew update`
32
- - `brew upgrade openssl`
33
-
34
- ### Use the Helper Scripts to find the trouble spot
35
-
36
- Once you have updated OpenSSL and your `brew` packages, use the helper scripts above to see if you can track down the missing certificate in your certificate chain.
37
-
38
- The `update-cert-chain.sh` file was created using the suggestions from <https://gemfury.com/help/could-not-verify-ssl-certificate/>. Please review the information at <https://gemfury.com/help/could-not-verify-ssl-certificate/> if the `Helper Scripts` above do not fully resolve your issue.
39
-
40
- The `test-aws-api-access.rb` uses examples from the <https://docs.aws.amazon.com/sdk-for-ruby/v3/developer-guide/quick-start-guide.html> for using and configuring the Ruby AWS SDK on your system.
@@ -1,41 +0,0 @@
1
- ---
2
- title: Structure
3
- nav_order: 11
4
- ---
5
-
6
- Ufo creates a `.ufo` folder within your project which contains the required files used by ufo to build and deploy docker images to ECS. The standard directory structure of the `.ufo` folder looks like this:
7
-
8
- ```sh
9
- .ufo
10
- ├── output
11
- ├── params.yml
12
- ├── settings.yml
13
- ├── settings/cfn/default.yml
14
- ├── settings/network/default.yml
15
- ├── task_definitions.rb
16
- ├── templates
17
- | └── main.json.erb
18
- └── variables
19
- ├── base.rb
20
- ├── production.rb
21
- └── development.rb
22
- ```
23
-
24
- The table below covers the purpose of each folder and file.
25
-
26
- File / Directory | Description
27
- ------------- | -------------
28
- iam_roles/ | Where ufo managed iam roles associated with the task definition can be defined. For more details see: [IAM Roles]({% link _docs/iam-roles.md %}).
29
- output/ | The folder where the generated task definitions are written to. The way the task definitions are generated is covered in [ufo tasks build]({% link _docs/tutorial-ufo-tasks-build.md %}).
30
- params | This is where you can adjust the params that get send to the aws-sdk api calls for the [ufo task](https://ufoships.com/reference/ufo-task/) command. More info at [Params]({% link _docs/ufo-task-params.md %}).
31
- settings.yml | Ufo's general settings file, where you adjust the default [settings]({% link _docs/settings.md %}).
32
- settings/cfn/default.yml | Ufo's cfn settings. You can customize the CloudFormation resource properties here.
33
- settings/network/default.yml | Ufo's network settings. You can customize the vpc and subnets to used here.
34
- task_definitions.rb | This is where you define the task definitions and specify the variables to be used by the ERB templates.
35
- templates/ | The ERB templates with the task definition json code. The templates are covered in more detail in [ufo tasks build]({% link _docs/tutorial-ufo-tasks-build.md %}).
36
- templates/main.json.erb | This is the main and starter template task definition json file that ufo initially generates.
37
- variables | This is where you can define shared variables that are made available to the `template_definitions.rb` and your templates. More info at [Variables]({% link _docs/variables.md %}).
38
-
39
- Now that you know where the ufo configurations are located and what they look like, let’s use ufo!
40
-
41
- {% include prev_next.md %}
@@ -1,61 +0,0 @@
1
- ---
2
- title: Build Docker
3
- nav_order: 6
4
- ---
5
-
6
- ## Build the Docker Image
7
-
8
- Let's use the `ufo docker build` command to build the docker image. The command uses the `Dockerfile` in the current project to build the docker image. You use your own Dockerfile so you have fully control over how you would like the image to be built. For this tutorial we will continue to use the [tongueroo/demo-ufo](https://github.com/tongueroo/demo-ufo) app and it's Dockerfile. Let's run the command:
9
-
10
- ```sh
11
- ufo docker build
12
- ```
13
-
14
- You should see similar output (some of the output has been truncated for conciseness):
15
-
16
- ```sh
17
- $ ufo docker build
18
- Building docker image with:
19
- docker build -t tongueroo/demo-ufo:ufo-2018-06-28T16-33-57-7e0af94 -f Dockerfile .
20
- Sending build context to Docker daemon 128kB
21
- Step 1/10 : FROM ruby:2.5.1
22
- ---> 857bc7ff918f
23
- Step 2/10 : WORKDIR /app
24
- ---> Using cache
25
- ---> 4e93fbb496c9
26
- ...
27
- Step 10/10 : CMD bin/web
28
- ---> Running in cd63ebaec8aa
29
- ---> 14852737c639
30
- Removing intermediate container cd63ebaec8aa
31
- Successfully built 14852737c639
32
- Successfully tagged tongueroo/demo-ufo:ufo-2018-06-28T16-33-57-7e0af94
33
- Docker image tongueroo/demo-ufo:ufo-2018-06-28T16-33-57-7e0af94 built.
34
- Docker build took 2s.
35
- ```
36
-
37
- As you can see `ufo docker build` shells out and calls `docker build -t tongueroo/demo-ufo:ufo-2017-06-11T22-18-03-a18aa30 -f Dockerfile .`. The docker image tag that is generated contains a useful timestamp and the current HEAD git sha of the project that you are on.
38
-
39
- By default when you are running `ufo docker build` directly it does not push the docker image to the registry. If you would like it to push the built image to a registry at the end of the build use the `--push` flag.
40
-
41
- ```sh
42
- ufo docker build --push
43
- ```
44
-
45
- You can also use the `ufo docker push` command which will push the last built image from `ufo docker build`.
46
-
47
- ```
48
- ufo docker push
49
- ```
50
-
51
- You should see the image being pushed with a message that looks something like this:
52
-
53
- ```sh
54
- Pushed tongueroo/demo-ufo:ufo-2018-06-28T16-33-57-7e0af94 docker image.
55
- Docker push took 12s.
56
- ```
57
-
58
-
59
- Note in order to push the image to a registry you will need to login into the registry. If you are using DockerHub use the `docker login` command. If you are using AWS ECR then ufo automatically calls the `aws ecr get-login` command and authenticates for you.
60
-
61
- {% include prev_next.md %}