Sha256: 4d2e75dda391f73a9701689ec93847d3a932101e1f9f061aa768db1aa5049867

Contents?: true

Size: 1.1 KB

Versions: 17

Compression:

Stored size: 1.1 KB

Contents

module Awspec::Helper
  module Finder
    module Acm
      def find_certificate(id)
        selected = []
        req = {}
        loop do
          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 = []
        req = {}
        loop do
          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

17 entries across 17 versions & 1 rubygems

Version Path
awspec-1.25.1 lib/awspec/helper/finder/acm.rb
awspec-1.25.0 lib/awspec/helper/finder/acm.rb
awspec-1.24.4 lib/awspec/helper/finder/acm.rb
awspec-1.24.3 lib/awspec/helper/finder/acm.rb
awspec-1.24.2 lib/awspec/helper/finder/acm.rb
awspec-1.24.1 lib/awspec/helper/finder/acm.rb
awspec-1.24.0 lib/awspec/helper/finder/acm.rb
awspec-1.23.0 lib/awspec/helper/finder/acm.rb
awspec-1.22.1 lib/awspec/helper/finder/acm.rb
awspec-1.22.0 lib/awspec/helper/finder/acm.rb
awspec-1.21.1 lib/awspec/helper/finder/acm.rb
awspec-1.21.0 lib/awspec/helper/finder/acm.rb
awspec-1.20.0 lib/awspec/helper/finder/acm.rb
awspec-1.19.2 lib/awspec/helper/finder/acm.rb
awspec-1.19.1 lib/awspec/helper/finder/acm.rb
awspec-1.19.0 lib/awspec/helper/finder/acm.rb
awspec-1.18.6 lib/awspec/helper/finder/acm.rb