vagrant-aws-mkubenka 0.7.2.pre.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +21 -0
  3. data/.rspec +1 -0
  4. data/.travis.yml +19 -0
  5. data/CHANGELOG.md +96 -0
  6. data/Gemfile +12 -0
  7. data/LICENSE +8 -0
  8. data/README.md +326 -0
  9. data/Rakefile +22 -0
  10. data/dummy.box +0 -0
  11. data/example_box/README.md +13 -0
  12. data/example_box/metadata.json +3 -0
  13. data/lib/vagrant-aws.rb +18 -0
  14. data/lib/vagrant-aws/action.rb +210 -0
  15. data/lib/vagrant-aws/action/connect_aws.rb +48 -0
  16. data/lib/vagrant-aws/action/elb_deregister_instance.rb +24 -0
  17. data/lib/vagrant-aws/action/elb_register_instance.rb +24 -0
  18. data/lib/vagrant-aws/action/is_created.rb +18 -0
  19. data/lib/vagrant-aws/action/is_stopped.rb +18 -0
  20. data/lib/vagrant-aws/action/message_already_created.rb +16 -0
  21. data/lib/vagrant-aws/action/message_not_created.rb +16 -0
  22. data/lib/vagrant-aws/action/message_will_not_destroy.rb +16 -0
  23. data/lib/vagrant-aws/action/package_instance.rb +192 -0
  24. data/lib/vagrant-aws/action/read_ssh_info.rb +53 -0
  25. data/lib/vagrant-aws/action/read_state.rb +38 -0
  26. data/lib/vagrant-aws/action/run_instance.rb +311 -0
  27. data/lib/vagrant-aws/action/start_instance.rb +81 -0
  28. data/lib/vagrant-aws/action/stop_instance.rb +28 -0
  29. data/lib/vagrant-aws/action/terminate_instance.rb +51 -0
  30. data/lib/vagrant-aws/action/timed_provision.rb +21 -0
  31. data/lib/vagrant-aws/action/wait_for_state.rb +41 -0
  32. data/lib/vagrant-aws/action/warn_networks.rb +19 -0
  33. data/lib/vagrant-aws/config.rb +564 -0
  34. data/lib/vagrant-aws/errors.rb +43 -0
  35. data/lib/vagrant-aws/plugin.rb +73 -0
  36. data/lib/vagrant-aws/provider.rb +50 -0
  37. data/lib/vagrant-aws/util/elb.rb +58 -0
  38. data/lib/vagrant-aws/util/timer.rb +17 -0
  39. data/lib/vagrant-aws/version.rb +5 -0
  40. data/locales/en.yml +159 -0
  41. data/spec/spec_helper.rb +1 -0
  42. data/spec/vagrant-aws/config_spec.rb +374 -0
  43. data/templates/metadata.json.erb +3 -0
  44. data/templates/vagrant-aws_package_Vagrantfile.erb +5 -0
  45. data/vagrant-aws-mkubenka.gemspec +62 -0
  46. metadata +163 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: dedbb4d147a323c11c9fb699e05644974e543068
