ufo 4.5.11 → 5.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (134) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +29 -0
  3. data/README.md +2 -0
  4. data/docs/_docs/conventions.md +1 -1
  5. data/docs/_docs/extras/codebuild-iam-role.md +2 -2
  6. data/docs/_docs/extras/dockerfile-erb.md +2 -2
  7. data/docs/_docs/extras/ecs-network-mode.md +2 -2
  8. data/docs/_docs/extras/load-balancer.md +2 -2
  9. data/docs/_docs/extras/minimal-deploy-iam.md +2 -2
  10. data/docs/_docs/extras/notification-arns.md +21 -0
  11. data/docs/_docs/extras/redirection-support.md +2 -2
  12. data/docs/_docs/extras/route53-support.md +2 -2
  13. data/docs/_docs/extras/security-groups.md +2 -2
  14. data/docs/_docs/extras/ssl-support.md +2 -2
  15. data/docs/_docs/faq.md +2 -2
  16. data/docs/_docs/helpers.md +7 -5
  17. data/docs/_docs/iam-roles.md +111 -0
  18. data/docs/_docs/install.md +1 -1
  19. data/docs/_docs/more/auto-completion.md +2 -2
  20. data/docs/_docs/more/automated-cleanup.md +2 -2
  21. data/docs/_docs/more/customize-cloudformation.md +2 -2
  22. data/docs/_docs/more/migrations.md +2 -2
  23. data/docs/_docs/more/run-in-pieces.md +2 -2
  24. data/docs/_docs/more/single-task.md +2 -2
  25. data/docs/_docs/more/stuck-cloudformation.md +2 -2
  26. data/docs/_docs/more/why-cloudformation.md +2 -2
  27. data/docs/_docs/next-steps.md +2 -2
  28. data/docs/_docs/quick-start-ec2.md +2 -1
  29. data/docs/_docs/secrets.md +112 -0
  30. data/docs/_docs/settings.md +1 -1
  31. data/docs/_docs/settings/aws_profile.md +1 -1
  32. data/docs/_docs/settings/cfn.md +1 -1
  33. data/docs/_docs/settings/cluster.md +8 -14
  34. data/docs/_docs/settings/network.md +1 -1
  35. data/docs/_docs/ssl_errors.md +1 -2
  36. data/docs/_docs/structure.md +1 -1
  37. data/docs/_docs/tutorial-ufo-docker-build.md +1 -1
  38. data/docs/_docs/tutorial-ufo-init.md +1 -1
  39. data/docs/_docs/tutorial-ufo-ship.md +1 -1
  40. data/docs/_docs/tutorial-ufo-ships.md +1 -1
  41. data/docs/_docs/tutorial-ufo-tasks-build.md +1 -1
  42. data/docs/_docs/tutorial.md +1 -1
  43. data/docs/_docs/ufo-current.md +2 -2
  44. data/docs/_docs/ufo-env-extra.md +2 -2
  45. data/docs/_docs/ufo-env.md +2 -2
  46. data/docs/_docs/ufo-logs.md +50 -0
  47. data/docs/_docs/ufo-task-params.md +2 -2
  48. data/docs/_docs/upgrading.md +2 -2
  49. data/docs/_docs/upgrading/upgrade4.5.md +2 -2
  50. data/docs/_docs/upgrading/upgrade4.md +2 -2
  51. data/docs/_docs/variables.md +1 -1
  52. data/docs/_includes/subnav.html +4 -0
  53. data/docs/_reference/ufo-deploy.md +1 -2
  54. data/docs/_reference/ufo-init.md +1 -1
  55. data/docs/_reference/ufo-logs.md +40 -0
  56. data/docs/_reference/ufo-rollback.md +2 -0
  57. data/docs/_reference/ufo-ship.md +1 -2
  58. data/docs/_reference/ufo-ships.md +1 -2
  59. data/docs/_reference/ufo-tasks-build.md +1 -2
  60. data/docs/articles.md +2 -2
  61. data/docs/docs.md +1 -1
  62. data/docs/quick-start.md +2 -1
  63. data/docs/reference.md +1 -0
  64. data/lib/template/.secrets +3 -0
  65. data/lib/template/.ufo/settings.yml.tt +1 -0
  66. data/lib/template/.ufo/settings/cfn/default.yml.tt +27 -27
  67. data/lib/template/.ufo/settings/network/default.yml.tt +9 -0
  68. data/lib/template/.ufo/templates/fargate.json.erb +3 -0
  69. data/lib/template/.ufo/templates/main.json.erb +3 -0
  70. data/lib/template/.ufo/variables/base.rb.tt +1 -0
  71. data/lib/ufo.rb +2 -1
  72. data/lib/ufo/autoloader.rb +9 -0
  73. data/lib/ufo/cli.rb +12 -1
  74. data/lib/ufo/command.rb +7 -0
  75. data/lib/ufo/core.rb +1 -9
  76. data/lib/ufo/docker/cleaner.rb +1 -1
  77. data/lib/ufo/dsl.rb +6 -1
  78. data/lib/ufo/dsl/helper.rb +21 -27
  79. data/lib/ufo/dsl/helper/vars.rb +98 -0
  80. data/lib/ufo/dsl/outputter.rb +12 -9
  81. data/lib/ufo/help/init.md +1 -1
  82. data/lib/ufo/help/logs.md +10 -0
  83. data/lib/ufo/log_group.rb +1 -0
  84. data/lib/ufo/logs.rb +56 -0
  85. data/lib/ufo/role/builder.rb +66 -0
  86. data/lib/ufo/role/dsl.rb +21 -0
  87. data/lib/ufo/role/registry.rb +24 -0
  88. data/lib/ufo/rollback.rb +2 -1
  89. data/lib/ufo/setting/profile.rb +11 -7
  90. data/lib/ufo/setting/security_groups.rb +22 -0
  91. data/lib/ufo/settings.rb +20 -0
  92. data/lib/ufo/stack.rb +24 -24
  93. data/lib/ufo/stack/builder.rb +26 -0
  94. data/lib/ufo/stack/builder/base.rb +54 -0
  95. data/lib/ufo/stack/builder/conditions.rb +23 -0
  96. data/lib/ufo/stack/builder/outputs.rb +24 -0
  97. data/lib/ufo/stack/builder/parameters.rb +45 -0
  98. data/lib/ufo/stack/builder/resources.rb +20 -0
  99. data/lib/ufo/stack/builder/resources/base.rb +4 -0
  100. data/lib/ufo/stack/builder/resources/dns.rb +17 -0
  101. data/lib/ufo/stack/builder/resources/ecs.rb +63 -0
  102. data/lib/ufo/stack/builder/resources/elb.rb +45 -0
  103. data/lib/ufo/stack/builder/resources/listener.rb +42 -0
  104. data/lib/ufo/stack/builder/resources/listener_ssl.rb +16 -0
  105. data/lib/ufo/stack/builder/resources/roles/base.rb +22 -0
  106. data/lib/ufo/stack/builder/resources/roles/execution_role.rb +4 -0
  107. data/lib/ufo/stack/builder/resources/roles/task_role.rb +4 -0
  108. data/lib/ufo/stack/builder/resources/security_group/base.rb +4 -0
  109. data/lib/ufo/stack/builder/resources/security_group/ecs.rb +44 -0
  110. data/lib/ufo/stack/builder/resources/security_group/ecs_rule.rb +25 -0
  111. data/lib/ufo/stack/builder/resources/security_group/elb.rb +57 -0
  112. data/lib/ufo/stack/builder/resources/target_group.rb +39 -0
  113. data/lib/ufo/stack/builder/resources/task_definition.rb +24 -0
  114. data/lib/ufo/stack/builder/resources/task_definition/reconstructor.rb +49 -0
  115. data/lib/ufo/stack/context.rb +41 -48
  116. data/lib/ufo/stack/custom_properties.rb +59 -0
  117. data/lib/ufo/stack/helper.rb +2 -5
  118. data/lib/ufo/stack/template_body.rb +13 -0
  119. data/lib/ufo/task.rb +2 -7
  120. data/lib/ufo/tasks.rb +1 -1
  121. data/lib/ufo/tasks/builder.rb +0 -1
  122. data/lib/ufo/tasks/register.rb +11 -8
  123. data/lib/ufo/template_scope.rb +1 -66
  124. data/lib/ufo/utils/squeezer.rb +24 -0
  125. data/lib/ufo/version.rb +1 -1
  126. data/spec/fixtures/iam_roles/task_role.rb +17 -0
  127. data/spec/fixtures/mocks/logs/awslogs.json +70 -0
  128. data/spec/fixtures/mocks/logs/no-awslogs.json +70 -0
  129. data/spec/lib/logs_spec.rb +55 -0
  130. data/spec/lib/role/builder_spec.rb +67 -0
  131. data/spec/lib/role/dsl_spec.rb +12 -0
  132. data/ufo.gemspec +2 -0
  133. metadata +82 -5
  134. data/lib/cfn/stack.yml +0 -283
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Stuck CloudFormation
3
- nav_order: 38
3
+ nav_order: 39
4
4
  ---
