Module: Ufo::TaskDefinition::Helpers::Acm

Includes:
Utils::CallLine, Utils::Pretty
Defined in:
lib/ufo/task_definition/helpers/acm.rb

Instance Method Summary collapse

Methods included from Utils::Pretty

#pretty_home, #pretty_path, #pretty_time

Methods included from Utils::CallLine

#ufo_call_line

Instance Method Details

#acm_cert(domain) ⇒ Object

returns cert arn



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/ufo/task_definition/helpers/acm.rb', line 7

def acm_cert(domain)
  certs = acm_certs
  cert = certs.find do |c|
    c.domain_name == domain
  end
  if cert
    cert.certificate_arn
  else
    # Logger causes infinite loop when waf helper used in .ufo/
    logger.warn "WARN: ACM cert not found: #{domain}".color(:yellow)
    call_line = ufo_call_line
    DslEvaluator.print_code(call_line)
    nil
  end
end

#acm_certsObject

TODO: handle when there are lots of certs by paging



24
25
26
27
# File 'lib/ufo/task_definition/helpers/acm.rb', line 24

def acm_certs
  resp = acm.list_certificates
  resp.certificate_summary_list
end