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
@@ -52,4 +52,4 @@ When `ufo ship` is ran with `UFO_ENV=development` the `variables/development.rb`
52
52
  ])
53
53
  ```
54
54
 
55
- {% include prev_next.md %}
55
+ {% include prev_next.md %}
@@ -25,7 +25,10 @@
25
25
  </li>
26
26
  <li><a href="{% link _docs/variables.md %}">Shared Variables</a></li>
27
27
  <li><a href="{% link _docs/helpers.md %}">Helpers</a></li>
28
+ <li><a href="{% link _docs/secrets.md %}">Secrets</a></li>
29
+ <li><a href="{% link _docs/iam-roles.md %}">IAM Roles</a></li>
28
30
  <li><a href="{% link _docs/conventions.md %}">Conventions</a></li>
31
+ <li><a href="{% link _docs/ufo-logs.md %}">Ufo Logs</a></li>
29
32
  <li><a href="{% link _docs/ufo-env.md %}">Ufo Env</a></li>
30
33
  <li><a href="{% link _docs/ufo-env-extra.md %}">Ufo Env Extra</a></li>
31
34
  <li><a href="{% link _docs/ufo-current.md %}">Ufo Current</a></li>
@@ -43,6 +46,7 @@
43
46
  <li><a href="{% link _docs/extras/minimal-deploy-iam.md %}">Minimal Deploy IAM</a></li>
44
47
  <li><a href="{% link _docs/extras/codebuild-iam-role.md %}">CodeBuild IAM Role</a></li>
45
48
  <li><a href="{% link _docs/extras/dockerfile-erb.md %}">Dockerfile.erb</a></li>
49
+ <li><a href="{% link _docs/extras/notification-arns.md %}">Notification Arns</a></li>
46
50
  </ul>
47
51
  </li>
48
52
  <li><a href="{% link _docs/upgrading.md %}">Upgrading</a>
@@ -58,13 +58,12 @@ A more detailed post is available here: [How to Create Unlimited Extra Environme
58
58
  [--elb=ELB] # Decides to create elb, not create elb or use existing target group.
59
59
  [--elb-eip-ids=one two three] # EIP Allocation ids to use for network load balancer.
60
60
  [--elb-type=ELB_TYPE] # ELB type: application or network. Keep current deployed elb type when not specified.
61
- [--pretty], [--no-pretty] # Pretty format the json for the task definitions
62
- # Default: true
63
61
  [--scheduling-strategy=SCHEDULING_STRATEGY] # Scheduling strategy to use for the service. IE: replica, daemon
64
62
  [--stop-old-tasks], [--no-stop-old-tasks] # Stop old tasks as part of deployment to speed it up
65
63
  [--task=TASK] # ECS task name, to override the task name convention.
66
64
  [--wait], [--no-wait] # Wait for deployment to complete
67
65
  # Default: true
66
+ [--image-override=IMAGE_OVERRIDE] # Override image in task definition for quick testing
68
67
  [--register], [--no-register] # Register task definition
69
68
  # Default: true
70
69
  [--build], [--no-build] # Build task definition
@@ -52,7 +52,7 @@ The `image` is the base portion of image name that will be pushed to the docker
52
52
 
53
53
  The generated `tongueroo/demo-ufo:ufo-2018-02-08T21-04-02-3c86158` image name gets pushed to the docker registry.
54
54
 
55
- The `--vpc-id` option is optional but very useful. If not specified then ufo will use the default vpc for the network settings like subnets and security groups, which might not be what you want.
55
+ The `--vpc-id`, `--ecs-subnets`, and `--elb-subnets` options are optional but very useful. If not specified then ufo will use the default vpc for the network settings like subnets and security groups, which might not be what you want.
56
56
 
57
57
  ## Directory Structure
58
58
 
@@ -0,0 +1,40 @@
1
+ ---
2
+ title: ufo logs
3
+ reference: true
4
+ ---
5
+
6
+ ## Usage
7
+
8
+ ufo logs
9
+
10
+ ## Description
11
+
12
+ Prints out logs
13
+
14
+ ## Examples
15
+
16
+ ufo logs demo-web
17
+
18
+ If you have a current service name set.
19
+
20
+ ufo current --service demo-web
21
+ ufo logs # follow by default
22
+ ufo logs --no-follow
23
+ ufo logs --format detailed # to show stream too
24
+
25
+
26
+ ## Options
27
+
28
+ ```
29
+ [--follow], [--no-follow] # Whether to continuously poll for new logs. To exit from this mode, use Control-C.
30
+ # Default: true
31
+ [--since=SINCE] # From what time to begin displaying logs. By default, logs will be displayed starting from 1 minutes in the past. The value provided can be an ISO 8601 timestamp or a relative time.
32
+ [--format=FORMAT] # The format to display the logs. IE: detailed or short. With detailed, the log stream name is also shown.
33
+ # Default: detailed
34
+ [--filter-pattern=FILTER_PATTERN] # The filter pattern to use. If not provided, all the events are matched
35
+ [--verbose], [--no-verbose]
36
+ [--mute], [--no-mute]
37
+ [--noop], [--no-noop]
38
+ [--cluster=CLUSTER] # Cluster. Overrides .ufo/settings.yml.
39
+ ```
40
+
@@ -51,6 +51,8 @@ You only need to specify enough for a match to be found. Ufo searches the 30 mo
51
51
  ## Options
52
52
 
53
53
  ```