5
5
 
6
6
  The CloudFormation stack update or creation can get stuck in a `*_IN_PROGRESS` state for a very long time, like more than an hour. This happens when you deploy an ECS service that fails to stabilize. Usually, this is an error with the Docker container failing to start up successfully.
@@ -26,4 +26,4 @@ To cancel a current deploy, run:
26
26
 
27
27
  This is the same thing as canceling the stack update in the CloudFormation console.
28
28
 
29
- {% include prev_next.md %}
29
+ {% include prev_next.md %}
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Why CloudFormation
3
- nav_order: 36
3
+ nav_order: 37
4
4
  ---
5
5
 
6
6
  Version 3 of ufo was a simpler implementation and did not make use of CloudFormation to create the ECS service. In version 4, ufo uses CloudFormation to create the ECS Service. This is because ufo became more powerful. Notably, support for Load Balancers was added. With this power, also came added complexity. So the complexity was push onto CloudFormation. Hence, ECS service is implemented as CloudFormation resource in version 4.
@@ -18,4 +18,4 @@ You can check the resources created with CloudFormation by clicking on the stack
18
18
 
19
19
  <img src="/img/docs/cloudformation-resources.png" class="doc-photo" />
20
20
 
21
- {% include prev_next.md %}
21
+ {% include prev_next.md %}
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Next Steps
3
- nav_order: 46
3
+ nav_order: 47
4
4
  ---
