Class: Akashi::Elb::SslCertificate
- Inherits:
-
Base
- Object
- Base
- Base
- Akashi::Elb::SslCertificate
show all
- Defined in:
- lib/akashi/elb/ssl_certificate.rb
Class Method Summary
collapse
Methods inherited from Base
base_class, collection, find, find_by, #initialize, where
Constructor Details
This class inherits a constructor from Akashi::Base
Class Method Details
.all ⇒ Object
30
31
32
|
# File 'lib/akashi/elb/ssl_certificate.rb', line 30
def all
collection.map { |object| new(object.name) }
end
|
.create ⇒ Object
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/akashi/elb/ssl_certificate.rb', line 9
def create
ssl_certificate = Akashi.manifest.elb.ssl_certificate
certificate_chain = ssl_certificate.certificate_chain
private_key_path = ssl_certificate.private_key_path
server_certificate = ssl_certificate.server_certificate
options = {
certificate_body: server_certificate,
private_key: OpenSSL::PKey::RSA.new(File.read(private_key_path)).to_pem,
server_certificate_name: Akashi.name,
}
options.merge!(certificate_chain: certificate_chain) if !!certificate_chain
response = Akashi::Aws.iam.client.upload_server_certificate(options)
new(response[:server_certificate_metadata][:server_certificate_name]).tap do |instance|
puts "Created a SSL Certificate (#{instance.name})."
end
end
|
.object_class ⇒ Object
38
39
40
|
# File 'lib/akashi/elb/ssl_certificate.rb', line 38
def object_class
@object_class ||= "ServerCertificate"
end
|
.service_class ⇒ Object
34
35
36
|
# File 'lib/akashi/elb/ssl_certificate.rb', line 34
def service_class
@service_class ||= "IAM"
end
|