54
+ [--wait], [--no-wait] # Wait for deployment to complete
55
+ # Default: true
54
56
  [--verbose], [--no-verbose]
55
57
  [--mute], [--no-mute]
56
58
  [--noop], [--no-noop]
@@ -115,13 +115,12 @@ You can change the scheduling strategy by explicitly specifying it. Otherwise,
115
115
  [--elb=ELB] # Decides to create elb, not create elb or use existing target group.
116
116
  [--elb-eip-ids=one two three] # EIP Allocation ids to use for network load balancer.
117
117
  [--elb-type=ELB_TYPE] # ELB type: application or network. Keep current deployed elb type when not specified.
118
- [--pretty], [--no-pretty] # Pretty format the json for the task definitions
119
- # Default: true
120
118
  [--scheduling-strategy=SCHEDULING_STRATEGY] # Scheduling strategy to use for the service. IE: replica, daemon
121
119
  [--stop-old-tasks], [--no-stop-old-tasks] # Stop old tasks as part of deployment to speed it up
122
120
  [--task=TASK] # ECS task name, to override the task name convention.
123
121
  [--wait], [--no-wait] # Wait for deployment to complete
124
122
  # Default: true
123
+ [--image-override=IMAGE_OVERRIDE] # Override image in task definition for quick testing
125
124
  [--verbose], [--no-verbose]
126
125
  [--mute], [--no-mute]
127
126
  [--noop], [--no-noop]
@@ -55,12 +55,11 @@ Note: The `--task` option is not used with the `ufo ships` command.
55
55
  [--elb=ELB] # Decides to create elb, not create elb or use existing target group.
56
56
  [--elb-eip-ids=one two three] # EIP Allocation ids to use for network load balancer.
57
57
  [--elb-type=ELB_TYPE] # ELB type: application or network. Keep current deployed elb type when not specified.
58
- [--pretty], [--no-pretty] # Pretty format the json for the task definitions
59
- # Default: true
60
58
  [--scheduling-strategy=SCHEDULING_STRATEGY] # Scheduling strategy to use for the service. IE: replica, daemon
61
59
  [--stop-old-tasks], [--no-stop-old-tasks] # Stop old tasks as part of deployment to speed it up
62
60
  [--task=TASK] # ECS task name, to override the task name convention.
63
61
  [--wait], [--no-wait] # Wait for deployment to complete
62
+ [--image-override=IMAGE_OVERRIDE] # Override image in task definition for quick testing
64
63
  [--verbose], [--no-verbose]