4
+ data.tar.gz: 0ee09e22353f04ff122fbf4ce036141252a7f787
5
+ SHA512:
6
+ metadata.gz: 6def0553a749fc93e5b5b825ef85b3e0066c62f8ef549afcdfbf0c3920d5f4316c1fb08dc88cb28f67a7d36009d4d647305c64b9d0805fd906453c9227b31244
7
+ data.tar.gz: 86b8a867cba91d9f6158f0ebaa70c0e787baba496aef867578e70dc973547de69c734e6ee3f010a4d1857d009befdb77274d87c0d0246a6daaf43ec3293a030c
data/.gitignore ADDED
@@ -0,0 +1,21 @@
1
+ # OS-specific
2
+ .DS_Store
3
+
4
+ # editors
5
+ *.swp
6
+
7
+ # Bundler/Rubygems
8
+ *.gem
9
+ .bundle
10
+ pkg/*
11
+ tags
12
+ Gemfile.lock
13
+
14
+ # Vagrant
15
+ .vagrant
16
+ Vagrantfile
17
+ !example_box/Vagrantfile
18
+
19
+ # RVM files for gemset/ruby setting
20
+ .ruby-*
21
+ .rvmrc
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --format doc --order random --color --fail-fast
data/.travis.yml ADDED
@@ -0,0 +1,19 @@
1
+ language: ruby
2
+
3
+ sudo: false
4
+
5
+ cache: bundler
6
+
7
+ rvm:
8
+ - 2.2.7
9
+ - 2.3.4
10
+
11
+ deploy:
12
+ provider: rubygems
13
+ api_key:
14
+ secure: A1AYezvoon6JdYHphtrUEeG98r7AtFqsPcETp4BX3sPlSvOghHqco57/JasxFBFbis1irfVxhjqIFaS0lfOO0yxfIJQFnbZ6tTzKJB7IkSWUMuVfGo6qRxnO4vnuodx9Vhh27A7lovuptMCQBDdHXoSPUjgqHacrEzYKLDOarHercnRNRT9mWYR//qFO4RHtQz7hG+6p9tUvGmSeUkXB6AZwDPycPAJgrCd6bRYwlTmID6Jlq07bjcqfTTN+jZzdC22nhgjw2Cao0skcszO3H71DZYeFhoRIA8sMKXnNt7LGtvA2FJFM65bJj3TLVVpDe5Itn/KpSLSwuE9phPpVhv828S98h8pbLVYrhat+2jvNOqwtVw9C0LC9GpPlBcd/8AYuDwEO5a+hdnZ08JnihzqSvQd2XX9XvBiKy/A5mBc5D9bYJ3YXsy6zXToMM0nP8Xr0z3NCEFWtJ3ueGzHVmsZqwdoiH/2g6syx4k1YBHb9zdeGciMdk1vmckPYZJLpGh4cj4bDeIHaGPaZ2tYiBSaQNN+6YEMShQgl1d5k5Du6lHdUKnYR4Z7lvQkjfU73lkDoA9PvZuR7b7yi44stEvsxTpNJCZUZN0JmlXAsGlS3hDpD8/LcJWI6M0y7tBPQ3gEB/3YSAYsAcqJZNZ3wyTuqLPZBPJFr6Prwq3VoMhU=
15
+ gem: vagrant-aws-mkubenka
16
+ on:
17
+ repo: mkubenka/vagrant-aws
18
+ branch: mkubenka
19
+ rvm: 2.3.4
data/CHANGELOG.md ADDED
@@ -0,0 +1,96 @@
1
+ # 0.6.1
2
+
3
+ * Added configurable instance state check interval
4
+
5
+ # 0.6.0 (December 13, 2014)
6
+
7
+ * Support static Elastic IP addresses.
8
+ * Support for creating AMIs with the `vagrant package`
9
+
10
+ # 0.5.0 (June 22, 2014)
11
+
12
+ * Support for associating public IPs for VMs inside of VPCs (GH
13
+ [#219](https://github.com/mitchellh/vagrant-aws/pull/219), GH
14
+ [#205](https://github.com/mitchellh/vagrant-aws/issues/205))
15
+ * Bug-fix for per region configs with `associate_public_ip` (GH
16
+ [#237](https://github.com/mitchellh/vagrant-aws/pull/237))
17
+ * rsyncing folders uses `--delete` flag to better emulate "real shared folders
18
+ (GH [#194](https://github.com/mitchellh/vagrant-aws/pull/194))
19
+ * fog gem version bumped to 1.22 (GH [#253](https://github.com/mitchellh/vagrant-aws/pull/253))
20
+ * Simple ELB support (GH [#88](https://github.com/mitchellh/vagrant-aws/pull/88),
21
+ GH [#238](https://github.com/mitchellh/vagrant-aws/pull/238))
22
+
23
+ # 0.4.1 (December 17, 2013)
24
+
25
+ * Update fog.io to 1.18.0
26
+ * Fix sync folder user permissions (GH #175)
27
+ * Fix vagrant < 1.3.0 provisioner compatibility (GH #173)
28
+ * Add vagrant 1.4.0 multiple SSH key support (GH #172)
29
+ * Fix EIP deallocation bug (GH #164)
30
+ * Add (per shared folder) rsync exclude flag (GH #156)
31
+
32
+ # 0.4.0 (October 11, 2013)
33
+
34
+ * Handle EIP allocation error (GH #134)
35
+ * Implement halt and reload (GH #31)
36
+ * rsync ignores Vagrantfile
37
+ * warn if none of the security groups allows incoming SSH
38
+ * bump fog.io to 1.15.0
39
+ * Fix rsync on windows (GH #77)
40
+ * Add `ssh_host_attribute` config (GH #143)
41
+
42
+ # 0.3.0 (September 2, 2013)
43
+
44
+ * Parallelize multi-machine up on Vagrant 1.2+
45
+ * Show proper configuration errors if an invalid configuration key
46
+ is used.
47
+ * Request confirmation on `vagrant destroy`, like normal VirtualBox + Vagrant.
48
+ * If user data is configured, output is shown on "vagrant up" that
49
+ it is being set.
50
+ * Add EIP support (GH #65)
51
+ * Add block device mapping support (GH #93)
52
+ * README improvements (GH #120)
53
+ * Fix missing locale message (GH #73)
54
+ * SyncFolders creates hostpath if it doesn't exist and `:create` option is set (GH #17)
55
+ * Add IAM Instance Profile support (GH #68)
56
+ * Add shutdown behavior support (GH #125,#131)
57
+
58
+ # 0.2.2 (April 18, 2013)
59
+
60
+ * Fix crashing bug with incorrect provisioner arguments.
61
+
62
+ # 0.2.1 (April 16, 2013)
63
+
64
+ * Got rid of extranneous references to old SSH settings.
65
+
66
+ # 0.2.0 (April 16, 2013)
67
+
68
+ * Add support for `vagrant ssh -c` [GH-42]
69
+ * Ability to specify a timeout for waiting for instances to become ready. [GH-44]
70
+ * Better error message if instance didn't become ready in time.
71
+ * Connection can now be done using IAM profiles. [GH-41]
72
+
73
+ # 0.1.3 (April 9, 2013)
74
+
75
+ * The `AWS_ACCESS_KEY` and `AWS_SECRET_KEY` will be used if available
76
+ and no specific keys are set in the Vagrantfile. [GH-33]
77
+ * Fix issues with SSH on VPCs, the correct IP is used. [GH-30]
78
+ * Exclude the ".vagrant" directory from rsync.
79
+ * Implement `:disabled` flag support for shared folders. [GH-29]
80
+ * `aws.user_data` to specify user data on the instance. [GH-26]
81
+
82
+ # 0.1.2 (March 22, 2013)
83
+
84
+ * Choose the proper region when connecting to AWS. [GH-9]
85
+ * Configurable SSH port. [GH-13]
86
+ * Support other AWS-compatible API endpoints with `config.endpoint`
87
+ and `config.version`. [GH-6]
88
+ * Disable strict host key checking on rsync so known hosts aren't an issue. [GH-7]
89
+
90
+ # 0.1.1 (March 18, 2013)
91
+
92
+ * Up fog dependency for Vagrant 1.1.1
93
+
94
+ # 0.1.0 (March 14, 2013)
95
+
96
+ * Initial release.
data/Gemfile ADDED
@@ -0,0 +1,12 @@
1
+ source "https://rubygems.org"
2
+
3
+ group :development do
4
+ # We depend on Vagrant for development, but we don't add it as a
5
+ # gem dependency because we expect to be installed within the
6
+ # Vagrant environment itself using `vagrant plugin`.
7
+ gem "vagrant", :git => "https://github.com/mitchellh/vagrant.git"
8
+ end
9
+
10
+ group :plugins do
11
+ gemspec
12
+ end
data/LICENSE ADDED
@@ -0,0 +1,8 @@
1
+ The MIT License (MIT)
2
+ Copyright (c) 2014 Mitchell Hashimoto
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5
+
6
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7
+
8
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,326 @@
1
+ # Vagrant AWS Provider
2
+ [![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/mitchellh/vagrant-aws?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
3
+
4
+ <span class="badges">
5
+ [![Gem Version](https://badge.fury.io/rb/vagrant-aws.png)][gem]
6
+ [![Dependency Status](https://gemnasium.com/mitchellh/vagrant-aws.png)][gemnasium]
7
+ </span>
8
+
9
+ [gem]: https://rubygems.org/gems/vagrant-aws
10
+ [gemnasium]: https://gemnasium.com/mitchellh/vagrant-aws
11
+
12
+ This is a [Vagrant](http://www.vagrantup.com) 1.2+ plugin that adds an [AWS](http://aws.amazon.com)
13
+ provider to Vagrant, allowing Vagrant to control and provision machines in
14
+ EC2 and VPC.
15
+
16
+ **NOTE:** This plugin requires Vagrant 1.2+,
17
+
18
+ ## Features
19
+
20
+ * Boot EC2 or VPC instances.
21
+ * SSH into the instances.
22
+ * Provision the instances with any built-in Vagrant provisioner.
23
+ * Minimal synced folder support via `rsync`.
24
+ * Define region-specific configurations so Vagrant can manage machines
25
+ in multiple regions.
26
+ * Package running instances into new vagrant-aws friendly boxes
27
+
28
+ ## Usage
29
+
30
+ Install using standard Vagrant 1.1+ plugin installation methods. After
31
+ installing, `vagrant up` and specify the `aws` provider. An example is
32
+ shown below.
33
+
34
+ ```
35
+ $ vagrant plugin install vagrant-aws
36
+ ...
37
+ $ vagrant up --provider=aws
38
+ ...
39
+ ```
40
+
41
+ Of course prior to doing this, you'll need to obtain an AWS-compatible
42
+ box file for Vagrant.
43
+
44
+ ## Quick Start
45
+
46
+ After installing the plugin (instructions above), the quickest way to get
47
+ started is to actually use a dummy AWS box and specify all the details
48
+ manually within a `config.vm.provider` block. So first, add the dummy
49
+ box using any name you want:
50
+
51
+ ```
52
+ $ vagrant box add dummy https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box
53
+ ...
54
+ ```
55
+
56
+ And then make a Vagrantfile that looks like the following, filling in
57
+ your information where necessary.
58
+
59
+ ```
60
+ Vagrant.configure("2") do |config|
61
+ config.vm.box = "dummy"
62
+
63
+ config.vm.provider :aws do |aws, override|
64
+ aws.access_key_id = "YOUR KEY"
65
+ aws.secret_access_key = "YOUR SECRET KEY"
66
+ aws.session_token = "SESSION TOKEN"
67
+ aws.keypair_name = "KEYPAIR NAME"
68
+
69
+ aws.ami = "ami-7747d01e"
70
+
71
+ override.ssh.username = "ubuntu"
72
+ override.ssh.private_key_path = "PATH TO YOUR PRIVATE KEY"
73
+ end
74
+ end
75
+ ```
76
+
77
+ And then run `vagrant up --provider=aws`.
78
+
79
+ This will start an Ubuntu 12.04 instance in the us-east-1 region within
80
+ your account. And assuming your SSH information was filled in properly
81
+ within your Vagrantfile, SSH and provisioning will work as well.
82
+
83
+ Note that normally a lot of this boilerplate is encoded within the box
84
+ file, but the box file used for the quick start, the "dummy" box, has
85
+ no preconfigured defaults.
86
+
87
+ If you have issues with SSH connecting, make sure that the instances
88
+ are being launched with a security group that allows SSH access.
89
+
90
+ Note: if you don't configure `aws.access_key_id` or `aws_secret_access_key`
91
+ it will attempt to read credentials from environment variables first and then
92
+ from `$HOME/.aws/`. You can choose your AWS profile and files location by using
93
+ `aws.aws_profile` and `aws.aws_dir`, however environment variables will always
94
+ have precedence as defined by the [AWS documentation](http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html).
95
+ To use profile `vagrantDev` from your AWS files:
96
+ ```ruby
97
+ # this first line can actually be omitted
98
+ aws.aws_dir = ENV['HOME'] + "/.aws/"
99
+ aws.aws_profile = "vagrantDev"
100
+ ```
101
+
102
+
103
+ ## Box Format
104
+
105
+ Every provider in Vagrant must introduce a custom box format. This
106
+ provider introduces `aws` boxes. You can view an example box in
107
+ the [example_box/ directory](https://github.com/mitchellh/vagrant-aws/tree/master/example_box).
108
+ That directory also contains instructions on how to build a box.
109
+
110
+ The box format is basically just the required `metadata.json` file
111
+ along with a `Vagrantfile` that does default settings for the
112
+ provider-specific configuration for this provider.
113
+
114
+ ## Configuration
115
+
116
+ This provider exposes quite a few provider-specific configuration options:
117
+
118
+ * `access_key_id` - The access key for accessing AWS
119
+ * `ami` - The AMI id to boot, such as "ami-12345678"
120
+ * `availability_zone` - The availability zone within the region to launch
121
+ the instance. If nil, it will use the default set by Amazon.
122
+ * `aws_profile` - AWS profile in your config files. Defaults to *default*.
123
+ * `aws_dir` - AWS config and credentials location. Defaults to *$HOME/.aws/*.
124
+ * `instance_ready_timeout` - The number of seconds to wait for the instance
125
+ to become "ready" in AWS. Defaults to 120 seconds.
126
+ * `instance_check_interval` - The number of seconds to wait to check the instance's
127
+ state
128
+ * `instance_package_timeout` - The number of seconds to wait for the instance
129
+ to be burnt into an AMI during packaging. Defaults to 600 seconds.
130
+ * `instance_type` - The type of instance, such as "m3.medium". The default
131
+ value of this if not specified is "m3.medium". "m1.small" has been
132
+ deprecated in "us-east-1" and "m3.medium" is the smallest instance
133
+ type to support both paravirtualization and hvm AMIs
134
+ * `keypair_name` - The name of the keypair to use to bootstrap AMIs
135
+ which support it.
136
+ * `monitoring` - Set to "true" to enable detailed monitoring.
137
+ * `session_token` - The session token provided by STS
138
+ * `private_ip_address` - The private IP address to assign to an instance
139
+ within a [VPC](http://aws.amazon.com/vpc/)
140
+ * `elastic_ip` - Can be set to 'true', or to an existing Elastic IP address.
141
+ If true, allocate a new Elastic IP address to the instance. If set
142
+ to an existing Elastic IP address, assign the address to the instance.
143
+ * `region` - The region to start the instance in, such as "us-east-1"
144
+ * `secret_access_key` - The secret access key for accessing AWS
145
+ * `security_groups` - An array of security groups for the instance. If this
146
+ instance will be launched in VPC, this must be a list of security group
147
+ Name. For a nondefault VPC, you must use security group IDs instead (http://docs.aws.amazon.com/cli/latest/reference/ec2/run-instances.html).
148
+ * `iam_instance_profile_arn` - The Amazon resource name (ARN) of the IAM Instance
149
+ Profile to associate with the instance
150
+ * `iam_instance_profile_name` - The name of the IAM Instance Profile to associate
151
+ with the instance
152
+ * `subnet_id` - The subnet to boot the instance into, for VPC.
153
+ * `associate_public_ip` - If true, will associate a public IP address to an instance in a VPC.
154
+ * `ssh_host_attribute` - If `:public_ip_address`, `:dns_name`, or
155
+ `:private_ip_address`, will use the public IP address, DNS name, or private
156
+ IP address, respectively, to SSH to the instance. By default Vagrant uses the
157
+ first of these (in this order) that is known. However, this can lead to
158
+ connection issues if, e.g., you are assigning a public IP address but your
159
+ security groups prevent public SSH access and require you to SSH in via the
160
+ private IP address; specify `:private_ip_address` in this case.
161
+ * `tenancy` - When running in a VPC configure the tenancy of the instance. Supports 'default' and 'dedicated'.
162
+ * `tags` - A hash of tags to set on the machine.
163
+ * `package_tags` - A hash of tags to set on the ami generated during the package operation.
164
+ * `use_iam_profile` - If true, will use [IAM profiles](http://docs.aws.amazon.com/IAM/latest/UserGuide/instance-profiles.html)
165
+ for credentials.
166
+ * `block_device_mapping` - Amazon EC2 Block Device Mapping Property
167
+ * `elb` - The ELB name to attach to the instance.
168
+ * `unregister_elb_from_az` - Removes the ELB from the AZ on removal of the last instance if true (default). In non default VPC this has to be false.
169
+ * `terminate_on_shutdown` - Indicates whether an instance stops or terminates
170
+ when you initiate shutdown from the instance.
171
+ * `endpoint` - The endpoint URL for connecting to AWS (or an AWS-like service). Only required for non AWS clouds, such as [eucalyptus](https://github.com/eucalyptus/eucalyptus/wiki).
172
+
173
+ These can be set like typical provider-specific configuration:
174
+
175
+ ```ruby
176
+ Vagrant.configure("2") do |config|
177
+ # ... other stuff
178
+
179
+ config.vm.provider :aws do |aws|
180
+ aws.access_key_id = "foo"
181
+ aws.secret_access_key = "bar"
182
+ end
183
+ end
184
+ ```
185
+
186
+ Note that you do not have to hard code your `aws.access_key_id` or `aws.secret_access_key`
187
+ as they will be retrieved from the enviornment variables `AWS_ACCESS_KEY` and `AWS_SECRET_KEY`.
188
+
189
+ In addition to the above top-level configs, you can use the `region_config`
190
+ method to specify region-specific overrides within your Vagrantfile. Note
191
+ that the top-level `region` config must always be specified to choose which
192
+ region you want to actually use, however. This looks like this:
193
+
194
+ ```ruby
195
+ Vagrant.configure("2") do |config|
196
+ # ... other stuff
197
+
198
+ config.vm.provider :aws do |aws|
199
+ aws.access_key_id = "foo"
200
+ aws.secret_access_key = "bar"
201
+ aws.region = "us-east-1"
202
+
203
+ # Simple region config
204
+ aws.region_config "us-east-1", :ami => "ami-12345678"
205
+
206
+ # More comprehensive region config
207
+ aws.region_config "us-west-2" do |region|
208
+ region.ami = "ami-87654321"
209
+ region.keypair_name = "company-west"
210
+ end
211
+ end
212
+ end
213
+ ```
214
+
215
+ The region-specific configurations will override the top-level
216
+ configurations when that region is used. They otherwise inherit
217
+ the top-level configurations, as you would probably expect.
218
+
219
+ ## Networks
220
+
221
+ Networking features in the form of `config.vm.network` are not
222
+ supported with `vagrant-aws`, currently. If any of these are
223
+ specified, Vagrant will emit a warning, but will otherwise boot
224
+ the AWS machine.
225
+
226
+ ## Synced Folders
227
+
228
+ There is minimal support for synced folders. Upon `vagrant up`,
229
+ `vagrant reload`, and `vagrant provision`, the AWS provider will use
230
+ `rsync` (if available) to uni-directionally sync the folder to
231
+ the remote machine over SSH.
232
+
233
+ See [Vagrant Synced folders: rsync](https://docs.vagrantup.com/v2/synced-folders/rsync.html)
234
+
235
+
236
+ ## Other Examples
237
+
238
+ ### Tags
239
+
240
+ To use tags, simply define a hash of key/value for the tags you want to associate to your instance, like:
241
+
242
+ ```ruby
243
+ Vagrant.configure("2") do |config|
244
+ # ... other stuff
245
+
246
+ config.vm.provider "aws" do |aws|
247
+ aws.tags = {
248
+ 'Name' => 'Some Name',
249
+ 'Some Key' => 'Some Value'
250
+ }
251
+ end
252
+ end
253
+ ```
254
+
255
+ ### User data
256
+
257
+ You can specify user data for the instance being booted.
258
+
259
+ ```ruby
260
+ Vagrant.configure("2") do |config|
261
+ # ... other stuff
262
+
263
+ config.vm.provider "aws" do |aws|
264
+ # Option 1: a single string
265
+ aws.user_data = "#!/bin/bash\necho 'got user data' > /tmp/user_data.log\necho"
266
+
267
+ # Option 2: use a file
268
+ aws.user_data = File.read("user_data.txt")
269
+ end
270
+ end
271
+ ```
272
+
273
+ ### Disk size
274
+
275
+ Need more space on your instance disk? Increase the disk size.
276
+
277
+ ```ruby
278
+ Vagrant.configure("2") do |config|
279
+ # ... other stuff
280
+
281
+ config.vm.provider "aws" do |aws|
282
+ aws.block_device_mapping = [{ 'DeviceName' => '/dev/sda1', 'Ebs.VolumeSize' => 50 }]
283
+ end
284
+ end
285
+ ```
286
+
287
+ ### ELB (Elastic Load Balancers)
288
+
289
+ You can automatically attach an instance to an ELB during boot and detach on destroy.
290
+
291
+ ```ruby
292
+ Vagrant.configure("2") do |config|
293
+ # ... other stuff
294
+
295
+ config.vm.provider "aws" do |aws|
296
+ aws.elb = "production-web"
297
+ end
298
+ end
299
+ ```
300
+
301
+ ## Development
302
+
303
+ To work on the `vagrant-aws` plugin, clone this repository out, and use
304
+ [Bundler](http://gembundler.com) to get the dependencies:
305
+
306
+ ```
307
+ $ bundle
308
+ ```
309
+
310
+ Once you have the dependencies, verify the unit tests pass with `rake`:
311
+
312
+ ```
313
+ $ bundle exec rake
314
+ ```
315
+
316
+ If those pass, you're ready to start developing the plugin. You can test
317
+ the plugin without installing it into your Vagrant environment by just
318
+ creating a `Vagrantfile` in the top level of this directory (it is gitignored)
319
+ and add the following line to your `Vagrantfile`
320
+ ```ruby
321
+ Vagrant.require_plugin "vagrant-aws"
322
+ ```
323
+ Use bundler to execute Vagrant:
324
+ ```
325
+ $ bundle exec vagrant up --provider=aws
326
+ ```