Class: Phase::Configuration
- Inherits:
-
Object
- Object
- Phase::Configuration
- Defined in:
- lib/phase/configuration.rb
Instance Attribute Summary collapse
-
#adapter ⇒ Object
Returns the value of attribute adapter.
-
#aws_region ⇒ Object
Returns the value of attribute aws_region.
-
#backend ⇒ Object
Returns the value of attribute backend.
-
#bastion_role ⇒ Object
Returns the value of attribute bastion_role.
-
#bastion_user ⇒ Object
Returns the value of attribute bastion_user.
-
#bastions_enabled ⇒ Object
Returns the value of attribute bastions_enabled.
-
#private_subnet_name ⇒ Object
Returns the value of attribute private_subnet_name.
-
#public_subnet_name ⇒ Object
Returns the value of attribute public_subnet_name.
Instance Method Summary collapse
- #deploy ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #ipa ⇒ Object
- #load_phasefile! ⇒ Object
- #set_aws_credentials!(access_key_id = nil, secret_access_key = nil) ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/phase/configuration.rb', line 7 def initialize @bastions_enabled = false @bastion_role = nil @bastion_user = nil @public_subnet_name = "public" @private_subnet_name = "private" @aws_region = "us-east-1" @adapter = ::Phase::Adapters::AWS self.backend = ::Phase::SSH::Backend set_aws_credentials! end |
Instance Attribute Details
#adapter ⇒ Object
Returns the value of attribute adapter.
4 5 6 |
# File 'lib/phase/configuration.rb', line 4 def adapter @adapter end |
#aws_region ⇒ Object
Returns the value of attribute aws_region.
4 5 6 |
# File 'lib/phase/configuration.rb', line 4 def aws_region @aws_region end |
#backend ⇒ Object
Returns the value of attribute backend.
4 5 6 |
# File 'lib/phase/configuration.rb', line 4 def backend @backend end |
#bastion_role ⇒ Object
Returns the value of attribute bastion_role.
4 5 6 |
# File 'lib/phase/configuration.rb', line 4 def bastion_role @bastion_role end |
#bastion_user ⇒ Object
Returns the value of attribute bastion_user.
4 5 6 |
# File 'lib/phase/configuration.rb', line 4 def bastion_user @bastion_user end |
#bastions_enabled ⇒ Object
Returns the value of attribute bastions_enabled.
4 5 6 |
# File 'lib/phase/configuration.rb', line 4 def bastions_enabled @bastions_enabled end |
#private_subnet_name ⇒ Object
Returns the value of attribute private_subnet_name.
4 5 6 |
# File 'lib/phase/configuration.rb', line 4 def private_subnet_name @private_subnet_name end |
#public_subnet_name ⇒ Object
Returns the value of attribute public_subnet_name.
4 5 6 |
# File 'lib/phase/configuration.rb', line 4 def public_subnet_name @public_subnet_name end |
Instance Method Details
#deploy ⇒ Object
26 27 28 |
# File 'lib/phase/configuration.rb', line 26 def deploy @deploy ||= Config::Deploy.new end |
#ipa ⇒ Object
31 32 33 |
# File 'lib/phase/configuration.rb', line 31 def ipa @ipa ||= Config::IPA.new end |
#load_phasefile! ⇒ Object
35 36 37 38 39 |
# File 'lib/phase/configuration.rb', line 35 def load_phasefile! if ::File.exist?(phasefile_path) load phasefile_path end end |
#set_aws_credentials!(access_key_id = nil, secret_access_key = nil) ⇒ Object
41 42 43 44 45 46 |
# File 'lib/phase/configuration.rb', line 41 def set_aws_credentials!(access_key_id = nil, secret_access_key = nil) Fog.credentials = { aws_access_key_id: ENV.fetch('AWS_ACCESS_KEY_ID', access_key_id), aws_secret_access_key: ENV.fetch('AWS_SECRET_ACCESS_KEY', secret_access_key) } end |