Module: Certman::Resource::ACM
- Included in:
- Client
- Defined in:
- lib/certman/resource/acm.rb
Instance Method Summary collapse
- #acm ⇒ Object
- #check_certificate ⇒ Object
- #delete_certificate ⇒ Object
- #request_certificate ⇒ Object
Instance Method Details
#acm ⇒ Object
33 34 35 |
# File 'lib/certman/resource/acm.rb', line 33 def acm @acm ||= Aws::ACM::Client.new end |
#check_certificate ⇒ Object
26 27 28 29 30 31 |
# File 'lib/certman/resource/acm.rb', line 26 def check_certificate current_cert = acm.list_certificates.certificate_summary_list.find do |cert| cert.domain_name == @domain end raise 'Certificate already exist' if current_cert end |
#delete_certificate ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/certman/resource/acm.rb', line 18 def delete_certificate current_cert = acm.list_certificates.certificate_summary_list.find do |cert| cert.domain_name == @domain end raise 'Certificate does not exist' unless current_cert acm.delete_certificate(certificate_arn: current_cert.certificate_arn) end |
#request_certificate ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/certman/resource/acm.rb', line 4 def request_certificate res = acm.request_certificate( domain_name: @domain, subject_alternative_names: [@domain], domain_validation_options: [ { domain_name: @domain, validation_domain: @domain } ] ) @cert_arn = res.certificate_arn end |