65
64
  [--mute], [--no-mute]
66
65
  [--noop], [--no-noop]
@@ -173,7 +173,6 @@ If you need to modify the task definition template to suite your own needs it is
173
173
  ## Options
174
174
 
175
175
  ```
176
- [--pretty], [--no-pretty] # Pretty format the json for the task definitions
177
- # Default: true
176
+ [--image-override=IMAGE_OVERRIDE] # Override image in task definition for quick testing
178
177
  ```
179
178
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Articles
3
- nav_order: 45
3
+ nav_order: 46
4
4
  ---
5
5
 
6
6
  * [How to Create Unlimited Extra Environments
@@ -11,4 +11,4 @@ nav_order: 45
11
11
  * [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)
12
12
  * [Ufo Ship on AWS ECS Presentation](http://www.slideshare.net/tongueroo/ufo-ship-for-aws-ecs-70885296)
13
13
 
14
- {% include prev_next.md %}
14
+ {% include prev_next.md %}
@@ -26,4 +26,4 @@ You might like these articles:
26
26
 
27
27
  Also, the [UFO Tutorial Docs]({% link _docs/tutorial.md %}) provide a detail walkthrough on how each UFO step works.
28
28
 
29
- {% include prev_next.md %}
29
+ {% 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
  * The `ecsTaskExecutionRole` needs to exist on your AWS account. If you do not have an ecsTaskExecutionRole yet, create one by following: [Create ecsTaskExecutionRole with AWS CLI]({% link _docs/aws-ecs-task-execution-role.md %}).
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
 
@@ -129,4 +130,4 @@ Here's an article that compares the cost of ECS Fargate: [Heroku vs ECS Fargate
129
130
 
130
131
  {% include repo_push_access.md %}
131
132
 
132
- {% include prev_next.md %}
133
+ {% include prev_next.md %}
@@ -12,6 +12,7 @@ title: CLI Reference
12
12
  * [ufo destroy]({% link _reference/ufo-destroy.md %})
13
13
  * [ufo docker]({% link _reference/ufo-docker.md %})
14
14
  * [ufo init]({% link _reference/ufo-init.md %})
15
+ * [ufo logs]({% link _reference/ufo-logs.md %})
15
16
  * [ufo network]({% link _reference/ufo-network.md %})
16
17
  * [ufo ps]({% link _reference/ufo-ps.md %})
17
18
  * [ufo releases]({% link _reference/ufo-releases.md %})
@@ -0,0 +1,3 @@
1
+ # fine to have comment in this file
2
+ NAME1=SSM:parameter_name
3
+ NAME2=SECRETSMANAGER:secret_name-AbCdEf
@@ -13,6 +13,7 @@ base:
13
13
  # replacment might not work. For example, adding and removing a load balancer.
14
14
  # In these cases, you must delete the entire ecs service and recreate it.
15
15
  stack_naming: append_env
16
+ auto_camelize: false # new default setting in ufo v5
16
17
 
17
18
  development:
18
19
  # cluster: development
@@ -3,38 +3,38 @@
3
3
  # CloudFormation. These options are inserting into the generated template.
4
4
  # More info: https://ufoships.com/docs/customize-cloudformation
5
5
 
6
- elb:
7
- scheme: internet-facing
6
+ Elb:
7
+ Scheme: internet-facing
8
8
 
9
9
  # https://docs.aws.amazon.com/fr_fr/elasticloadbalancing/latest/APIReference/API_CreateTargetGroup.html
10
10
  #
11
11
  # When using SSL with network elb, the target group protocol is usually http still
12
12
  # unless you also handle SSL termination at the app level.
13
- target_group:
14
- port: 80 # only used with ECS if awsvpc mode
15
- # protocol: TCP # valid values - application elb: HTTP HTTPS, network elb: TCP
13
+ TargetGroup:
14
+ Port: 80 # only used with ECS if awsvpc mode
15
+ # Protocol: TCP # valid values - application elb: HTTP HTTPS, network elb: TCP
16
16
  # ufo sets defaults in cloudformation template
17
17
  # application elb: HTTP
18
18
  # network elb: TCP
19
19
  # so we can keep this commented out, unless we need HTTPS at the app level
20
20
  # Health check settings are supported by application load balancer only:
21
- # health_check_path: /up # health check
22
- health_check_interval_seconds: 10 # default: 30. Network ELB can only take 10 or 30
23
- healthy_threshold_count: 2
24
- unhealthy_threshold_count: 2 # default: 10
25
- # health_check_protocol: HTTP # HTTP or HTTPS
26
- # health_check_port: traffic-port
27
- target_group_attributes:
28
- - key: deregistration_delay.timeout_seconds
29
- value: 10
21
+ # HealthCheckPath: /up # health check
22
+ HealthCheckIntervalSeconds: 10 # default: 30. Network ELB can only take 10 or 30
23
+ HealthyThresholdCount: 2
24
+ UnhealthyThresholdCount: 2 # default: 10
25
+ # HealthCheckProtocol: HTTP # HTTP or HTTPS
26
+ # HealthCheckPort: traffic-port
27
+ TargetGroupAttributes:
28
+ - Key: deregistration_delay.timeout_seconds
29
+ Value: 10
30
30
 
31
31
  # https://docs.aws.amazon.com/fr_fr/elasticloadbalancing/latest/APIReference/API_CreateListener.html
32
32
  #
33
33
  # This is the default listener and normally should listen to port 80.
34
- listener:
35
- port: 80
34
+ Listener:
35
+ Port: 80
36
36
  # For Application Load Balancers, the supported protocols are HTTP and HTTPS. For Network Load Balancers, the supported protocol is TCP.
37
- # protocol: TCP # valid values - application elb: HTTP HTTPS, network elb: TCP, TLS
37
+ # Protocol: TCP # valid values - application elb: HTTP HTTPS, network elb: TCP, TLS
38
38
  # ufo sets these defaults:
39
39
  # application elb: HTTP # unless port is 443
40
40
  # application elb: HTTPS # if port is 443
@@ -43,8 +43,8 @@ listener:
43
43
  # Can keep protocol commented out,
44
44
  # unless need to override the defaults.
45
45
  # If using the listener to handle SSL
46
- # certificates:
47
- # - certificate_arn: arn:aws:acm:us-east-1:111111111111:certificate/11111111-2222-3333-4444-555555555555
46
+ # Certificates:
47
+ # - CertificateArn: arn:aws:acm:us-east-1:111111111111:certificate/11111111-2222-3333-4444-555555555555
48
48
 
49
49
  # An optional second listener can be created.
50
50
  # If HTTPS and SSL is required then the listener_ssl config is what you should use.
@@ -53,11 +53,11 @@ listener:
53
53
  # to handle SSL termination.
54
54
  #
55
55
  # ufo creates an ssl listener when listener_ssl is set.
56
- # listener_ssl:
57
- # port: 443
58
- # # certificates:
59
- # # - certificate_arn: arn:aws:acm:us-east-1:111111111111:certificate/11111111-2222-3333-4444-555555555555
60
- # # protocol: TCP # valid values - application elb: HTTP HTTPS, network elb: TCP, TLS
56
+ # ListenerSsl:
57
+ # Port: 443
58
+ # # Certificates:
59
+ # # - CertificateArn: arn:aws:acm:us-east-1:111111111111:certificate/11111111-2222-3333-4444-555555555555
60
+ # # Protocol: TCP # valid values - application elb: HTTP HTTPS, network elb: TCP, TLS
61
61
  # # ufo handles setting the defaults:
62
62
  # # application elb: HTTPS
63
63
  # # network elb: TLS
@@ -66,7 +66,7 @@ listener:
66
66
  # Note, the route53 record set for the domain name must already exist.
67
67
  # The {stack_name} variable gets replaced with the name of the CloudFormation stack name.
68
68
  # Example: {stack_name} => demo-web
69
- # dns:
70
- # name: "{stack_name}.yourdomain."
71
- # hosted_zone_name: yourdomain. # dont forget the trailing period
69
+ # Dns:
70
+ # Name: "{stack_name}.yourdomain."
71
+ # HostedZoneName: yourdomain. # dont forget the trailing period
72
72
  # TTL: '60' # ttl has special upcase casing
@@ -15,3 +15,12 @@ elb_subnets: # defaults to same subnets as ecs_subnets when not set
15
15
  # ecs_security_groups:
16
16
  # - sg-bbb
17
17
  # - sg-ccc
18
+
19
+ # Also supports extra security groups specific to each ECS service
20
+ # ecs_security_groups:
21
+ # demo-web:
22
+ # - sg-bbb
23
+ # - sg-ccc
24
+ # demo-worker:
25
+ # - sg-bbb
26
+ # - sg-ccc
@@ -21,6 +21,9 @@
21
21
  <% if @environment %>
22
22
  "environment": <%= @environment.to_json %>,
23
23
  <% end %>
24
+ <% if @secrets %>
25
+ "secrets": <%= @secrets.to_json %>,
26
+ <% end %>
24
27
  <% if @awslogs_group %>
25
28
  "logConfiguration": {
26
29
  "logDriver": "awslogs",
@@ -24,6 +24,9 @@
24
24
  <% if @environment %>
25
25
  "environment": <%= @environment.to_json %>,
26
26
  <% end %>
27
+ <% if @secrets %>
28
+ "secrets": <%= @secrets.to_json %>,
29
+ <% end %>
27
30
  <% if @awslogs_group %>
28
31
  "logConfiguration": {
29
32
  "logDriver": "awslogs",
@@ -2,6 +2,7 @@
2
2
  # More info on how variables work: http://ufoships.com/docs/variables/
3
3
  @image = helper.full_image_name # includes the git sha tongueroo/demo-ufo:ufo-[sha].
4
4
  @environment = helper.env_file(".env")
5
+ @secrets = helper.secrets_file(".secrets")
5
6
  <% if @options[:launch_type] == "fargate" -%>
6
7
  # Ensure that the cpu and memory values are a supported combination by Fargate.
7
8
  # More info: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-cpu-memory-error.html"
data/lib/ufo.rb CHANGED
@@ -1,7 +1,8 @@
1
1
  $stdout.sync = true unless ENV["UFO_STDOUT_SYNC"] == "0"
2
2
 
3
3
  $:.unshift(File.expand_path('../', __FILE__))
4
- require 'deep_merge'
4
+ require 'active_support/core_ext/class'
5
+ require 'deep_merge/rails_compat'
5
6
  require 'fileutils'
6
7
  require 'memoist'
7
8
  require 'rainbow/ext/string'
@@ -14,8 +14,17 @@ module Ufo
14
14
  loader = Zeitwerk::Loader.new
15
15
  loader.inflector = Inflector.new
16
16
  loader.push_dir(File.dirname(__dir__)) # lib
17
+
18
+ helpers = "#{ufo_root}/.ufo/helpers"
19
+ loader.push_dir(helpers) if File.exist?(helpers) # project helpers
20
+
17
21
  loader.setup
18
22
  end
23
+
24
+ # Autoloader runs so early that Ufo.root is not available, so we must declare it here
25
+ def ufo_root
26
+ ENV['UFO_ROOT'] || '.'
27
+ end
19
28
  end
20
29
  end
21
30
  end
@@ -37,11 +37,11 @@ module Ufo
37
37
  option :elb, desc: "Decides to create elb, not create elb or use existing target group."
38
38
  option :elb_eip_ids, type: :array, desc: "EIP Allocation ids to use for network load balancer."
39
39
  option :elb_type, desc: "ELB type: application or network. Keep current deployed elb type when not specified."
40
- option :pretty, type: :boolean, default: true, desc: "Pretty format the json for the task definitions"
41
40
  option :scheduling_strategy, desc: "Scheduling strategy to use for the service. IE: replica, daemon"
42
41
  option :stop_old_tasks, type: :boolean, default: false, desc: "Stop old tasks as part of deployment to speed it up"
43
42
  option :task, desc: "ECS task name, to override the task name convention."
44
43
  option :wait, type: :boolean, desc: "Wait for deployment to complete", default: true
44
+ option :image_override, desc: "Override image in task definition for quick testing"
45
45
  end
46
46
 
47
47
  desc "deploy SERVICE", "Deploy task definition to ECS service without re-building the definition."
@@ -75,6 +75,7 @@ module Ufo
75
75
 
76
76
  desc "rollback SERVICE VERSION", "Rolls back to older task definition."
77
77
  long_desc Help.text(:rollback)
78
+ option :wait, type: :boolean, desc: "Wait for deployment to complete", default: true
78
79
  def rollback(service=:current, version)
79
80
  service = service == :current ? Current.service! : service
80
81
  rollback = Rollback.new(service, options.merge(version: version))
@@ -187,6 +188,16 @@ module Ufo
187
188
  Status.new(service, options).run
188
189
  end
189
190
 
191
+ desc "logs", "Prints out logs"
192
+ long_desc Help.text(:logs)
193
+ option :follow, default: true, type: :boolean, desc: " Whether to continuously poll for new logs. To exit from this mode, use Control-C."
194
+ option :since, desc: "From what time to begin displaying logs. By default, logs will be displayed starting from 1 minutes in the past. The value provided can be an ISO 8601 timestamp or a relative time."
195
+ option :format, default: "detailed", desc: "The format to display the logs. IE: detailed or short. With detailed, the log stream name is also shown."
196
+ option :filter_pattern, desc: "The filter pattern to use. If not provided, all the events are matched"
197
+ def logs(service=:current)
198
+ Logs.new(service, options).run
199
+ end
200
+
190
201
  desc "completion *PARAMS", "Prints words for auto-completion."
191
202
  long_desc Help.text("completion")
192
203
  def completion(*params)
@@ -77,6 +77,13 @@ module Ufo
77
77
  def website
78
78
  "http://ufoships.com"
79
79
  end
80
+
81
+ # https://github.com/erikhuda/thor/issues/244
82
+ # Deprecation warning: Thor exit with status 0 on errors. To keep this behavior, you must define `exit_on_failure?` in `Lono::CLI`
83
+ # You can silence deprecations warning by setting the environment variable THOR_SILENCE_DEPRECATION.
84
+ def exit_on_failure?
85
+ true
86
+ end
80
87
  end
81
88
  end
82
89
  end
@@ -4,6 +4,7 @@ require 'yaml'
4
4
  module Ufo
5
5
  module Core
6
6
  extend Memoist
7
+ include Ufo::Settings
7
8
 
8
9
  def check_task_definition!(task_definition)
9
10
  task_definition_path = "#{Ufo.root}/.ufo/output/#{task_definition}.json"
@@ -49,15 +50,6 @@ module Ufo
49
50
  end
50
51
  end
51
52
 
52
- def settings
53
- Setting.new.data
54
- end
55
- memoize :settings
56
-
57
- def cfn_profile
58
- settings[:cfn_profile] || "default"
59
- end
60
-
61
53
  def check_ufo_project!
62
54
  check_path = "#{Ufo.root}/.ufo/settings.yml"
63
55
  unless File.exist?(check_path)
@@ -21,7 +21,7 @@ module Ufo
21
21
  end
22
22
 
23
23
  def delete_list
24
- return [] if ENV['TEST']
24
+ return [] if ENV['TEST'] || @options[:noop]
25
25
  return @delete_list if @delete_list
26
26
 
27
27
  out = execute("docker images") # live to override the noop cli options