5
5
 
6
6
  This concludes the tutorial guide for ufo. Hopefully you are now more comfortable with ufo's basic usage, concepts, and have a feel for the workflow.
@@ -13,4 +13,4 @@ From here, there are a few resources that can help you continue along:
13
13
 
14
14
  Everyone can contribute to make ufo better, including the documentation. These docs are of the same ufo repo in the [docs folder](https://github.com/tongueroo/ufo/tree/master/docs). Please fork the project and open a pull request! We love your pull requests. Contributions are encouraged and welcomed!
15
15
 
16
- {% include prev_next.md %}
16
+ {% include prev_next.md %}
@@ -26,6 +26,7 @@ This quickstart assumes:
26
26
 
27
27
  * You have push access to the repo. Refer to the Notes "Repo Push Access" section below for more info.
28
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.
29
30
 
30
31
  ## What Happened
31
32
 
@@ -82,4 +83,4 @@ If you would like not to manage the EC2 server fleet, you are looking for ECS Fa
82
83
 
83
84
  Learn more in the next sections.
84
85
 
85
- {% include prev_next.md %}
86
+ {% include prev_next.md %}
@@ -0,0 +1,112 @@
1
+ ---
2
+ title: Secrets
3
+ ---
4
+
5
+ ## What are Secrets?
6
+
7
+ [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 handles the decryption the secrets go 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.
8
+
9
+ ECS supports 2 storage backends for secrets:
10
+
11
+ 1. [Secrets Manager](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data-secrets.html#secrets-envvar)
12
+ 2. [Systems Manager Parameter Store](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data-parameters.html#secrets-envvar-parameters)
13
+
14
+ Here are both of the formats:
15
+
16
+ Secrets manager format:
17
+
18
+ ```json
19
+ {
20
+ "containerDefinitions": [{
21
+ "secrets": [{
22
+ "name": "environment_variable_name",
23
+ "valueFrom": "arn:aws:secretsmanager:region:aws_account_id:secret:secret_name-AbCdEf"
24
+ }]
25
+ }]
26
+ }
27
+ ```
28
+
29
+ Parameter store format:
30
+
31
+ ```json
32
+ {
33
+ "containerDefinitions": [{
34
+ "secrets": [{
35
+ "name": "environment_variable_name",
36
+ "valueFrom": "arn:aws:ssm:region:aws_account_id:parameter/parameter_name"
37
+ }]
38
+ }]
39
+ }
40
+ ```
41
+
42
+ ## UFO Support
43
+
44
+ Ufo supports both forms of secrets. You create a `.secrets` file and can reference it in the `.ufo/templates/main.json.erb`
45
+
46
+ ```json
47
+ {
48
+ "family": "<%= @family %>",
49
+ # ...
50
+ <% if @secrets %>
51
+ "secrets": <%= helper.secrets_file(".secrets") %>,
52
+ <% end %>
53
+ }
54
+ ```
55
+
56
+ The `.secrets` file is like an env file that will understand a secrets-smart format. Example:
57
+
58
+ NAME1=SSM:/my/parameter_name
59
+ NAME2=SECRETSMANAGER:/my/secret_name-AbCdEf
60
+
61
+ The `SSM:` and `SECRETSMANAGER:` prefix will be expanded to the full ARN. You can also just specify the full ARN.
62
+
63
+ NAME1=arn:aws:ssm:region:aws_account_id:parameter/my/parameter_name
64
+ NAME2=arn:aws:secretsmanager:region:aws_account_id:secret:my/secret_name-AbCdEf
65
+
66
+ In turn, this generates:
67
+
68
+ ```json
69
+ {
70
+ "containerDefinitions": [{
71
+ "secrets": [
72
+ {
73
+ "name": "NAME1",
74
+ "valueFrom": "arn:aws:ssm:us-west-2:536766270177:parameter/demo/development/foo"
75
+ },
76
+ {
77
+ "name": "NAME2",
78
+ "valueFrom": "arn:aws:secretsmanager:us-west-2:536766270177:secret:/demo/development/my-secret-test-qRoJel"
79
+ }
80
+ ]
81
+ }]
82
+ }
83
+ ```
84
+
85
+ ## Substitution
86
+
87
+ 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:
88
+
89
+ NAME1=SSM:demo/:UFO_ENV/parameter_name
90
+ NAME2=SECRETSMANAGER:demo/:UFO_ENV/secret_name-AbCdEf
91
+
92
+ Expands to:
93
+
94
+ NAME1=arn:aws:ssm:region:aws_account_id:parameter/demo/development/parameter_name
95
+ NAME2=arn:aws:secretsmanager:region:aws_account_id:secret:/demo/development/secret_name-AbCdEf
96
+
97
+ ## IAM Permission
98
+
99
+ 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:
100
+
101
+ .ufo/iam_roles/execution_role.rb
102
+
103
+ ```ruby
104
+ managed_iam_policy("AmazonEC2ContainerRegistryReadOnly")
105
+ managed_iam_policy("AmazonSSMReadOnlyAccess")
106
+ managed_iam_policy("CloudWatchLogsFullAccess")
107
+ managed_iam_policy("SecretsManagerReadWrite")
108
+ ```
109
+
110
+ More info [ECS IAM Roles]({% link _docs/iam-roles.md %})
111
+
112
+ {% include prev_next.md %}
@@ -51,4 +51,4 @@ An interesting option is `aws_profile`. This allows you to tightly connect an A
51
51
 
52
52
  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 %}).
53
53
 
54
- {% include prev_next.md %}
54
+ {% include prev_next.md %}
@@ -33,4 +33,4 @@ The binding is two-way. So:
33
33
 
34
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
35
 
36
- {% include prev_next.md %}
36
+ {% include prev_next.md %}
@@ -9,4 +9,4 @@ nav_order: 14
9
9
 
10
10
  {% include cfn-customize.md %}
11
11
 
12
- {% include prev_next.md %}
12
+ {% include prev_next.md %}
@@ -11,25 +11,19 @@ Normally, the ECS cluster defaults to whatever UFO_ENV is set to by [convention]
11
11
 
12
12
  By default, these are all the same:
13
13
 
14
- ```sh
15
- ufo ship demo-web
16
- UFO_ENV=development ufo ship demo-web # same
17
- UFO_ENV=development ufo ship demo-web --cluster development # same
18
- ```
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
19
17
 
20
18
  If you use a specific `UFO_ENV=production`, these are the same
21
19
 
22
- ```
23
- UFO_ENV=production ufo ship demo-web
24
- UFO_ENV=production ufo ship demo-web --cluster production # same
25
- ```
20
+ UFO_ENV=production ufo ship demo-web
21
+ UFO_ENV=production ufo ship demo-web --cluster production # same
26
22
 
27
23
  Override the convention by explicitly specifying the `--cluster` option in the CLI.
28
24
 
29
- ```sh
30
- ufo ship demo-web --cluster custom-cluster # override the cluster
31
- UFO_ENV=production ufo ship demo-web --cluster production-cluster # override the cluster
32
- ```
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
33
27
 
34
28
  The cavaet is that you must remember to specify `--cluster`. A wrapper `bin/deploy` script could be useful here.
35
29
 
@@ -69,4 +63,4 @@ The precedence of the settings from highest to lowest is:
69
63
  * cluster environment setting
70
64
  * UFO_ENV default convention
71
65
 
72
- {% include prev_next.md %}
66
+ {% include prev_next.md %}
@@ -32,4 +32,4 @@ elb_subnets | Used to create elb load balancer. Defaults to same subnets as ecs
32
32
  ecs_security_groups | Additional security groups to associate with the ECS tasks.
33
33
  elb_security_groups | Additional security groups to associate with the ELB.
34
34
 
35
- {% include prev_next.md %}
35
+ {% include prev_next.md %}
@@ -1,6 +1,5 @@
1
1
  ---
2
2
  Title: SSL Errors
3
- # nav_order:
4
3
  ---
5
4
 
6
5
  UFO uses the AWS Ruby SDK and the underlying default SSL certificate chain configured in your active Ruby and
@@ -38,4 +37,4 @@ Once you have updated OpenSSL and your `brew` packages, use the helper scripts a
38
37
 
39
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.
40
39
 
41
- 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.
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.
@@ -37,4 +37,4 @@ File / Directory | Description
37
37
 
38
38
  Now that you know where the ufo configurations are located and what they look like, let’s use ufo!
39
39
 
40
- {% include prev_next.md %}
40
+ {% include prev_next.md %}
@@ -58,4 +58,4 @@ Docker push took 12s.
58
58
 
59
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
60
 
61
- {% include prev_next.md %}
61
+ {% include prev_next.md %}
@@ -89,4 +89,4 @@ The `image` value is the name that ufo will use as a base portion of the name to
89
89
 
90
90
  The other settings are optional. You can learn more about them at [Settings]({% link _docs/settings.md %}).
91
91
 
92
- {% include prev_next.md %}
92
+ {% include prev_next.md %}
@@ -92,4 +92,4 @@ We've been typing the `demo-web` service name explicitly. We can set the curren
92
92
 
93
93
  Congratulations 🎊 You have successfully built a Docker image, register it and deployed it to AWS ECS.
94
94
 
95
- {% include prev_next.md %}
95
+ {% include prev_next.md %}
@@ -35,4 +35,4 @@ ufo ships demo-{web,worker,clock}
35
35
 
36
36
  In the case of the `ufo ships` command the `--wait` option defaults to false so that all the specified ECS services update in parallel. You can check on the status of the update on the CloudFormation console.
37
37
 
38
- {% include prev_next.md %}
38
+ {% include prev_next.md %}
@@ -174,4 +174,4 @@ demo-worker task definition registered.
174
174
  $
175
175
  ```
176
176
 
177
- {% include prev_next.md %}
177
+ {% include prev_next.md %}
@@ -11,4 +11,4 @@ In the next sections, we'll walk through using ufo in detail. We will ufo-ify a
11
11
 
12
12
  Let's start!
13
13
 
14
- {% include prev_next.md %}
14
+ {% include prev_next.md %}
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Ufo Current
3
- nav_order: 22
3
+ nav_order: 23
4
4
  ---
5
5
 
6
6
  ## service
@@ -46,4 +46,4 @@ This can be shorten with with current also.
46
46
  ufo current --services demo-web demo-worker demo-clock
47
47
  ufo ships
48
48
 
49
- {% include prev_next.md %}
49
+ {% include prev_next.md %}
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: UFO_ENV_EXTRA
3
- nav_order: 21
3
+ nav_order: 22
4
4
  ---
5
5
 
6
6
  <div class="video-box"><div class="video-container"><iframe src="https://www.youtube.com/embed/UVQuwQGToYE" frameborder="0" allowfullscreen=""></iframe></div></div>
@@ -19,4 +19,4 @@ The precedence:
19
19
  1. UFO_ENV_EXTRA - takes highest precedence
20
20
  2. `.ufo/current` env-extra setting - takes lower precedence
21
21
 
22
- {% include prev_next.md %}
22
+ {% include prev_next.md %}
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: UFO_ENV
3
- nav_order: 20
3
+ nav_order: 21
4
4
  ---
5
5
 
6
6
  Ufo's behavior is controlled by the `UFO_ENV` environment variable. For example, the `UFO_ENV` variable is used to layer different ufo variable files together to make it easy to specify settings for different environments like production and development. This is covered thoroughly in the [Variables]({% link _docs/variables.md %}) section. `UFO_ENV` defaults to `development` when not set.
@@ -45,4 +45,4 @@ AWS_PROFILE=whatever => UFO_ENV=development # since there are no profiles that m
45
45
 
46
46
  Notice how `AWS_PROFILE=whatever` results in `UFO_ENV=development`. This is because there are no matching aws_profiles in the `settings.yml`. More info on settings is available at [settings]({% link _docs/settings.md %}).
47
47
 
48
- {% include prev_next.md %}
48
+ {% include prev_next.md %}
@@ -0,0 +1,50 @@
1
+ ---
2
+ title: ufo logs command
3
+ nav_order: 20
4
+ ---
5
+
6
+ The ufo logs command will tail the logs of the ecs service if you are using the awslogs driver.
7
+
8
+ ## Examples
9
+
10
+ $ ufo logs demo-web
11
+ 2020-01-16 23:58:16 UTC 10.20.120.135 - - [16/Jan/2020:23:58:16 +0000] "GET / HTTP/1.1" 200 3 0.0003
12
+ 2020-01-16 23:58:16 UTC 10.20.120.135 - - [16/Jan/2020:23:58:16 UTC] "GET / HTTP/1.1" 200 3
13
+ 2020-01-16 23:58:16 UTC - -> /
14
+
15
+ ## Current Set
16
+
17
+ If you have a current service name set.
18
+
19
+ $ ufo current --service demo-web
20
+ $ ufo logs # follow by default
21
+ 2020-01-16 23:58:16 UTC 10.20.120.135 - - [16/Jan/2020:23:58:16 +0000] "GET / HTTP/1.1" 200 3 0.0003
22
+ 2020-01-16 23:58:16 UTC 10.20.120.135 - - [16/Jan/2020:23:58:16 UTC] "GET / HTTP/1.1" 200 3
23
+ 2020-01-16 23:58:16 UTC - -> /
24
+
25
+ ## Options
26
+
27
+ By default the logs follow and use the simple format without the log stream. Here's how adjust those options:
28
+
29
+ ufo logs --no-follow
30
+ ufo logs --format detailed # to show stream too
31
+
32
+ More info: [ufo logs reference]({% link _reference/ufo-logs.md %})
33
+
34
+ ## awslog driver
35
+
36
+ The generated .ufo task definition defaults to the awslogs driver. If you need it, it looks like this:
37
+
38
+ ```json
39
+ "logConfiguration": {
40
+ "logDriver": "awslogs",
41
+ "options": {
42
+ "awslogs-group": "<%= @awslogs_group %>",
43
+ "awslogs-region": "<%= @awslogs_region || 'us-east-1' %>",
44
+ "awslogs-stream-prefix": "<%= @awslogs_stream_prefix %>"
45
+ }
46
+ }
47
+ ```
48
+
49
+
50
+ {% include prev_next.md %}
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Ufo Task Params
3
- nav_order: 23
3
+ nav_order: 24
4
4
  ---
5
5
 
6
6
  You can run one off task with the [ufo task](https://ufoships.com/reference/ufo-task/) command.
@@ -40,4 +40,4 @@ ERB and [shared variables]({% link _docs/variables.md %}) are available in the p
40
40
 
41
41
  Note, the params.yml file does not have access to the `task_definition_name` helper method. That is only available in the `task_definitions.rb` template_definition code blocks.
42
42
 
43
- {% include prev_next.md %}
43
+ {% include prev_next.md %}
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Upgrading
3
- nav_order: 33
3
+ nav_order: 34
4
4
  ---
5
5
 
6
6
  <ul>
@@ -10,4 +10,4 @@ nav_order: 33
10
10
  {% endfor %}
11
11
  </ul>
12
12
 
13
- {% include prev_next.md %}
13
+ {% include prev_next.md %}
@@ -3,7 +3,7 @@ title: Upgrading to Version 4.5
3
3
  short_title: Version 4.5
4
4
  order: 1
5
5
  categories: upgrading
6
- nav_order: 34
6
+ nav_order: 35
7
7
  ---
8
8
 
9
9
  In ufo version 4.4 and 4.5, the default cloudformation stack names used by ufo were changed.
@@ -49,4 +49,4 @@ Version | Setting
49
49
 
50
50
  CloudFormation names the resources it creates with the beginning portion of the stack name. When the stack name prepends the environment then resources like ELBs a little bit harder to identify since they might be named something like this `product-Elb-K0LFFQ9LK50W`. It makes it harder to distinguish ELBs from different apps created by ufo.
51
51
 
52
- {% include prev_next.md %}
52
+ {% include prev_next.md %}
@@ -3,7 +3,7 @@ title: Upgrading to Version 4.0
3
3
  short_title: Version 4.0
4
4
  order: 2
5
5
  categories: upgrading
6
- nav_order: 35
6
+ nav_order: 36
7
7
  ---
8
8
 
9
9
  A major change in ufo from version 3 to 4 is that the ECS service is now created by CloudFormation. If you have an existing ECS service deployed by ufo version 3, when you deploy your app again with ufo version 4, there will be a new additional ECS service created. Here is the recommended upgrade path.
@@ -45,4 +45,4 @@ File | Changes
45
45
  .ufo/settings/cfn/default.yml | Starter cfn settings file.
46
46
  .ufo/settings/network/default.yml | This generated file will have the vpc and subnets that you specified above. You can change them directly in this file to control what network settings ufo uses.
47
47
 
48
- {% include prev_next.md %}
48
+ {% include prev_next.md %}