class Stax::Cmd::Acm
Constants
- COLORS
Public Instance Methods
domains()
click to toggle source
# File lib/stax/mixin/acm.rb, line 52 def domains stack_acm_certs.each do |r| c = Aws::Acm.describe(r.physical_resource_id) debug("Domains for #{c.certificate_arn}") print_table c.domain_validation_options.map { |d| [ d.domain_name, color(d.validation_status, COLORS), d.validation_method ] } end end
ls()
click to toggle source
# File lib/stax/mixin/acm.rb, line 43 def ls print_table stack_acm_certs.map { |r| c = Aws::Acm.describe(r.physical_resource_id) in_use = c.in_use_by.empty? ? 'not in use' : 'in use' [ c.domain_name, color(c.status, COLORS), c.issuer, in_use, c.created_at ] } end
route53_change_batch(record)
click to toggle source
# File lib/stax/mixin/acm.rb, line 24 def route53_change_batch(record) { Comment: 'validation', Changes: [ { Action: :UPSERT, ResourceRecordSet: { Name: record.name, Type: record.type, TTL: 300, ResourceRecords: [ {Value: record.value} ] } } ] }.to_json end
stack_acm_certs()
click to toggle source
# File lib/stax/mixin/acm.rb, line 20 def stack_acm_certs Aws::Cfn.resources_by_type(my.stack_name, 'AWS::CertificateManager::Certificate') end
usage()
click to toggle source
# File lib/stax/mixin/acm.rb, line 82 def usage stack_acm_certs.each do |r| c = Aws::Acm.describe(r.physical_resource_id) debug("Resources associated with #{c.certificate_arn}") puts c.in_use_by end end
validation()
click to toggle source
# File lib/stax/mixin/acm.rb, line 64 def validation stack_acm_certs.each do |r| c = Aws::Acm.describe(r.physical_resource_id) c.domain_validation_options.uniq do |d| d.resource_record end.each do |d| next if d.validation_status == 'SUCCESS' debug("Pending validation for #{d.domain_name}") if options[:cli] puts "aws route53 change-resource-record-sets --change-batch '#{route53_change_batch(d.resource_record)}' --hosted-zone-id ..." else puts([d.resource_record.name, d.resource_record.type, d.resource_record.value].join(' ')) end end end end