Class: VagrantAWS::Config
- Inherits:
-
Vagrant::Config::Base
- Object
- Vagrant::Config::Base
- VagrantAWS::Config
- Defined in:
- lib/vagrant-aws/config.rb
Overview
the ‘vagrant-aws` plugin.
Instance Attribute Summary collapse
-
#availability_zone ⇒ Object
Returns the value of attribute availability_zone.
-
#flavor ⇒ Object
Returns the value of attribute flavor.
-
#image ⇒ Object
Returns the value of attribute image.
-
#key_name ⇒ Object
Returns the value of attribute key_name.
- #private_key_path ⇒ Object
-
#region ⇒ Object
Returns the value of attribute region.
-
#security_groups ⇒ Object
Returns the value of attribute security_groups.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #using? ⇒ Boolean
- #validate(errors) ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
18 19 20 21 22 23 24 |
# File 'lib/vagrant-aws/config.rb', line 18 def initialize @security_groups = ["default"] @region = "us-east-1" @username = "ubuntu" @image = "ami-2ec83147" @flavor = "t1.micro" end |
Instance Attribute Details
#availability_zone ⇒ Object
Returns the value of attribute availability_zone.
16 17 18 |
# File 'lib/vagrant-aws/config.rb', line 16 def availability_zone @availability_zone end |
#flavor ⇒ Object
Returns the value of attribute flavor.
13 14 15 |
# File 'lib/vagrant-aws/config.rb', line 13 def flavor @flavor end |
#image ⇒ Object
Returns the value of attribute image.
12 13 14 |
# File 'lib/vagrant-aws/config.rb', line 12 def image @image end |
#key_name ⇒ Object
Returns the value of attribute key_name.
7 8 9 |
# File 'lib/vagrant-aws/config.rb', line 7 def key_name @key_name end |
#private_key_path ⇒ Object
30 31 32 |
# File 'lib/vagrant-aws/config.rb', line 30 def private_key_path @private_key_path.nil? ? nil : File.(@private_key_path) end |
#region ⇒ Object
Returns the value of attribute region.
15 16 17 |
# File 'lib/vagrant-aws/config.rb', line 15 def region @region end |
#security_groups ⇒ Object
Returns the value of attribute security_groups.
10 11 12 |
# File 'lib/vagrant-aws/config.rb', line 10 def security_groups @security_groups end |
#username ⇒ Object
Returns the value of attribute username.
9 10 11 |
# File 'lib/vagrant-aws/config.rb', line 9 def username @username end |
Instance Method Details
#using? ⇒ Boolean
26 27 28 |
# File 'lib/vagrant-aws/config.rb', line 26 def using? return top.env.is_a?(VagrantAWS::Environment) end |
#validate(errors) ⇒ Object
34 35 36 |
# File 'lib/vagrant-aws/config.rb', line 34 def validate(errors) errors.add(I18n.t("vagrant.config.ssh.private_key_missing", :path => private_key_path)) if private_key_path && !File.exists?(private_key_path) end |