vagrant-aws-iam-decoder 0.7.2

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-iam-decoder.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 +396 -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 +601 -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 +161 -0
  41. data/spec/spec_helper.rb +1 -0
  42. data/spec/vagrant-aws/config_spec.rb +395 -0
  43. data/templates/metadata.json.erb +3 -0
  44. data/templates/vagrant-aws_package_Vagrantfile.erb +5 -0
  45. data/vagrant-aws-iam-decoder.gemspec +62 -0
  46. metadata +163 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 3d2e1759c276a0ad64d7b14cc44d74f085ade2c5
4
+ data.tar.gz: 2e02d1ae5872abad3314153c79bd615dc9ea2fe1
5
+ SHA512:
6
+ metadata.gz: 017dc90db1e3c874b7239c98342b990cacf26962963c05f4e4301d4e9320d92ac3a2977846407d9c5770d82a4cd05e95123a64fe0e75ba69cbdd6829d64cde78
7
+ data.tar.gz: 3a6fe4c612d31806b7ce7e47dcc23795f5aba2d2d5bd4d0b90b22c812c3091a9e3d252851de76b9247a3f40e08c13e06fcff7bd589bb7942312eb619649a617b
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-iam-decoder
16
+ on:
17
+ repo: iam-decoder/vagrant-aws
18
+ branch: iam-decoder
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 it 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
+
3
+ [![Build Status](https://travis-ci.org/iam-decoder/vagrant-aws.svg?branch=iam-decoder)](https://travis-ci.org/iam-decoder/vagrant-aws)
4
+ [![Gem Version](https://badge.fury.io/rb/vagrant-aws-iam-decoder.svg)](https://badge.fury.io/rb/vagrant-aws-iam-decoder)
5
+
6
+ This is a [Vagrant](http://www.vagrantup.com) 1.2+ plugin that adds an [AWS](http://aws.amazon.com)
7
+ provider to Vagrant, allowing Vagrant to control and provision machines in
8
+ EC2 and VPC.
9
+
10
+ **NOTE:** This plugin requires Vagrant 1.2+,
11
+
12
+ ## Features
13
+
14
+ * Boot EC2 or VPC instances.
15
+ * SSH into the instances.
16
+ * Provision the instances with any built-in Vagrant provisioner.
17
+ * Minimal synced folder support via `rsync`.
18
+ * Define region-specific configurations so Vagrant can manage machines
19
+ in multiple regions.
20
+ * Package running instances into new vagrant-aws friendly boxes
21
+ * Spot Instance Support
22
+
23
+ ## Usage
24
+
25
+ Install using standard Vagrant 1.1+ plugin installation methods. After
26
+ installing, `vagrant up` and specify the `aws` provider. An example is
27
+ shown below.
28
+
29
+ ```
30
+ $ vagrant plugin install vagrant-aws-iam-decoder
31
+ ...
32
+ $ vagrant up --provider=aws
33
+ ...
34
+ ```
35
+
36
+ Of course prior to doing this, you'll need to obtain an AWS-compatible
37
+ box file for Vagrant.
38
+
39
+ ## Quick Start
40
+
41
+ After installing the plugin (instructions above), the quickest way to get
42
+ started is to actually use a dummy AWS box and specify all the details
43
+ manually within a `config.vm.provider` block. So first, add the dummy
44
+ box using any name you want:
45
+
46
+ ```
47
+ $ vagrant box add dummy https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box
48
+ ...
49
+ ```
50
+
51
+ And then make a Vagrantfile that looks like the following, filling in
52
+ your information where necessary.
53
+
54
+ ```
55
+ Vagrant.configure("2") do |config|
56
+ config.vm.box = "dummy"
57
+
58
+ config.vm.provider :aws do |aws, override|
59
+ aws.access_key_id = "YOUR KEY"
60
+ aws.secret_access_key = "YOUR SECRET KEY"
61
+ aws.session_token = "SESSION TOKEN"
62
+ aws.keypair_name = "KEYPAIR NAME"
63
+
64
+ aws.ami = "ami-7747d01e"
65
+
66
+ override.ssh.username = "ubuntu"
67
+ override.ssh.private_key_path = "PATH TO YOUR PRIVATE KEY"
68
+ end
69
+ end
70
+ ```
71
+
72
+ And then run `vagrant up --provider=aws`.
73
+
74
+ This will start an Ubuntu 12.04 instance in the us-east-1 region within
75
+ your account. And assuming your SSH information was filled in properly
76
+ within your Vagrantfile, SSH and provisioning will work as well.
77
+
78
+ Note that normally a lot of this boilerplate is encoded within the box
79
+ file, but the box file used for the quick start, the "dummy" box, has
80
+ no preconfigured defaults.
81
+
82
+ If you have issues with SSH connecting, make sure that the instances
83
+ are being launched with a security group that allows SSH access.
84
+
85
+ Note: if you don't configure `aws.access_key_id` or `aws_secret_access_key`
86
+ it will attempt to read credentials from environment variables first and then
87
+ from `$HOME/.aws/`. You can choose your AWS profile and files location by using
88
+ `aws.aws_profile` and `aws.aws_dir`, however environment variables will always
89
+ have precedence as defined by the [AWS documentation](http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html).
90
+ To use profile `vagrantDev` from your AWS files:
91
+ ```ruby
92
+ # this first line can actually be omitted
93
+ aws.aws_dir = ENV['HOME'] + "/.aws/"
94
+ aws.aws_profile = "vagrantDev"
95
+ ```
96
+
97
+
98
+ ## Box Format
99
+
100
+ Every provider in Vagrant must introduce a custom box format. This
101
+ provider introduces `aws` boxes. You can view an example box in
102
+ the [example_box/ directory](https://github.com/mitchellh/vagrant-aws/tree/master/example_box).
103
+ That directory also contains instructions on how to build a box.
104
+
105
+ The box format is basically just the required `metadata.json` file
106
+ along with a `Vagrantfile` that does default settings for the
107
+ provider-specific configuration for this provider.
108
+
109
+ ## Configuration
110
+
111
+ This provider exposes quite a few provider-specific configuration options:
112
+
113
+ * `access_key_id` - The access key for accessing AWS
114
+ * `ami` - The AMI id to boot, such as "ami-12345678"
115
+ * `availability_zone` - The availability zone within the region to launch
116
+ the instance. If nil, it will use the default set by Amazon.
117
+ * `aws_profile` - AWS profile in your config files. Defaults to *default*.
118
+ * `aws_dir` - AWS config and credentials location. Defaults to *$HOME/.aws/*.
119
+ * `instance_ready_timeout` - The number of seconds to wait for the instance
120
+ to become "ready" in AWS. Defaults to 120 seconds.
121
+ * `instance_check_interval` - The number of seconds to wait to check the instance's
122
+ state
123
+ * `instance_package_timeout` - The number of seconds to wait for the instance
124
+ to be burnt into an AMI during packaging. Defaults to 600 seconds.
125
+ * `instance_type` - The type of instance, such as "m3.medium". The default
126
+ value of this if not specified is "m3.medium". "m1.small" has been
127
+ deprecated in "us-east-1" and "m3.medium" is the smallest instance
128
+ type to support both paravirtualization and hvm AMIs
129
+ * `keypair_name` - The name of the keypair to use to bootstrap AMIs
130
+ which support it.
131
+ * `monitoring` - Set to "true" to enable detailed monitoring.
132
+ * `session_token` - The session token provided by STS
133
+ * `private_ip_address` - The private IP address to assign to an instance
134
+ within a [VPC](http://aws.amazon.com/vpc/)
135
+ * `elastic_ip` - Can be set to 'true', or to an existing Elastic IP address.
136
+ If true, allocate a new Elastic IP address to the instance. If set
137
+ to an existing Elastic IP address, assign the address to the instance.
138
+ * `region` - The region to start the instance in, such as "us-east-1"
139
+ * `secret_access_key` - The secret access key for accessing AWS
140
+ * `security_groups` - An array of security groups for the instance. If this
141
+ instance will be launched in VPC, this must be a list of security group
142
+ Name. For a nondefault VPC, you must use security group IDs instead (http://docs.aws.amazon.com/cli/latest/reference/ec2/run-instances.html).
143
+ * `iam_instance_profile_arn` - The Amazon resource name (ARN) of the IAM Instance
144
+ Profile to associate with the instance
145
+ * `iam_instance_profile_name` - The name of the IAM Instance Profile to associate
146
+ with the instance
147
+ * `subnet_id` - The subnet to boot the instance into, for VPC.
148
+ * `associate_public_ip` - If true, will associate a public IP address to an instance in a VPC.
149
+ * `ssh_host_attribute` - If `:public_ip_address`, `:dns_name`, or
150
+ `:private_ip_address`, will use the public IP address, DNS name, or private
151
+ IP address, respectively, to SSH to the instance. By default Vagrant uses the
152
+ first of these (in this order) that is known. However, this can lead to
153
+ connection issues if, e.g., you are assigning a public IP address but your
154
+ security groups prevent public SSH access and require you to SSH in via the
155
+ private IP address; specify `:private_ip_address` in this case.
156
+ * `tenancy` - When running in a VPC configure the tenancy of the instance. Supports 'default' and 'dedicated'.
157
+ * `tags` - A hash of tags to set on the machine.
158
+ * `package_tags` - A hash of tags to set on the ami generated during the package operation.
159
+ * `use_iam_profile` - If true, will use [IAM profiles](http://docs.aws.amazon.com/IAM/latest/UserGuide/instance-profiles.html)
160
+ for credentials.
161
+ * `block_device_mapping` - Amazon EC2 Block Device Mapping Property
162
+ * `elb` - The ELB name to attach to the instance.
163
+ * `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.
164
+ * `terminate_on_shutdown` - Indicates whether an instance stops or terminates
165
+ when you initiate shutdown from the instance.
166
+ * `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).
167
+
168
+ * `spot_instance` - Boolean value; indicates whether the config is for a spot instance, or on-demand. For more information about spot instances, see the [AWS Documentation](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/how-spot-instances-work.html)
169
+ * `spot_max_price` - Decimal value; state the maximum bid for your spot instance. If nil, it will compute average price in `region` for selected `instance_type`.
170
+ * `spot_price_product_description` - The product description for the spot price history used to compute average price. Defaults to 'Linux/UNIX'.
171
+ * `spot_valid_until` - Timestamp; when this spot instance request should expire, destroying any related instances. Ignored if `spot_instance` is not true.
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
+ ```