Sha256: cf4f324fcc447a774373366ed687146483ec0df8b9cc83ca45065fb6aea39521

Contents?: true

Size: 1.1 KB

Versions: 33

Compression:

Stored size: 1.1 KB

Contents

module Awspec::Helper
  module Finder
    module Acm
      def find_certificate(id)
        selected = []
        loop do
          req = {}
          res = acm_client.list_certificates(req)
          selected += res.certificate_summary_list.select do |c|
            c.certificate_arn == id || c.domain_name == id
          end
          break if res.next_token.nil?
          req[:next_token] = res.next_token
        end

        cert = selected.single_resource(id)
        acm_client.describe_certificate({ certificate_arn: cert.certificate_arn }).certificate
      end

      def select_all_certificates
        certs = []
        loop do
          req = {}
          res = acm_client.list_certificates(req)
          res.certificate_summary_list.each do |c|
            certs << c.certificate_arn
          end
          break if res.next_token.nil?
          req[:next_token] = res.next_token
        end

        certificates = []
        certs.each do |cert|
          certificates << acm_client.describe_certificate({ certificate_arn: cert }).certificate
        end
        certificates
      end
    end
  end
end

Version data entries

33 entries across 33 versions & 3 rubygems

Version Path
cthiesfork-awspec-1.2.4 lib/awspec/helper/finder/acm.rb
awspec-api_gateway_extended-1.2.4 lib/awspec/helper/finder/acm.rb
awspec-api_gateway_extended-1.2.3 lib/awspec/helper/finder/acm.rb
cthiesfork-awspec-1.2.2 lib/awspec/helper/finder/acm.rb
cthiesfork-awspec-1.2.1 lib/awspec/helper/finder/acm.rb
awspec-1.18.5 lib/awspec/helper/finder/acm.rb
cthiesfork-awspec-1.2.0 lib/awspec/helper/finder/acm.rb
cthiesfork-awspec-1.1.0 lib/awspec/helper/finder/acm.rb
cthiesfork-awspec-1.0.0 lib/awspec/helper/finder/acm.rb
awspec-1.18.4 lib/awspec/helper/finder/acm.rb
awspec-1.18.3 lib/awspec/helper/finder/acm.rb
awspec-1.18.2 lib/awspec/helper/finder/acm.rb
awspec-1.18.1 lib/awspec/helper/finder/acm.rb
awspec-1.18.0 lib/awspec/helper/finder/acm.rb
awspec-1.17.4 lib/awspec/helper/finder/acm.rb
awspec-1.17.3 lib/awspec/helper/finder/acm.rb
awspec-1.17.2 lib/awspec/helper/finder/acm.rb
awspec-1.17.1 lib/awspec/helper/finder/acm.rb
awspec-1.17.0 lib/awspec/helper/finder/acm.rb
awspec-1.16.1 lib/awspec/helper/finder/acm.rb