terrafying-components 2.0.9 → 2.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7506eff536bce92c4ca3e10bf028413c798f303dbd4172908c4cd97da3a674e5
4
- data.tar.gz: 07555eb3500d7da89014011bf8d4f135b9fa8e6352dda601033114368fa48400
3
+ metadata.gz: 3d751cc6be7a7a3a29dd3e588cc120ec3fa1d8b3ea3b0155888551d4c74a0f6d
4
+ data.tar.gz: a55c971cf8196a9ce42f3ae5b57d35219aa1b7d6e42a0b43107866095a1a4621
5
5
  SHA512:
6
- metadata.gz: 2aeaf4a8fba2fb5216ed75fd6f086f590f99b87ef9521d9977337507ca80e7b0bad39cc938387d8edac28816c91bf6843847a2b4ed515aab6b9e38b9976525dc
7
- data.tar.gz: 187cae79f1c97ce7d14e8082a78ad148c9b0d52f5c5eff376837b128e906324b4e1440dc0b00308092c28b69d9ad109e198c8cac260d3a639238d9e47b0a850a
6
+ metadata.gz: c2b2a37884426731df2c879547a3df0bf314e1314f2ec52c706606082b53520c0170cfdcfbfc64e1a3faf3c6bb720f2a76c2fcc74f106436d9f28f4030b4cc63
7
+ data.tar.gz: 4222b381c2056081c80c1a47f03376921e361129ff00979614ca52fbb6464934a565661778ba66ff4ff6bf7b73e71422b1221546ea3e73c5fa5cc3be4f1780a6
@@ -173,13 +173,14 @@ module Terrafying
173
173
 
174
174
  def autoscale_on_load_balancer(load_balancer, target_value:, disable_scale_in:)
175
175
  load_balancer.targets.each.with_index do |target, i|
176
+ policy_ident = "#{load_balancer.name}-#{@name}-#{i}".gsub(%r{^(\d)}, '_\1')
176
177
  policy_name = "#{load_balancer.name}-#{@name}-#{i}"
177
178
  lb_arn = load_balancer.id.to_s.gsub(/id/, 'arn_suffix')
178
179
  tg_arn = target.target_group.to_s.gsub(/id/, 'arn_suffix')
179
180
  listener = "aws_lb_listener.#{target.listener.to_s.split('.')[1]}"
180
- autoscaling_attachment = "aws_autoscaling_attachment.#{policy_name}"
181
+ autoscaling_attachment = "aws_autoscaling_attachment.#{policy_ident}"
181
182
 
182
- resource :aws_autoscaling_policy, policy_name,
183
+ resource :aws_autoscaling_policy, policy_ident,
183
184
  name: policy_name,
184
185
  autoscaling_group_name: @asg,
185
186
  policy_type: 'TargetTrackingScaling',
@@ -170,7 +170,7 @@ module Terrafying
170
170
  prom = Prometheus.find_in(vpc: vpc)
171
171
  ports.each do |port|
172
172
  sg_rule_ident = Digest::SHA256.hexdigest("#{vpc.name}-#{port}-#{security_group}-#{prom.security_group}")
173
- resource :aws_security_group_rule, sg_rule_ident,
173
+ resource :aws_security_group_rule, sg_rule_ident.gsub(%r{^(\d)}, '_\1'),
174
174
  security_group_id: security_group,
175
175
  type: 'ingress',
176
176
  from_port: port,
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Terrafying
4
4
  module Components
5
- VERSION = '2.0.9'
5
+ VERSION = '2.0.10'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: terrafying-components
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.9
4
+ version: 2.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - uSwitch Limited
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-15 00:00:00.000000000 Z
11
+ date: 2021-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake