Class: Phase::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/phase/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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

#adapterObject

Returns the value of attribute adapter.



4
5
6
# File 'lib/phase/configuration.rb', line 4

def adapter
  @adapter
end

#aws_regionObject

Returns the value of attribute aws_region.



4
5
6
# File 'lib/phase/configuration.rb', line 4

def aws_region
  @aws_region
end

#backendObject

Returns the value of attribute backend.



4
5
6
# File 'lib/phase/configuration.rb', line 4

def backend
  @backend
end

#bastion_roleObject

Returns the value of attribute bastion_role.



4
5
6
# File 'lib/phase/configuration.rb', line 4

def bastion_role
  @bastion_role
end

#bastion_userObject

Returns the value of attribute bastion_user.



4
5
6
# File 'lib/phase/configuration.rb', line 4

def bastion_user
  @bastion_user
end

#bastions_enabledObject

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_nameObject

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_nameObject

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

#ipaObject

Available options:

* bundle_id_prefix
* directory_prefix
* bucket_name
* company_name
* full_image_url
* icon_image_url


32
33
34
# File 'lib/phase/configuration.rb', line 32

def ipa
  @ipa ||= ::ActiveSupport::OrderedOptions.new
end

#load_phasefile!Object



36
37
38
39
40
# File 'lib/phase/configuration.rb', line 36

def load_phasefile!
  if ::File.exist?(phasefile_path)
    load phasefile_path
  end
end

#set_aws_credentials!Object



42
43
44
45
46
47
# File 'lib/phase/configuration.rb', line 42

def set_aws_credentials!
  Fog.credentials = {
    aws_access_key_id:     ENV.fetch('AWS_ACCESS_KEY_ID'),
    aws_secret_access_key: ENV.fetch('AWS_SECRET_ACCESS_KEY')
  }
end