vagrant-aws 0.2.2 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 4875beff54192a4db1f2764ba37769f408a16c7c
4
+ data.tar.gz: 8ccf174be6eb9fdc3994021f9ae6e85ce8d0a34c
5
+ SHA512:
6
+ metadata.gz: 00cc521c0d0cc6d04c3c13502c232b008fe06998de2847cd29c36db89611c4415e001f300cc99bd9bbac0bbf9d8af03fa13e8e410863e275200c998a14826c91
7
+ data.tar.gz: 87d486bf65db0820f1d74cf9b1ac0108336a97ff3166d15b1fb156fce80d98eb7473597305fc91f9ad993de2b09d2bc8f7f56a4054ca79f406714f145c0b1ebf
data/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ # 0.3.0 (September 2, 2013)
2
+
3
+ * Parallelize multi-machine up on Vagrant 1.2+
4
+ * Show proper configuration errors if an invalid configuration key
5
+ is used.
6
+ * Request confirmation on `vagrant destroy`, like normal VirtualBox + Vagrant.
7
+ * If user data is configured, output is shown on "vagrant up" that
8
+ it is being set.
9
+ * Add EIP support (GH #65)
10
+ * Add block device mapping support (GH #93)
11
+ * README improvements (GH #120)
12
+ * Fix missing locale message (GH #73)
13
+ * SyncFolders creates hostpath if it doesn't exist and `:create` option is set (GH #17)
14
+ * Add IAM Instance Profile support (GH #68)
15
+ * Add shutdown behavior support (GH #125,#131)
16
+
1
17
  # 0.2.2 (April 18, 2013)
2
18
 
3
19
  * Fix crashing bug with incorrect provisioner arguments.
data/Gemfile CHANGED
@@ -6,5 +6,5 @@ group :development do
6
6
  # We depend on Vagrant for development, but we don't add it as a
7
7
  # gem dependency because we expect to be installed within the
8
8
  # Vagrant environment itself using `vagrant plugin`.
9
- gem "vagrant", :git => "git://github.com/mitchellh/vagrant.git"
9
+ gem "vagrant", :git => "git://github.com/mitchellh/vagrant.git", :tag => "v1.2.7"
10
10
  end
data/README.md CHANGED
@@ -108,6 +108,10 @@ This provider exposes quite a few provider-specific configuration options:
108
108
  * `security_groups` - An array of security groups for the instance. If this
109
109
  instance will be launched in VPC, this must be a list of security group
110
110
  IDs.
111
+ * `iam_instance_profile_arn` - The Amazon resource name (ARN) of the IAM Instance
112
+ Profile to associate with the instance
113
+ * `iam_instance_profile_name` - The name of the IAM Instance Profile to associate
114
+ with the instance
111
115
  * `subnet_id` - The subnet to boot the instance into, for VPC.
112
116
  * `tags` - A hash of tags to set on the machine.
113
117
  * `use_iam_profile` - If true, will use [IAM profiles](http://docs.aws.amazon.com/IAM/latest/UserGuide/instance-profiles.html)
@@ -173,6 +177,43 @@ the remote machine over SSH.
173
177
  This is good enough for all built-in Vagrant provisioners (shell,
174
178
  chef, and puppet) to work!
175
179
 
180
+ ## Other Examples
181
+
182
+ ### Tags
183
+
184
+ To use tags, simply define a hash of key/value for the tags you want to associate to your instance, like:
185
+
186
+ ```ruby
187
+ Vagrant.configure("2") do |config|
188
+ # ... other stuff
189
+
190
+ config.vm.provider "aws" do |aws|
191
+ aws.tags = {
192
+ 'Name' => 'Some Name',
193
+ 'Some Key' => 'Some Value'
194
+ }
195
+ end
196
+ end
197
+ ```
198
+
199
+ ### User data
200
+
201
+ You can specify user data for the instance being booted.
202
+
203
+ ```ruby
204
+ Vagrant.configure("2") do |config|
205
+ # ... other stuff
206
+
207
+ config.vm.provider "aws" do |aws|
208
+ # Option 1: a single string
209
+ aws.user_data = "#!/bin/bash\necho 'got user data' > /tmp/user_data.log\necho"
210
+
211
+ # Option 2: use a file
212
+ aws.user_data = File.read("user_data.txt")
213
+ end
214
+ end
215
+ ```
216
+
176
217
  ## Development
177
218
 
178
219
  To work on the `vagrant-aws` plugin, clone this repository out, and use
@@ -191,8 +232,11 @@ $ bundle exec rake
191
232
  If those pass, you're ready to start developing the plugin. You can test
192
233
  the plugin without installing it into your Vagrant environment by just
193
234
  creating a `Vagrantfile` in the top level of this directory (it is gitignored)
194
- that uses it, and uses bundler to execute Vagrant:
195
-
235
+ and add the following line to your `Vagrantfile`
236
+ ```ruby
237
+ Vagrant.require_plugin "vagrant-aws"
238
+ ```
239
+ Use bundler to execute Vagrant:
196
240
  ```
197
241
  $ bundle exec vagrant up --provider=aws
198
242
  ```
@@ -11,9 +11,15 @@ module VagrantPlugins
11
11
  # This action is called to terminate the remote machine.
12
12
  def self.action_destroy
13
13
  Vagrant::Action::Builder.new.tap do |b|
14
- b.use ConfigValidate
15
- b.use ConnectAWS
16
- b.use TerminateInstance
14
+ b.use Call, DestroyConfirm do |env, b2|
15
+ if env[:result]
16
+ b2.use ConfigValidate
17
+ b2.use ConnectAWS
18
+ b2.use TerminateInstance
19
+ else
20
+ b2.use MessageWillNotDestroy
21
+ end
22
+ end
17
23
  end
18
24
  end
19
25
 
@@ -87,6 +93,7 @@ module VagrantPlugins
87
93
  # This action is called to bring the box up from nothing.
88
94
  def self.action_up
89
95
  Vagrant::Action::Builder.new.tap do |b|
96
+ b.use HandleBoxUrl
90
97
  b.use ConfigValidate
91
98
  b.use ConnectAWS
92
99
  b.use Call, IsCreated do |env, b2|
@@ -109,6 +116,7 @@ module VagrantPlugins
109
116
  autoload :IsCreated, action_root.join("is_created")
110
117
  autoload :MessageAlreadyCreated, action_root.join("message_already_created")
111
118
  autoload :MessageNotCreated, action_root.join("message_not_created")
119
+ autoload :MessageWillNotDestroy, action_root.join("message_will_not_destroy")
112
120
  autoload :ReadSSHInfo, action_root.join("read_ssh_info")
113
121
  autoload :ReadState, action_root.join("read_state")
114
122
  autoload :RunInstance, action_root.join("run_instance")
@@ -26,7 +26,7 @@ module VagrantPlugins
26
26
  :region => region
27
27
  }
28
28
  if region_config.use_iam_profile
29
- fog_config[:use_iam_profile] = True
29
+ fog_config[:use_iam_profile] = true
30
30
  else
31
31
  fog_config[:aws_access_key_id] = region_config.access_key_id
32
32
  fog_config[:aws_secret_access_key] = region_config.secret_access_key
@@ -0,0 +1,16 @@
1
+ module VagrantPlugins
2
+ module AWS
3
+ module Action
4
+ class MessageWillNotDestroy
5
+ def initialize(app, env)
6
+ @app = app
7
+ end
8
+
9
+ def call(env)
10
+ env[:ui].info(I18n.t("vagrant_aws.will_not_destroy", name: env[:machine].name))
11
+ @app.call(env)
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -31,7 +31,7 @@ module VagrantPlugins
31
31
 
32
32
  # Read the DNS info
33
33
  return {
34
- :host => server.dns_name || server.private_ip_address,
34
+ :host => server.public_ip_address || server.dns_name || server.private_ip_address,
35
35
  :port => 22
36
36
  }
37
37
  end
@@ -1,4 +1,5 @@
1
1
  require "log4r"
2
+ require 'json'
2
3
 
3
4
  require 'vagrant/util/retryable'
4
5
 
@@ -24,16 +25,21 @@ module VagrantPlugins
24
25
  region = env[:machine].provider_config.region
25
26
 
26
27
  # Get the configs
27
- region_config = env[:machine].provider_config.get_region_config(region)
28
- ami = region_config.ami
29
- availability_zone = region_config.availability_zone
30
- instance_type = region_config.instance_type
31
- keypair = region_config.keypair_name
32
- private_ip_address = region_config.private_ip_address
33
- security_groups = region_config.security_groups
34
- subnet_id = region_config.subnet_id
35
- tags = region_config.tags
36
- user_data = region_config.user_data
28
+ region_config = env[:machine].provider_config.get_region_config(region)
29
+ ami = region_config.ami
30
+ availability_zone = region_config.availability_zone
31
+ instance_type = region_config.instance_type
32
+ keypair = region_config.keypair_name
33
+ private_ip_address = region_config.private_ip_address
34
+ security_groups = region_config.security_groups
35
+ subnet_id = region_config.subnet_id
36
+ tags = region_config.tags
37
+ user_data = region_config.user_data
38
+ block_device_mapping = region_config.block_device_mapping
39
+ elastic_ip = region_config.elastic_ip
40
+ terminate_on_shutdown = region_config.terminate_on_shutdown
41
+ iam_instance_profile_arn = region_config.iam_instance_profile_arn
42
+ iam_instance_profile_name = region_config.iam_instance_profile_name
37
43
 
38
44
  # If there is no keypair then warn the user
39
45
  if !keypair
@@ -41,7 +47,7 @@ module VagrantPlugins
41
47
  end
42
48
 
43
49
  # If there is a subnet ID then warn the user
44
- if subnet_id
50
+ if subnet_id && !elastic_ip
45
51
  env[:ui].warn(I18n.t("vagrant_aws.launch_vpc_warning"))
46
52
  end
47
53
 
@@ -53,8 +59,15 @@ module VagrantPlugins
53
59
  env[:ui].info(" -- Availability Zone: #{availability_zone}") if availability_zone
54
60
  env[:ui].info(" -- Keypair: #{keypair}") if keypair
55
61
  env[:ui].info(" -- Subnet ID: #{subnet_id}") if subnet_id
62
+ env[:ui].info(" -- IAM Instance Profile ARN: #{iam_instance_profile_arn}") if iam_instance_profile_arn
63
+ env[:ui].info(" -- IAM Instance Profile Name: #{iam_instance_profile_name}") if iam_instance_profile_name
56
64
  env[:ui].info(" -- Private IP: #{private_ip_address}") if private_ip_address
65
+ env[:ui].info(" -- Elastic IP: #{elastic_ip}") if elastic_ip
66
+ env[:ui].info(" -- User Data: yes") if user_data
57
67
  env[:ui].info(" -- Security Groups: #{security_groups.inspect}") if !security_groups.empty?
68
+ env[:ui].info(" -- User Data: #{user_data}") if user_data
69
+ env[:ui].info(" -- Block Device Mapping: #{block_device_mapping}") if block_device_mapping
70
+ env[:ui].info(" -- Terminate On Shutdown: #{terminate_on_shutdown}")
58
71
 
59
72
  begin
60
73
  options = {
@@ -64,10 +77,13 @@ module VagrantPlugins
64
77
  :key_name => keypair,
65
78
  :private_ip_address => private_ip_address,
66
79
  :subnet_id => subnet_id,
80
+ :iam_instance_profile_arn => iam_instance_profile_arn,
81
+ :iam_instance_profile_name => iam_instance_profile_name,
67
82
  :tags => tags,
68
- :user_data => user_data
83
+ :user_data => user_data,
84
+ :block_device_mapping => block_device_mapping,
85
+ :instance_initiated_shutdown_behavior => terminate_on_shutdown == true ? "terminate" : nil
69
86
  }
70
-
71
87
  if !security_groups.empty?
72
88
  security_group_key = options[:subnet_id].nil? ? :groups : :security_group_ids
73
89
  options[security_group_key] = security_groups
@@ -85,6 +101,10 @@ module VagrantPlugins
85
101
  raise
86
102
  rescue Fog::Compute::AWS::Error => e
87
103
  raise Errors::FogError, :message => e.message
104
+ rescue Excon::Errors::HTTPStatusError => e
105
+ raise Errors::InternalFogError,
106
+ :error => e.message,
107
+ :response => e.response.body
88
108
  end
89
109
 
90
110
  # Immediately save the ID since it is created at this point.
@@ -115,6 +135,12 @@ module VagrantPlugins
115
135
 
116
136
  @logger.info("Time to instance ready: #{env[:metrics]["instance_ready_time"]}")
117
137
 
138
+ # Allocate and associate an elastic IP if requested
139
+ if elastic_ip
140
+ domain = subnet_id ? 'vpc' : 'standard'
141
+ do_elastic_ip(env, domain, server)
142
+ end
143
+
118
144
  if !env[:interrupted]
119
145
  env[:metrics]["instance_ssh_time"] = Util::Timer.time do
120
146
  # Wait for SSH to be ready.
@@ -148,6 +174,37 @@ module VagrantPlugins
148
174
  end
149
175
  end
150
176
 
177
+ def do_elastic_ip(env, domain, server)
178
+ allocation = env[:aws_compute].allocate_address(domain)
179
+ if allocation.body['publicIp'].nil?
180
+ @logger.debug("Could not allocate Elastic IP.")
181
+ return nil
182
+ end
183
+ @logger.debug("Public IP #{allocation.body['publicIp']}")
184
+
185
+ # Associate the address and save the metadata to a hash
186
+ if domain == 'vpc'
187
+ # VPC requires an allocation ID to assign an IP
188
+ association = env[:aws_compute].associate_address(server.id, nil, nil, allocation.body['allocationId'])
189
+ h = { :allocation_id => allocation.body['allocationId'], :association_id => association.body['associationId'], :public_ip => allocation.body['publicIp'] }
190
+ else
191
+ # Standard EC2 instances only need the allocated IP address
192
+ association = env[:aws_compute].associate_address(server.id, allocation.body['publicIp'])
193
+ h = { :public_ip => allocation.body['publicIp'] }
194
+ end
195
+
196
+ if !association.body['return']
197
+ @logger.debug("Could not associate Elastic IP.")
198
+ return nil
199
+ end
200
+
201
+ # Save this IP to the data dir so it can be released when the instance is destroyed
202
+ ip_file = env[:machine].data_dir.join('elastic_ip')
203
+ ip_file.open('w+') do |f|
204
+ f.write(h.to_json)
205
+ end
206
+ end
207
+
151
208
  def terminate(env)
152
209
  destroy_env = env.dup
153
210
  destroy_env.delete(:interrupted)
@@ -39,6 +39,17 @@ module VagrantPlugins
39
39
  :hostpath => hostpath,
40
40
  :guestpath => guestpath))
41
41
 
42
+ # Create the host path if it doesn't exist and option flag is set
43
+ if data[:create]
44
+ begin
45
+ FileUtils::mkdir_p(hostpath)
46
+ rescue => err
47
+ raise Errors::MkdirError,
48
+ :hostpath => hostpath,
49
+ :err => err
50
+ end
51
+ end
52
+
42
53
  # Create the guest path
43
54
  env[:machine].communicate.sudo("mkdir -p '#{guestpath}'")
44
55
  env[:machine].communicate.sudo(
@@ -1,4 +1,5 @@
1
1
  require "log4r"
2
+ require "json"
2
3
 
3
4
  module VagrantPlugins
4
5
  module AWS
@@ -17,9 +18,29 @@ module VagrantPlugins
17
18
  env[:ui].info(I18n.t("vagrant_aws.terminating"))
18
19
  server.destroy
19
20
  env[:machine].id = nil
21
+
22
+ # Release the elastic IP
23
+ ip_file = env[:machine].data_dir.join('elastic_ip')
24
+ if ip_file.file?
25
+ release_address(env,ip_file.read)
26
+ ip_file.delete
27
+ end
20
28
 
21
29
  @app.call(env)
22
30
  end
31
+
32
+ # Release an elastic IP address
33
+ def release_address(env,eip)
34
+ h = JSON.parse(eip)
35
+ # Use association_id and allocation_id for VPC, use public IP for EC2
36
+ if h['association_id']
37
+ env[:aws_compute].disassociate_address(nil,h['association_id'])
38
+ env[:aws_compute].release_address(h['allocation_id'])
39
+ else
40
+ env[:aws_compute].disassociate_address(h['public_ip'])
41
+ env[:aws_compute].release_address(h['public_ip'])
42
+ end
43
+ end
23
44
  end
24
45
  end
25
46
  end
@@ -39,6 +39,11 @@ module VagrantPlugins
39
39
  # @return [String]
40
40
  attr_accessor :private_ip_address
41
41
 
42
+ # Acquire and attach an elastic IP address (VPC).
43
+ #
44
+ # @return [Boolean]
45
+ attr_accessor :elastic_ip
46
+
42
47
  # The name of the AWS region in which to create the instance.
43
48
  #
44
49
  # @return [String]
@@ -65,6 +70,18 @@ module VagrantPlugins
65
70
  # @return [Array<String>]
66
71
  attr_accessor :security_groups
67
72
 
73
+ # The Amazon resource name (ARN) of the IAM Instance Profile
74
+ # to associate with the instance.
75
+ #
76
+ # @return [String]
77
+ attr_accessor :iam_instance_profile_arn
78
+
79
+ # The name of the IAM Instance Profile to associate with
80
+ # the instance.
81
+ #
82
+ # @return [String]
83
+ attr_accessor :iam_instance_profile_name
84
+
68
85
  # The subnet ID to launch the machine into (VPC).
69
86
  #
70
87
  # @return [String]
@@ -86,23 +103,38 @@ module VagrantPlugins
86
103
  # @return [String]
87
104
  attr_accessor :user_data
88
105
 
106
+ # Block device mappings
107
+ #
108
+ # @return [Array<Hash>]
109
+ attr_accessor :block_device_mapping
110
+
111
+ # Indicates whether an instance stops or terminates when you initiate shutdown from the instance
112
+ #
113
+ # @return [bool]
114
+ attr_accessor :terminate_on_shutdown
115
+
89
116
  def initialize(region_specific=false)
90
- @access_key_id = UNSET_VALUE
91
- @ami = UNSET_VALUE
92
- @availability_zone = UNSET_VALUE
117
+ @access_key_id = UNSET_VALUE
118
+ @ami = UNSET_VALUE
119
+ @availability_zone = UNSET_VALUE
93
120
  @instance_ready_timeout = UNSET_VALUE
94
- @instance_type = UNSET_VALUE
95
- @keypair_name = UNSET_VALUE
96
- @private_ip_address = UNSET_VALUE
97
- @region = UNSET_VALUE
98
- @endpoint = UNSET_VALUE
99
- @version = UNSET_VALUE
100
- @secret_access_key = UNSET_VALUE
101
- @security_groups = UNSET_VALUE
102
- @subnet_id = UNSET_VALUE
103
- @tags = {}
104
- @user_data = UNSET_VALUE
105
- @use_iam_profile = UNSET_VALUE
121
+ @instance_type = UNSET_VALUE
122
+ @keypair_name = UNSET_VALUE
123
+ @private_ip_address = UNSET_VALUE
124
+ @region = UNSET_VALUE
125
+ @endpoint = UNSET_VALUE
126
+ @version = UNSET_VALUE
127
+ @secret_access_key = UNSET_VALUE
128
+ @security_groups = UNSET_VALUE
129
+ @subnet_id = UNSET_VALUE
130
+ @tags = {}
131
+ @user_data = UNSET_VALUE
132
+ @use_iam_profile = UNSET_VALUE
133
+ @block_device_mapping = []
134
+ @elastic_ip = UNSET_VALUE
135
+ @iam_instance_profile_arn = UNSET_VALUE
136
+ @iam_instance_profile_name = UNSET_VALUE
137
+ @terminate_on_shutdown = UNSET_VALUE
106
138
 
107
139
  # Internal state (prefix with __ so they aren't automatically
108
140
  # merged)
@@ -169,6 +201,10 @@ module VagrantPlugins
169
201
  # Merge in the tags
170
202
  result.tags.merge!(self.tags)
171
203
  result.tags.merge!(other.tags)
204
+
205
+ # Merge block_device_mapping
206
+ result.block_device_mapping |= self.block_device_mapping
207
+ result.block_device_mapping |= other.block_device_mapping
172
208
  end
173
209
  end
174
210
 
@@ -193,6 +229,9 @@ module VagrantPlugins
193
229
  # Default the private IP to nil since VPC is not default
194
230
  @private_ip_address = nil if @private_ip_address == UNSET_VALUE
195
231
 
232
+ # Acquire an elastic IP if requested
233
+ @elastic_ip = nil if @elastic_ip == UNSET_VALUE
234
+
196
235
  # Default region is us-east-1. This is sensible because AWS
197
236
  # generally defaults to this as well.
198
237
  @region = "us-east-1" if @region == UNSET_VALUE
@@ -206,12 +245,19 @@ module VagrantPlugins
206
245
  # Subnet is nil by default otherwise we'd launch into VPC.
207
246
  @subnet_id = nil if @subnet_id == UNSET_VALUE
208
247
 
248
+ # IAM Instance profile arn/name is nil by default.
249
+ @iam_instance_profile_arn = nil if @iam_instance_profile_arn == UNSET_VALUE
250
+ @iam_instance_profile_name = nil if @iam_instance_profile_name == UNSET_VALUE
251
+
209
252
  # By default we don't use an IAM profile
210
253
  @use_iam_profile = false if @use_iam_profile == UNSET_VALUE
211
254
 
212
255
  # User Data is nil by default
213
256
  @user_data = nil if @user_data == UNSET_VALUE
214
257
 
258
+ # default false
259
+ @terminate_on_shutdown = false if @terminate_on_shutdown == UNSET_VALUE
260
+
215
261
  # Compile our region specific configurations only within
216
262
  # NON-REGION-SPECIFIC configurations.
217
263
  if !@__region_specific
@@ -238,7 +284,7 @@ module VagrantPlugins
238
284
  end
239
285
 
240
286
  def validate(machine)
241
- errors = []
287
+ errors = _detected_errors
242
288
 
243
289
  errors << I18n.t("vagrant_aws.config.region_required") if @region.nil?
244
290
 
@@ -11,6 +11,10 @@ module VagrantPlugins
11
11
  error_key(:fog_error)
12
12
  end
13
13
 
14
+ class InternalFogError < VagrantAWSError
15
+ error_key(:internal_fog_error)
16
+ end
17
+
14
18
  class InstanceReadyTimeout < VagrantAWSError
15
19
  error_key(:instance_ready_timeout)
16
20
  end
@@ -18,6 +22,10 @@ module VagrantPlugins
18
22
  class RsyncError < VagrantAWSError
19
23
  error_key(:rsync_error)
20
24
  end
25
+
26
+ class MkdirError < VagrantAWSError
27
+ error_key(:mkdir_error)
28
+ end
21
29
  end
22
30
  end
23
31
  end
@@ -24,7 +24,7 @@ module VagrantPlugins
24
24
  Config
25
25
  end
26
26
 
27
- provider(:aws) do
27
+ provider(:aws, parallel: true) do
28
28
  # Setup logging and i18n
29
29
  setup_logging
30
30
  setup_i18n
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module AWS
3
- VERSION = "0.2.2"
3
+ VERSION = "0.3.0"
4
4
  end
5
5
  end
data/locales/en.yml CHANGED
@@ -28,6 +28,9 @@ en:
28
28
  Warning! The AWS provider doesn't support any of the Vagrant
29
29
  high-level network configurations (`config.vm.network`). They
30
30
  will be silently ignored.
31
+ will_not_destroy: |-
32
+ The instance '%{name}' will not be destroyed, since the confirmation
33
+ was declined.
31
34
 
32
35
  config:
33
36
  access_key_id_required: |-
@@ -47,18 +50,30 @@ en:
47
50
  below:
48
51
 
49
52
  %{message}
53
+ internal_fog_error: |-
54
+ There was an error talking to AWS. The error message is shown
55
+ below:
56
+
57
+ Error: %{error}
58
+ Response: %{response}
50
59
  instance_ready_timeout: |-
51
60
  The instance never became "ready" in AWS. The timeout currently
52
61
  set waiting for the instance to become ready is %{timeout} seconds.
53
62
  Please verify that the machine properly boots. If you need more time
54
63
  set the `instance_ready_timeout` configuration on the AWS provider.
55
64
  rsync_error: |-
56
- There was an error when attemping to rsync a share folder.
65
+ There was an error when attempting to rsync a share folder.
57
66
  Please inspect the error message below for more info.
58
67
 
59
68
  Host path: %{hostpath}
60
69
  Guest path: %{guestpath}
61
70
  Error: %{stderr}
71
+ mkdir_error: |-
72
+ There was an error when attempting to create a shared host folder.
73
+ Please inspect the error message below for more info.
74
+
75
+ Host path: %{hostpath}
76
+ Error: %{err}
62
77
 
63
78
  states:
64
79
  short_not_created: |-
@@ -71,3 +86,9 @@ en:
71
86
  long_running: |-
72
87
  The EC2 instance is running. To stop this machine, you can run
73
88
  `vagrant halt`. To destroy the machine, you can run `vagrant destroy`.
89
+
90
+ short_pending: |-
91
+ pending
92
+ long_pending: |-
93
+ The EC2 instance is still being initialized. To destroy this machine,
94
+ you can run `vagrant destroy`.
@@ -26,9 +26,14 @@ describe VagrantPlugins::AWS::Config do
26
26
  its("secret_access_key") { should be_nil }
27
27
  its("security_groups") { should == [] }
28
28
  its("subnet_id") { should be_nil }
29
+ its("iam_instance_profile_arn") { should be_nil }
30
+ its("iam_instance_profile_name") { should be_nil }
29
31
  its("tags") { should == {} }
30
32
  its("user_data") { should be_nil }
31
33
  its("use_iam_profile") { should be_false }
34
+ its("block_device_mapping") {should == [] }
35
+ its("elastic_ip") { should be_nil }
36
+ its("terminate_on_shutdown") { should == false }
32
37
  end
33
38
 
34
39
  describe "overriding defaults" do
@@ -39,8 +44,9 @@ describe VagrantPlugins::AWS::Config do
39
44
  [:access_key_id, :ami, :availability_zone, :instance_ready_timeout,
40
45
  :instance_type, :keypair_name,
41
46
  :region, :secret_access_key, :security_groups,
42
- :subnet_id, :tags,
43
- :use_iam_profile, :user_data].each do |attribute|
47
+ :subnet_id, :tags, :elastic_ip, :terminate_on_shutdown,
48
+ :iam_instance_profile_arn, :iam_instance_profile_name,
49
+ :use_iam_profile, :user_data, :block_device_mapping].each do |attribute|
44
50
 
45
51
  it "should not default #{attribute} if overridden" do
46
52
  instance.send("#{attribute}=".to_sym, "foo")
@@ -182,15 +188,19 @@ describe VagrantPlugins::AWS::Config do
182
188
  let(:first) { described_class.new }
183
189
  let(:second) { described_class.new }
184
190
 
185
- it "should merge the tags" do
191
+ it "should merge the tags and block_device_mappings" do
186
192
  first.tags["one"] = "one"
187
193
  second.tags["two"] = "two"
194
+ first.block_device_mapping = [{:one => "one"}]
195
+ second.block_device_mapping = [{:two => "two"}]
188
196
 
189
197
  third = first.merge(second)
190
198
  third.tags.should == {
191
199
  "one" => "one",
192
200
  "two" => "two"
193
201
  }
202
+ third.block_device_mapping.index({:one => "one"}).should_not be_nil
203
+ third.block_device_mapping.index({:two => "two"}).should_not be_nil
194
204
  end
195
205
  end
196
206
  end
@@ -0,0 +1,9 @@
1
+ {
2
+ "folders":
3
+ [
4
+ {
5
+ "follow_symlinks": true,
6
+ "path": "/home/tralamazza/projects/vagrant-aws"
7
+ }
8
+ ]
9
+ }
@@ -0,0 +1,305 @@
1
+ {
2
+ "auto_complete":
3
+ {
4
+ "selected_items":
5
+ [
6
+ ]
7
+ },
8
+ "buffers":
9
+ [
10
+ {
11
+ "file": "lib/vagrant-aws/action/run_instance.rb",
12
+ "settings":
13
+ {
14
+ "buffer_size": 8942,
15
+ "line_ending": "Unix"
16
+ }
17
+ },
18
+ {
19
+ "file": "README.md",
20
+ "settings":
21
+ {
22
+ "buffer_size": 7450,
23
+ "line_ending": "Unix"
24
+ }
25
+ }
26
+ ],
27
+ "build_system": "",
28
+ "command_palette":
29
+ {
30
+ "height": 92.0,
31
+ "selected_items":
32
+ [
33
+ [
34
+ "instal",
35
+ "Package Control: Install Package"
36
+ ],
37
+ [
38
+ "pul",
39
+ "Git: Pull"
40
+ ],
41
+ [
42
+ "pull",
43
+ "Git: Pull"
44
+ ],
45
+ [
46
+ "git pull",
47
+ "Git: Pull"
48
+ ],
49
+ [
50
+ "statu",
51
+ "Git: Status"
52
+ ],
53
+ [
54
+ "sssh",
55
+ "Set Syntax: Shell Script (Bash)"
56
+ ],
57
+ [
58
+ "ssruby",
59
+ "Set Syntax: Ruby"
60
+ ],
61
+ [
62
+ "space",
63
+ "Indentation: Convert to Spaces"
64
+ ],
65
+ [
66
+ "install",
67
+ "Package Control: Install Package"
68
+ ],
69
+ [
70
+ "upda",
71
+ "Package Control: Upgrade Package"
72
+ ],
73
+ [
74
+ "insta",
75
+ "Package Control: Install Package"
76
+ ]
77
+ ],
78
+ "width": 647.0
79
+ },
80
+ "console":
81
+ {
82
+ "height": 325.0,
83
+ "history":
84
+ [
85
+ "import urllib.request,os; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); open(os.path.join(ipp, pf), 'wb').write(urllib.request.urlopen( 'http://sublime.wbond.net/' + pf.replace(' ','%20')).read()) "
86
+ ]
87
+ },
88
+ "distraction_free":
89
+ {
90
+ "menu_visible": true,
91
+ "show_minimap": false,
92
+ "show_open_files": false,
93
+ "show_tabs": false,
94
+ "side_bar_visible": false,
95
+ "status_bar_visible": false
96
+ },
97
+ "file_history":
98
+ [
99
+ "/home/tralamazza/.config/sublime-text-3/Packages/GoSublime/CHANGELOG.md",
100
+ "/home/tralamazza/.config/sublime-text-3/Packages/GoSublime/USAGE.md",
101
+ "/home/tralamazza/.xinitrc",
102
+ "/home/tralamazza/projects/vagrant-aws/Vagrantfile",
103
+ "/home/tralamazza/.bash_profile",
104
+ "/home/tralamazza/.Xresources",
105
+ "/home/tralamazza/projects/vagrant-aws/README.md",
106
+ "/home/tralamazza/.zshrc",
107
+ "/home/tralamazza/.xmonad/xmonad.hs",
108
+ "/home/tralamazza/projects/vagrant-aws/Gemfile",
109
+ "/home/tralamazza/projects/vagrant-aws/lib/vagrant-aws/config.rb",
110
+ "/home/tralamazza/.zprofile",
111
+ "/home/tralamazza/projects/vagrant-aws/Rakefile",
112
+ "/home/tralamazza/.xmobarrc",
113
+ "/home/tralamazza/.vimrc",
114
+ "/home/tralamazza/projects/vagrant-aws/CHANGELOG.md",
115
+ "/home/tralamazza/projects/vagrant-aws/vagrant-aws.gemspec",
116
+ "/home/tralamazza/projects/vagrant-aws/.gitignore"
117
+ ],
118
+ "find":
119
+ {
120
+ "height": 34.0
121
+ },
122
+ "find_in_files":
123
+ {
124
+ "height": 90.0,
125
+ "where_history":
126
+ [
127
+ ""
128
+ ]
129
+ },
130
+ "find_state":
131
+ {
132
+ "case_sensitive": false,
133
+ "find_history":
134
+ [
135
+ "instance_ready_timeout",
136
+ "backgroun",
137
+ "back",
138
+ "backgroun"
139
+ ],
140
+ "highlight": true,
141
+ "in_selection": false,
142
+ "preserve_case": false,
143
+ "regex": false,
144
+ "replace_history":
145
+ [
146
+ ],
147
+ "reverse": false,
148
+ "show_context": true,
149
+ "use_buffer2": true,
150
+ "whole_word": false,
151
+ "wrap": true
152
+ },
153
+ "groups":
154
+ [
155
+ {
156
+ "selected": 0,
157
+ "sheets":
158
+ [
159
+ {
160
+ "buffer": 0,
161
+ "file": "lib/vagrant-aws/action/run_instance.rb",
162
+ "semi_transient": false,
163
+ "settings":
164
+ {
165
+ "buffer_size": 8942,
166
+ "regions":
167
+ {
168
+ },
169
+ "selection":
170
+ [
171
+ [
172
+ 1633,
173
+ 1633
174
+ ]
175
+ ],
176
+ "settings":
177
+ {
178
+ "syntax": "Packages/Ruby/Ruby.tmLanguage",
179
+ "tab_size": 2,
180
+ "translate_tabs_to_spaces": true
181
+ },
182
+ "translation.x": 0.0,
183
+ "translation.y": 0.0,
184
+ "zoom_level": 1.0
185
+ },
186
+ "type": "text"
187
+ },
188
+ {
189
+ "buffer": 1,
190
+ "file": "README.md",
191
+ "semi_transient": false,
192
+ "settings":
193
+ {
194
+ "buffer_size": 7450,
195
+ "regions":
196
+ {
197
+ },
198
+ "selection":
199
+ [
200
+ [
201
+ 888,
202
+ 888
203
+ ]
204
+ ],
205
+ "settings":
206
+ {
207
+ "syntax": "Packages/Markdown/Markdown.tmLanguage",
208
+ "tab_size": 2,
209
+ "translate_tabs_to_spaces": true
210
+ },
211
+ "translation.x": 0.0,
212
+ "translation.y": 0.0,
213
+ "zoom_level": 1.0
214
+ },
215
+ "type": "text"
216
+ }
217
+ ]
218
+ }
219
+ ],
220
+ "incremental_find":
221
+ {
222
+ "height": 23.0
223
+ },
224
+ "input":
225
+ {
226
+ "height": 0.0
227
+ },
228
+ "layout":
229
+ {
230
+ "cells":
231
+ [
232
+ [
233
+ 0,
234
+ 0,
235
+ 1,
236
+ 1
237
+ ]
238
+ ],
239
+ "cols":
240
+ [
241
+ 0.0,
242
+ 1.0
243
+ ],
244
+ "rows":
245
+ [
246
+ 0.0,
247
+ 1.0
248
+ ]
249
+ },
250
+ "menu_visible": true,
251
+ "output.GoSublime-output":
252
+ {
253
+ "height": 100.0
254
+ },
255
+ "output.MarGo-output":
256
+ {
257
+ "height": 100.0
258
+ },
259
+ "output.git":
260
+ {
261
+ "height": 185.0
262
+ },
263
+ "project": "vagrant-aws.sublime-project",
264
+ "replace":
265
+ {
266
+ "height": 42.0
267
+ },
268
+ "save_all_on_build": true,
269
+ "select_file":
270
+ {
271
+ "height": 0.0,
272
+ "selected_items":
273
+ [
274
+ ],
275
+ "width": 0.0
276
+ },
277
+ "select_project":
278
+ {
279
+ "height": 0.0,
280
+ "selected_items":
281
+ [
282
+ ],
283
+ "width": 0.0
284
+ },
285
+ "select_symbol":
286
+ {
287
+ "height": 0.0,
288
+ "selected_items":
289
+ [
290
+ ],
291
+ "width": 0.0
292
+ },
293
+ "settings":
294
+ {
295
+ },
296
+ "show_minimap": false,
297
+ "show_open_files": false,
298
+ "show_tabs": true,
299
+ "side_bar_visible": true,
300
+ "side_bar_width": 172.0,
301
+ "status_bar_visible": true,
302
+ "template_settings":
303
+ {
304
+ }
305
+ }
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-aws
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
5
- prerelease:
4
+ version: 0.3.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Mitchell Hashimoto
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-04-18 00:00:00.000000000 Z
11
+ date: 2013-09-02 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: fog
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ~>
28
25
  - !ruby/object:Gem::Version
@@ -30,23 +27,20 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rake
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - '>='
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - '>='
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: rspec-core
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
45
  - - ~>
52
46
  - !ruby/object:Gem::Version
@@ -54,7 +48,6 @@ dependencies:
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
52
  - - ~>
60
53
  - !ruby/object:Gem::Version
@@ -62,7 +55,6 @@ dependencies:
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: rspec-expectations
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
59
  - - ~>
68
60
  - !ruby/object:Gem::Version
@@ -70,7 +62,6 @@ dependencies:
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
66
  - - ~>
76
67
  - !ruby/object:Gem::Version
@@ -78,7 +69,6 @@ dependencies:
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: rspec-mocks
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
73
  - - ~>
84
74
  - !ruby/object:Gem::Version
@@ -86,7 +76,6 @@ dependencies:
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
80
  - - ~>
92
81
  - !ruby/object:Gem::Version
@@ -97,62 +86,61 @@ executables: []
97
86
  extensions: []
98
87
  extra_rdoc_files: []
99
88
  files:
100
- - CHANGELOG.md
89
+ - vagrant-aws.sublime-project
90
+ - LICENSE
101
91
  - dummy.box
102
- - example_box/metadata.json
103
- - example_box/README.md
104
- - Gemfile
105
- - lib/vagrant-aws/action/connect_aws.rb
92
+ - lib/vagrant-aws/action.rb
93
+ - lib/vagrant-aws/plugin.rb
94
+ - lib/vagrant-aws/util/timer.rb
95
+ - lib/vagrant-aws/action/run_instance.rb
106
96
  - lib/vagrant-aws/action/is_created.rb
107
- - lib/vagrant-aws/action/message_already_created.rb
108
- - lib/vagrant-aws/action/message_not_created.rb
97
+ - lib/vagrant-aws/action/message_will_not_destroy.rb
98
+ - lib/vagrant-aws/action/terminate_instance.rb
109
99
  - lib/vagrant-aws/action/read_ssh_info.rb
110
100
  - lib/vagrant-aws/action/read_state.rb
111
- - lib/vagrant-aws/action/run_instance.rb
101
+ - lib/vagrant-aws/action/connect_aws.rb
112
102
  - lib/vagrant-aws/action/sync_folders.rb
113
- - lib/vagrant-aws/action/terminate_instance.rb
103
+ - lib/vagrant-aws/action/message_not_created.rb
104
+ - lib/vagrant-aws/action/message_already_created.rb
114
105
  - lib/vagrant-aws/action/timed_provision.rb
115
106
  - lib/vagrant-aws/action/warn_networks.rb
116
- - lib/vagrant-aws/action.rb
107
+ - lib/vagrant-aws/provider.rb
117
108
  - lib/vagrant-aws/config.rb
118
109
  - lib/vagrant-aws/errors.rb
119
- - lib/vagrant-aws/plugin.rb
120
- - lib/vagrant-aws/provider.rb
121
- - lib/vagrant-aws/util/timer.rb
122
110
  - lib/vagrant-aws/version.rb
123
111
  - lib/vagrant-aws.rb
124
- - LICENSE
112
+ - Gemfile
113
+ - CHANGELOG.md
114
+ - spec/vagrant-aws/config_spec.rb
125
115
  - locales/en.yml
126
- - Rakefile
127
116
  - README.md
128
- - spec/vagrant-aws/config_spec.rb
117
+ - Rakefile
118
+ - example_box/metadata.json
119
+ - example_box/README.md
129
120
  - vagrant-aws.gemspec
121
+ - vagrant-aws.sublime-workspace
130
122
  - .gitignore
131
123
  homepage: http://www.vagrantup.com
132
124
  licenses: []
125
+ metadata: {}
133
126
  post_install_message:
134
127
  rdoc_options: []
135
128
  require_paths:
136
129
  - lib
137
130
  required_ruby_version: !ruby/object:Gem::Requirement
138
- none: false
139
131
  requirements:
140
- - - ! '>='
132
+ - - '>='
141
133
  - !ruby/object:Gem::Version
142
134
  version: '0'
143
- segments:
144
- - 0
145
- hash: 2792684952682932996
146
135
  required_rubygems_version: !ruby/object:Gem::Requirement
147
- none: false
148
136
  requirements:
149
- - - ! '>='
137
+ - - '>='
150
138
  - !ruby/object:Gem::Version
151
139
  version: 1.3.6
152
140
  requirements: []
153
141
  rubyforge_project: vagrant-aws
154
- rubygems_version: 1.8.23
142
+ rubygems_version: 2.0.7
155
143
  signing_key:
156
- specification_version: 3
144
+ specification_version: 4
157
145
  summary: Enables Vagrant to manage machines in EC2 and VPC.
158
146
  test_files: []