ufo 6.3.7 → 6.3.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 564a94e07c4dcf5cdea7b63623f1c5f7741487132fb14d3cfab36ea4c2ccb487
4
- data.tar.gz: bfd797914511f0ce5750cd0102a9b8d79be50a4daaf4ad7c9b76e0578eb7bccb
3
+ metadata.gz: 8d85a0063b688b43736f0b7e252e314d70d98d05871bd43238fb630b84336fea
4
+ data.tar.gz: 99baad01439788788a8a0683c03fbbbaa2af925ffc8cc09026c8d57b61e0f1fd
5
5
  SHA512:
6
- metadata.gz: c01fae80702562184e0e4a7c43d33ec75ef23d70d94776a8262609278c6ffe3dc32dce11100760f6cb7f63988494c058823b8c3e652065e07c5e75ddcd3ca58c
7
- data.tar.gz: b5d8b619743945fd793ee7e62c264a9dd17ea16cceb59ccf563ba3f35c7a158a42e1c901882788aea74e56a02c50eabea1c3e6391c833331c7840ad591186658
6
+ metadata.gz: b38a61b1adc53e520c526b0d8d72bae8812b0cb17cb58d77c17af1e6dc823a1f671b0725ef77ecb587a2f30aed6847e4f3a669d88a2f05489721b4651eae86d2
7
+ data.tar.gz: 2958ec8b2aa3c5b69ac348fad209a5964528d4e8cb1101507e7bbddbf504c23f407181d9c9e394ec73b2f117758beb7ddba76e6953b8f48d2d08776615213279
data/CHANGELOG.md CHANGED
@@ -3,6 +3,16 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  This project *tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
5
5
 
