Skip to content

Commit

Permalink
Changes to identifiers to allow terrafying-envoy to migrate to tf12
Browse files Browse the repository at this point in the history
  • Loading branch information
waiariki-koia committed Jan 6, 2021
1 parent 246d623 commit b94595d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/terrafying/components/dynamicset.rb
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def attach_load_balancer(load_balancer)

def autoscale_on_load_balancer(load_balancer, target_value:, disable_scale_in:)
load_balancer.targets.each.with_index do |target, i|
policy_name = "#{load_balancer.name}-#{@name}-#{i}"
policy_name = "#{load_balancer.name}-#{@name}-#{i}".gsub(%r{^(\d)}, '_\1')
lb_arn = load_balancer.id.to_s.gsub(/id/, 'arn_suffix')
tg_arn = target.target_group.to_s.gsub(/id/, 'arn_suffix')
listener = "aws_lb_listener.#{target.listener.to_s.split('.')[1]}"
Expand Down
2 changes: 1 addition & 1 deletion lib/terrafying/components/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def allow_scrape(vpc, ports, security_group)
prom = Prometheus.find_in(vpc: vpc)
ports.each do |port|
sg_rule_ident = Digest::SHA256.hexdigest("#{vpc.name}-#{port}-#{security_group}-#{prom.security_group}")
resource :aws_security_group_rule, sg_rule_ident,
resource :aws_security_group_rule, sg_rule_ident.gsub(%r{^(\d)}, '_\1'),
security_group_id: security_group,
type: 'ingress',
from_port: port,
Expand Down

0 comments on commit b94595d

Please sign in to comment.