5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/certman/cli.rb', line 5
def request(domain)
pastel = Pastel.new
prompt = TTY::Prompt.new
return unless prompt.yes?(pastel.red("NOTICE! Your selected region is *#{Aws.config[:region]}*. \
Certman create certificate on *#{Aws.config[:region]}*. OK?"))
unless Certman::Resource::SES::REGIONS.include?(Aws.config[:region])
return unless prompt.yes?(pastel.red('NOTICE! Certman use *us-east-1* S3/SES. OK?'))
end
return unless prompt.yes?(pastel.red('NOTICE! When requesting, Certman replace Active Receipt Rule Set. OK?'))
client = Certman::Client.new(domain)
Signal.trap(:INT) do
puts ''
puts pastel.red('Rollback start.')
client.rollback
end
cert_arn = client.request(options[:remain_resources])
puts 'Done.'
puts ''
puts "certificate_arn: #{pastel.cyan(cert_arn)}"
puts ''
end
|