6
+ ## [6.3.10] - 2022-06-23
7
+ - [#177](https://github.com/tongueroo/ufo/pull/177) Enabled support for gRPC
8
+
9
+ ## [6.3.9] - 2022-05-09
10
+ - [#175](https://github.com/tongueroo/ufo/pull/175) Secrets autofix and add missing trailing ::
11
+ - new env_file
12
+
13
+ ## [6.3.8] - 2022-05-02
14
+ - [#174](https://github.com/tongueroo/ufo/pull/174) fix update rollback failed user friendly error message
15
+
6
16
  ## [6.3.7] - 2022-04-29
7
17
  - [#173](https://github.com/tongueroo/ufo/pull/173) fix when ssl certs not used
8
18
 
@@ -6,11 +6,16 @@ class Ufo::Cfn::Stack::Builder::Resources
6
6
  Properties: properties
7
7
  }
8
8
 
9
- attrs[:DependsOn] = "Listener" if vars[:create_elb]
9
+ attrs[:DependsOn] = depends_on
10
10
 
11
11
  attrs
12
12
  end
13
13
 
14
+ def depends_on
15
+ return unless vars[:create_elb]
16
+ vars[:create_listener] ? "Listener" : "ListenerSsl"
17
+ end
18
+
14
19
  def properties
15
20
  props = {
16
21
  Cluster: @cluster,
@@ -14,7 +14,7 @@ class Ufo::Cfn::Stack::Builder::Resources
14
14
  Tags: [
15
15
  {Key: "Name", Value: @stack_name}
16
16
  ],
17
- Scheme: "internet-facing"
17
+ Scheme: Ufo.config.elb.scheme
18
18
  }
19
19
 
20
20
  props[:SecurityGroups] = security_groups(:elb) if vars[:elb_type] == "application"
@@ -1,6 +1,7 @@
1
1
  class Ufo::Cfn::Stack::Builder::Resources
2
2
  class Listener < Base
3
3
  def build
4
+ return unless vars[:create_listener]
4
5
  {
5
6
  Type: "AWS::ElasticLoadBalancingV2::Listener",
6
7
  Condition: "CreateElbIsTrue",
@@ -18,11 +19,11 @@ class Ufo::Cfn::Stack::Builder::Resources
18
19
  end
19
20
 
20
21
  def protocol
21
- vars[:default_listener_protocol]
22
+ Ufo.config.elb.protocol || vars[:default_listener_protocol]
22
23
  end
23
24
 
24
25
  def port
25
- 80
26
+ Ufo.config.elb.port
26
27
  end
27
28
 
28
29
  def default_actions
@@ -2,7 +2,11 @@ class Ufo::Cfn::Stack::Builder::Resources
2
2
  class ListenerSsl < Listener
3
3
  def build
4
4
  return unless vars[:create_listener_ssl]
5
- super
5
+ {
6
+ Type: "AWS::ElasticLoadBalancingV2::Listener",
7
+ Condition: "CreateElbIsTrue",
8
+ Properties: properties,
9
+ }
6
10
  end
7
11
 
8
12
  def properties
@@ -18,7 +18,6 @@ class Ufo::Cfn::Stack::Builder::Resources
18
18
  }
19
19
  ],
20
20
  Protocol: vars[:default_target_group_protocol],
21
- Port: 80,
22
21
  HealthCheckIntervalSeconds: 10,
23
22
  HealthyThresholdCount: 2,
24
23
  UnhealthyThresholdCount: 2,
@@ -36,6 +35,9 @@ class Ufo::Cfn::Stack::Builder::Resources
36
35
  props[:HealthCheckIntervalSeconds] = health_check_interval_seconds
37
36
  props[:HealthyThresholdCount] = healthy_threshold_count
38
37
  props[:UnhealthyThresholdCount] = unhealthy_threshold_count
38
+ props[:Matcher] = matcher
39
+ props[:ProtocolVersion] = protocol_version
40
+ props[:Port] = port
39
41
 
40
42
  props
41
43
  end
@@ -45,6 +47,9 @@ class Ufo::Cfn::Stack::Builder::Resources
45
47
  health_check_path
46
48
  healthy_threshold_count
47
49
  unhealthy_threshold_count
50
+ matcher
51
+ protocol_version
52
+ port
48
53
  ]
49
54
  delegate *meths, to: :elb
50
55
  def elb
@@ -8,6 +8,7 @@ class Ufo::Cfn::Stack
8
8
  cluster: @cluster,
9
9
  container: container,
10
10
  create_elb: create_elb?, # helps set Ecs DependsOn
11
+ create_listener: create_listener?,
11
12
  create_listener_ssl: create_listener_ssl?,
12
13
  create_route53: create_route53?,
13
14
  default_listener_protocol: default_listener_protocol,
@@ -58,6 +59,10 @@ class Ufo::Cfn::Stack
58
59
  elb_type == 'network' ? 'TCP' : 'HTTP'
59
60
  end
60
61
 
62
+ def create_listener?
63
+ Ufo.config.elb.listener.enabled
64
+ end
65
+
61
66
  # if the configuration is set to anything then enable it
62
67
  def create_listener_ssl?
63
68
  elb = Ufo.config.elb
data/lib/ufo/cfn/stack.rb CHANGED
@@ -110,7 +110,7 @@ module Ufo::Cfn
110
110
  when /state and can not be updated/
111
111
  logger.info "The #{@stack_name} stack is in a state that cannot be updated. Deleted the stack and try again."
112
112
  logger.info "ERROR: #{e.message}"
113
- if message.include?('UPDATE_ROLLBACK_FAILED')
113
+ if e.message.include?('UPDATE_ROLLBACK_FAILED')
114
114
  logger.info "You might be able to do a 'Continue Update Rollback' and skip some resources to get the stack back into a good state."
115
115
  end
116
116
  url = "https://console.aws.amazon.com/cloudformation/home?region=#{region}"
@@ -0,0 +1,11 @@
1
+ ## Examples
2
+
3
+ Generate regular env file
4
+
5
+ $ ufo new env_file
6
+ create .ufo/env_files/dev.env
7
+
8
+ Generate secrets env file
9
+
10
+ $ ufo new env_file secrets
11
+ create .ufo/env_files/dev.secrets
@@ -12,7 +12,7 @@ class Ufo::CLI::New
12
12
  public
13
13
  def create_hook
14
14
  set_template_source("env_file")
15
- template "file.#{type}", ".ufo/config/env_files/#{Ufo.env}.#{type}"
15
+ template "file.#{type}", ".ufo/env_files/#{Ufo.env}.#{type}"
16
16
  end
17
17
  end
18
18
  end
data/lib/ufo/config.rb CHANGED
@@ -72,12 +72,18 @@ module Ufo
72
72
  config.elb.healthy_threshold_count = 3 # The AWS usual default is 5
73
73
  config.elb.unhealthy_threshold_count = 3
74
74
 
75
+ config.elb.listener = ActiveSupport::OrderedOptions.new
76
+ config.elb.listener.enabled = true
77
+ config.elb.matcher = nil
75
78
  config.elb.port = 80 # default listener port
79
+ config.elb.protocol = nil
80
+ config.elb.protocol_version = nil
76
81
  config.elb.redirect = ActiveSupport::OrderedOptions.new
77
82
  config.elb.redirect.code = 302 # IE: 302 or 301
78
83
  config.elb.redirect.enabled = false
79
84
  config.elb.redirect.port = 443
80
85
  config.elb.redirect.protocol = "HTTPS"
86
+ config.elb.scheme = "internet-facing"
81
87
  config.elb.ssl = ActiveSupport::OrderedOptions.new
82
88
  config.elb.ssl.certificates = nil
83
89
  config.elb.ssl.enabled = false
@@ -41,7 +41,6 @@ module Ufo::TaskDefinition::Helpers::Vars
41
41
  end
42
42
 
43
43
  def show_layers(paths)
44
- label = @ext.sub('.','').capitalize
45
44
  paths.each do |path|
46
45
  if ENV['UFO_LAYERS_ALL']
47
46
  logger.info " #{path}"
@@ -85,12 +84,20 @@ module Ufo::TaskDefinition::Helpers::Vars
85
84
  value = item.delete(:value)
86
85
  arn = normalize_to_arn(item[:name], value)
87
86
  value = expansion(arn)
88
- value = value.sub('parameter//','parameter/') # auto fix accidental leading slash for user
87
+ value = autofix(value)
89
88
  item[:valueFrom] = value
90
89
  end
91
90
  secrets
92
91
  end
93
92
 
93
+ def autofix(value)
94
+ value = value.sub('parameter//','parameter/') # auto fix accidental leading slash for user
95
+ if value.include?(':secret:') && value.count(':') == 7 # missing trailing ::
96
+ value += "::"
97
+ end
98
+ value
99
+ end
100
+
94
101
  def normalize_to_arn(name, value)
95
102
  case value
96
103
  when /^ssm:/i
data/lib/ufo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ufo
2
- VERSION = "6.3.7"
2
+ VERSION = "6.3.10"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ufo
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.3.7
4
+ version: 6.3.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-04-29 00:00:00.000000000 Z
11
+ date: 2022-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-logs
@@ -564,6 +564,7 @@ files:
564
564
  - lib/ufo/cli/help/init.md
565
565
  - lib/ufo/cli/help/logs.md
566
566
  - lib/ufo/cli/help/new/boot_hook.md
567
+ - lib/ufo/cli/help/new/env_file.md
567
568
  - lib/ufo/cli/help/new/hook.md
568
569
  - lib/ufo/cli/help/ps.md
569
570
  - lib/ufo/cli/help/releases.md