Class: Ironfan::Provider::Rds
- Inherits:
-
IaasProvider
- Object
- Builder
- Ironfan::Provider
- IaasProvider
- Ironfan::Provider::Rds
- Defined in:
- lib/ironfan/headers.rb,
lib/ironfan/provider/rds.rb,
lib/ironfan/provider/rds/machine.rb,
lib/ironfan/provider/rds/security_group.rb
Defined Under Namespace
Classes: Machine, SecurityGroup
Class Method Summary collapse
- .applicable(computer) ⇒ Object
- .aws_account_id ⇒ Object
-
.connection ⇒ Object
Utility functions.
-
.ensure_tags(tags, fog) ⇒ Object
Ensure that a fog object (machine, volume, etc.) has the proper tags on it.
- .iam ⇒ Object
- .resources ⇒ Object
Methods inherited from IaasProvider
#ensure_prerequisites!, machine_class, #save!
Methods inherited from Ironfan::Provider
aggregate!, forget!, load, prepare!, receive, #resources, validate
Methods inherited from Builder
Class Method Details
.applicable(computer) ⇒ Object
37 38 39 |
# File 'lib/ironfan/provider/rds.rb', line 37 def self.applicable(computer) computer.server and computer.server.clouds.include?(:rds) end |
.aws_account_id ⇒ Object
24 25 26 |
# File 'lib/ironfan/provider/rds.rb', line 24 def self.aws_account_id() Chef::Config[:knife][:aws_account_id] end |
.connection ⇒ Object
Utility functions
14 15 16 |
# File 'lib/ironfan/provider/rds.rb', line 14 def self.connection @@connection ||= Fog::AWS::RDS.new(self.aws_credentials) end |
.ensure_tags(tags, fog) ⇒ Object
Ensure that a fog object (machine, volume, etc.) has the proper tags on it
29 30 31 32 33 34 35 |
# File 'lib/ironfan/provider/rds.rb', line 29 def self.(, fog) .delete_if {|k, v| fog.[k] == v.to_s rescue false } return if .empty? Ironfan.step(fog.id, "tagging with #{.inspect}", :green) fog.() end |
.iam ⇒ Object
18 19 20 21 22 |
# File 'lib/ironfan/provider/rds.rb', line 18 def self.iam credentials = self.aws_credentials credentials.delete(:region) @@iam ||= Fog::AWS::IAM.new(credentials) end |
.resources ⇒ Object
7 8 9 |
# File 'lib/ironfan/provider/rds.rb', line 7 def self.resources [ Machine, SecurityGroup ] end |