fog-aws 1.4.1 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +9 -8
  3. data/CHANGELOG.md +40 -2
  4. data/CONTRIBUTING.md +6 -6
  5. data/CONTRIBUTORS.md +104 -1
  6. data/LICENSE.md +1 -1
  7. data/fog-aws.gemspec +4 -2
  8. data/lib/fog/aws.rb +1 -0
  9. data/lib/fog/aws/compute.rb +86 -2
  10. data/lib/fog/aws/credential_fetcher.rb +4 -2
  11. data/lib/fog/aws/mock.rb +8 -0
  12. data/lib/fog/aws/models/compute/flavors.rb +40 -0
  13. data/lib/fog/aws/models/compute/subnet.rb +1 -0
  14. data/lib/fog/aws/models/compute/vpc.rb +11 -2
  15. data/lib/fog/aws/models/iam/access_keys.rb +0 -2
  16. data/lib/fog/aws/models/rds/instance_option.rb +6 -0
  17. data/lib/fog/aws/parsers/compute/create_subnet.rb +2 -0
  18. data/lib/fog/aws/parsers/compute/describe_subnets.rb +1 -1
  19. data/lib/fog/aws/parsers/compute/describe_vpcs.rb +71 -37
  20. data/lib/fog/aws/parsers/iam/list_access_keys.rb +1 -1
  21. data/lib/fog/aws/parsers/rds/describe_orderable_db_instance_options.rb +4 -3
  22. data/lib/fog/aws/requests/auto_scaling/detach_instances.rb +3 -4
  23. data/lib/fog/aws/requests/compute/authorize_security_group_egress.rb +8 -6
  24. data/lib/fog/aws/requests/compute/authorize_security_group_ingress.rb +25 -21
  25. data/lib/fog/aws/requests/compute/copy_snapshot.rb +22 -9
  26. data/lib/fog/aws/requests/compute/create_network_interface.rb +2 -2
  27. data/lib/fog/aws/requests/compute/create_route_table.rb +1 -1
  28. data/lib/fog/aws/requests/compute/create_security_group.rb +24 -19
  29. data/lib/fog/aws/requests/compute/create_subnet.rb +14 -10
  30. data/lib/fog/aws/requests/compute/create_vpc.rb +38 -10
  31. data/lib/fog/aws/requests/compute/delete_security_group.rb +9 -9
  32. data/lib/fog/aws/requests/compute/describe_network_interface_attribute.rb +16 -14
  33. data/lib/fog/aws/requests/compute/describe_security_groups.rb +30 -6
  34. data/lib/fog/aws/requests/compute/describe_subnets.rb +12 -11
  35. data/lib/fog/aws/requests/compute/modify_network_interface_attribute.rb +3 -3
  36. data/lib/fog/aws/requests/compute/revoke_security_group_egress.rb +19 -25
  37. data/lib/fog/aws/requests/compute/revoke_security_group_ingress.rb +18 -25
  38. data/lib/fog/aws/requests/compute/run_instances.rb +1 -1
  39. data/lib/fog/aws/requests/efs/create_mount_target.rb +8 -4
  40. data/lib/fog/aws/requests/elb/create_load_balancer.rb +6 -37
  41. data/lib/fog/aws/requests/kinesis/put_record.rb +1 -2
  42. data/lib/fog/aws/requests/kinesis/put_records.rb +1 -2
  43. data/lib/fog/aws/requests/lambda/invoke.rb +1 -1
  44. data/lib/fog/aws/requests/rds/describe_orderable_db_instance_options.rb +12 -6
  45. data/lib/fog/aws/requests/storage/put_object.rb +0 -1
  46. data/lib/fog/aws/service_mapper.rb +129 -0
  47. data/lib/fog/aws/version.rb +1 -1
  48. data/tests/helpers/collection_helper.rb +0 -6
  49. data/tests/models/efs/mount_target_tests.rb +3 -1
  50. data/tests/models/elasticache/subnet_groups_tests.rb +0 -1
  51. data/tests/models/storage/file_tests.rb +0 -4
  52. data/tests/models/storage/url_tests.rb +1 -20
  53. data/tests/models/storage/versions_tests.rb +0 -5
  54. data/tests/requests/compute/network_interface_tests.rb +2 -13
  55. data/tests/requests/compute/subnet_tests.rb +3 -1
  56. data/tests/requests/compute/vpc_tests.rb +8 -6
  57. data/tests/requests/dns/dns_tests.rb +0 -4
  58. data/tests/requests/efs/file_system_tests.rb +1 -1
  59. data/tests/requests/iam/managed_policy_tests.rb +0 -1
  60. data/tests/requests/iam/versioned_managed_policy_tests.rb +3 -12
  61. data/tests/requests/lambda/helper.rb +2 -2
  62. data/tests/requests/rds/helper.rb +7 -2
  63. data/tests/requests/rds/instance_option_tests.rb +7 -1
  64. data/tests/requests/storage/object_tests.rb +2 -11
  65. metadata +9 -10
  66. data/gemfiles/Gemfile-ruby-1.8.7 +0 -6
  67. data/gemfiles/Gemfile-ruby-1.9 +0 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3973a7b70a274c20de34e9d05a1a848c2d93fcef
4
- data.tar.gz: 73a49e9277d918bc99701d78c9482d5c7d6b302f
3
+ metadata.gz: 1333d97b46328c7d155dadd9e011bcd0ff22aa27
4
+ data.tar.gz: 175d6c62b9edd36d1283ed6b278f6fafdaf549cd
5
5
  SHA512:
6
- metadata.gz: 3701fda2e9477f984781026b92b19643c54be23780e9b404f7cd767a42013333c9924eb9d15a7c14e1c1015a90d50e675f384813da0a2c56fbb349bf865b300e
7
- data.tar.gz: 55536ba768289f268e29150fd78d0cc01cbd434f0b51c8080839d14c179130c9f37dc67bb12e5a5f291d5c100a6f77914a8423c01f229a8ed31e7db4b510e233
6
+ metadata.gz: adb1c6076ad3a0aadb5b57f1e89a4ec30f96207536364769e9a97cd5f71a25fae0f9e59b42075c2f3177be1473930ba8e660b16968d1e749d19150f23b8eadac
7
+ data.tar.gz: f9662b2eaefb2c14033db0a8c6657ae89039cb92c9a329b40a3d3a7c26c0053f1f3996e95f073b5b5e8dcc30abb23c35d66d9efec1c8f87b68238e8343a2fca8
@@ -7,10 +7,6 @@ branches:
7
7
  matrix:
8
8
  fast_finish: true
9
9
  include:
10
- - rvm: 1.8.7
11
- gemfile: gemfiles/Gemfile-ruby-1.8.7
12
- - rvm: 1.9.3
13
- gemfile: gemfiles/Gemfile-ruby-1.9
14
10
  - rvm: 2.0.0
15
11
  gemfile: gemfiles/Gemfile-ruby-2.0
16
12
  - rvm: 2.1.0
@@ -27,14 +23,17 @@ matrix:
27
23
  gemfile: gemfiles/Gemfile-edge
28
24
  - rvm: 2.3.0
29
25
  gemfile: Gemfile
30
- - rvm: jruby-18mode
31
- gemfile: gemfiles/Gemfile-ruby-1.8.7
32
- - rvm: jruby-19mode
33
- gemfile: gemfiles/Gemfile-ruby-1.9
34
26
  - rvm: jruby-head
35
27
  gemfile: Gemfile
36
28
  allow_failures:
37
29
  - rvm: jruby-head
30
+ gemfile: Gemfile
31
+ - rvm: 2.2.0
32
+ gemfile: gemfiles/Gemfile-edge
33
+ - rvm: 2.3.0
34
+ gemfile: gemfiles/Gemfile-edge
35
+ - rvm: 2.1.1
36
+ gemfile: gemfiles/Gemfile-edge
38
37
  notifications:
39
38
  email: false
40
39
  irc:
@@ -47,6 +46,8 @@ notifications:
47
46
  on_success: always
48
47
  on_failure: always
49
48
  use_notice: false
49
+ before_install:
50
+ - gem update bundler
50
51
  env:
51
52
  global:
52
53
  secure: LlDKdKSRo3sEjQ55XesbOXhKZ3RrOtqoD1ZL8Wx39K3iVzeEV3Kc8HjDfEvo7R4pOc3BMTNJcputklVEPN0FkWGN7Py+OEtbHj3IZl0MX+KEWNk0gU+4+sgPrL1eXUQyMUSkCrBsKg08rPel4KMYUOXbtnLyUU9PDbBwm4LJYOc=
@@ -2,7 +2,44 @@
2
2
 
3
3
  ## [Unreleased](https://github.com/fog/fog-aws/tree/HEAD)
4
4
 
5
- [Full Changelog](https://github.com/fog/fog-aws/compare/v1.4.0...HEAD)
5
+ [Full Changelog](https://github.com/fog/fog-aws/compare/v1.4.1...HEAD)
6
+
7
+ **Closed issues:**
8
+
9
+ - connect\_write timeout on AWS CodeBuild [\#413](https://github.com/fog/fog-aws/issues/413)
10
+ - cannot load such file -- fog \(LoadError\) [\#401](https://github.com/fog/fog-aws/issues/401)
11
+ - Missing file for extraction? [\#390](https://github.com/fog/fog-aws/issues/390)
12
+ - Regression: IO stream sent to AWS fails [\#388](https://github.com/fog/fog-aws/issues/388)
13
+ - Stack Level Too Deep on YAML Serialization [\#385](https://github.com/fog/fog-aws/issues/385)
14
+ - models/elb/model\_tests does not properly cleanup [\#347](https://github.com/fog/fog-aws/issues/347)
15
+ - Generates wrong url when region is not DEFAULT\_REGION [\#214](https://github.com/fog/fog-aws/issues/214)
16
+
17
+ **Merged pull requests:**
18
+
19
+ - upgrade rubyzip to \>= 1.2.1 [\#416](https://github.com/fog/fog-aws/pull/416) ([lanej](https://github.com/lanej))
20
+ - correction in iam/list\_access\_keys parser: Username should be UserName [\#415](https://github.com/fog/fog-aws/pull/415) ([patleb](https://github.com/patleb))
21
+ - Avoid creating connection if region is not nil [\#414](https://github.com/fog/fog-aws/pull/414) ([hideto0710](https://github.com/hideto0710))
22
+ - Resolving issue where `Fog::Json` was called instead of `Fog::JSON`. [\#412](https://github.com/fog/fog-aws/pull/412) ([mgarrick](https://github.com/mgarrick))
23
+ - Add t2.micro in flavors list [\#411](https://github.com/fog/fog-aws/pull/411) ([KevinLoiseau](https://github.com/KevinLoiseau))
24
+ - Adding AWS P3 Tesla GPU instance types [\#409](https://github.com/fog/fog-aws/pull/409) ([hamelsmu](https://github.com/hamelsmu))
25
+ - Add jitter to exponential backoff [\#408](https://github.com/fog/fog-aws/pull/408) ([masstamike](https://github.com/masstamike))
26
+ - Add emulation of default VPC to mocked mode. [\#407](https://github.com/fog/fog-aws/pull/407) ([rzaharenkov](https://github.com/rzaharenkov))
27
+ - Update rds instance options model [\#406](https://github.com/fog/fog-aws/pull/406) ([carloslima](https://github.com/carloslima))
28
+ - Drop Ruby\<2.0 support [\#405](https://github.com/fog/fog-aws/pull/405) ([tbrisker](https://github.com/tbrisker))
29
+ - allow Gemfile-edge travis builds to fail [\#403](https://github.com/fog/fog-aws/pull/403) ([lanej](https://github.com/lanej))
30
+ - Add `default\_for\_az` attribute to subnet [\#402](https://github.com/fog/fog-aws/pull/402) ([rzaharenkov](https://github.com/rzaharenkov))
31
+ - bundler ~\> 1.15 [\#399](https://github.com/fog/fog-aws/pull/399) ([lanej](https://github.com/lanej))
32
+ - Fix detaching instances from auto scaling group. [\#397](https://github.com/fog/fog-aws/pull/397) ([rzaharenkov](https://github.com/rzaharenkov))
33
+ - Issue \#387 Fog::Compute::AWS::Vpcs returns VPCs with nil ids [\#396](https://github.com/fog/fog-aws/pull/396) ([maguec](https://github.com/maguec))
34
+ - feat\(CONTRIBUTORS\): Update [\#394](https://github.com/fog/fog-aws/pull/394) ([plribeiro3000](https://github.com/plribeiro3000))
35
+ - fix\(Tests\):Remove debugging [\#393](https://github.com/fog/fog-aws/pull/393) ([plribeiro3000](https://github.com/plribeiro3000))
36
+ - Migrate Service mapper from Fog [\#392](https://github.com/fog/fog-aws/pull/392) ([plribeiro3000](https://github.com/plribeiro3000))
37
+ - Add ability to encrypt a copy of an unencrypted snapshot [\#391](https://github.com/fog/fog-aws/pull/391) ([nodecarter](https://github.com/nodecarter))
38
+ - Fix VPC parser [\#389](https://github.com/fog/fog-aws/pull/389) ([ddiachkov](https://github.com/ddiachkov))
39
+ - fix default\_security\_group detection [\#348](https://github.com/fog/fog-aws/pull/348) ([lanej](https://github.com/lanej))
40
+
41
+ ## [v1.4.1](https://github.com/fog/fog-aws/tree/v1.4.1) (2017-08-23)
42
+ [Full Changelog](https://github.com/fog/fog-aws/compare/v1.4.0...v1.4.1)
6
43
 
7
44
  **Closed issues:**
8
45
 
@@ -13,6 +50,7 @@
13
50
 
14
51
  **Merged pull requests:**
15
52
 
53
+ - Update changelog for 1.4.0 [\#383](https://github.com/fog/fog-aws/pull/383) ([greysteil](https://github.com/greysteil))
16
54
  - Allow specifying kms key id to use [\#382](https://github.com/fog/fog-aws/pull/382) ([fcheung](https://github.com/fcheung))
17
55
  - added support to retrieve and create vpc with ipv6 cidr block [\#381](https://github.com/fog/fog-aws/pull/381) ([chanakyacool](https://github.com/chanakyacool))
18
56
  - Add MaxResults filter to describe reserved instances offerings [\#376](https://github.com/fog/fog-aws/pull/376) ([KevinLoiseau](https://github.com/KevinLoiseau))
@@ -305,7 +343,7 @@
305
343
  - Allow region to be set for STS [\#189](https://github.com/fog/fog-aws/pull/189) ([fcheung](https://github.com/fcheung))
306
344
  - add cn support for s3 [\#187](https://github.com/fog/fog-aws/pull/187) ([ming-relax](https://github.com/ming-relax))
307
345
  - mock instance stop and start properly [\#184](https://github.com/fog/fog-aws/pull/184) ([ehowe](https://github.com/ehowe))
308
- - Disable idempotent option when block is passed to get\_object [\#183](https://github.com/fog/fog-aws/pull/183) ([wangteji](https://github.com/wangteji))
346
+ - Disable idempotent option when block is passed to get\_object [\#183](https://github.com/fog/fog-aws/pull/183) ([ghost](https://github.com/ghost))
309
347
  - Yield arguments to Mock\#get\_object block more similar to Excon [\#182](https://github.com/fog/fog-aws/pull/182) ([tdg5](https://github.com/tdg5))
310
348
  - add IAM role paging [\#178](https://github.com/fog/fog-aws/pull/178) ([lanej](https://github.com/lanej))
311
349
  - properly mock rds name update [\#170](https://github.com/fog/fog-aws/pull/170) ([ehowe](https://github.com/ehowe))
@@ -5,14 +5,14 @@ New contributors are always welcome, when it doubt please ask questions. We stri
5
5
  ### Coding
6
6
 
7
7
  * Pick a task:
8
- * Offer feedback on open [pull requests](https://github.com/fog/fog/pulls).
9
- * Review open [issues](https://github.com/fog/fog/issues) for things to help on.
10
- * [Create an issue](https://github.com/fog/fog/issues/new) to start a discussion on additions or features.
8
+ * Offer feedback on open [pull requests](https://github.com/fog/fog-aws/pulls).
9
+ * Review open [issues](https://github.com/fog/fog-aws/issues) for things to help on.
10
+ * [Create an issue](https://github.com/fog/fog-aws/issues/new) to start a discussion on additions or features.
11
11
  * Fork the project, add your changes and tests to cover them in a topic branch.
12
- * Commit your changes and rebase against `fog/fog` to ensure everything is up to date.
13
- * [Submit a pull request](https://github.com/fog/fog/compare/).
12
+ * Commit your changes and rebase against `fog/fog-aws` to ensure everything is up to date.
13
+ * [Submit a pull request](https://github.com/fog/fog-aws/compare/).
14
14
 
15
15
  ### Non-Coding
16
16
 
17
- * Offer feedback on open [issues](https://github.com/fog/fog/issues).
17
+ * Offer feedback on open [issues](https://github.com/fog/fog-aws/issues).
18
18
  * Organize or volunteer at events.
@@ -1,5 +1,108 @@
1
+ * Aakash Shah <ashah@pivotal.io>
2
+ * Aaron Stone <aaron@serendipity.cx>
3
+ * Akira Matsuda <ronnie@dio.jp>
4
+ * Alessandro Lepore <lepore.ale@gmail.com>
5
+ * Alex Coomans <alex@alexcoomans.com>
6
+ * Alexander Stuart-Kregor <easkay@me.com>
7
+ * Andrew Kane <acekane1@gmail.com>
8
+ * Anthony Mangano <anthony@backupify.com>
9
+ * Ayumi Yu <ayumi@ayumiyu.com>
10
+ * Ben Balter <ben.balter@github.com>
11
+ * Benjamin Pillet <ben_pillet@yahoo.com>
12
+ * Brett Cave <brett@cave.za.net>
13
+ * Brian Nelson <mrpoundsign@gmail.com>
14
+ * Caged <justin@labratrevenge.com>
15
+ * Carlos Lima <carlos@cpan.org>
16
+ * Chanakya Devraj <chanakya.devraj@cuelogic.co.in>
17
+ * Corey Donohoe <atmos@atmos.org>
18
+ * Craig Genner <craig.genner@piksel.com>
19
+ * Damien Mathieu <damien@heroku.com>
20
+ * Dan Brooking <dbrooking@datapipe.com>
21
+ * Dan Rogers <drogers@popsugar.com>
22
+ * Daniel Farina <daniel@heroku.com>
23
+ * Danny Guinther <danny@backupify.com>
24
+ * David Judd <david@academia.edu>
25
+ * David Vaz <david.ferd.vaz@gmail.com>
26
+ * Decklin Foster <decklin@red-bean.com>
27
+ * Duarte Henriques <duarte.henriques@seedrs.com>
28
+ * Ed Healy <ehealy@gmail.com>
29
+ * Eddie Johnston <eddie@beanstalk.ie>
30
+ * Eric Herot <eric.github@herot.com>
31
+ * Esther Villars <esthervillars@gmail.com>
32
+ * Eugene Howe <eugene@xtreme-computers.net>
33
+ * Freddy Chu <freddy@expressvpn.com>
1
34
  * Frederick Cheung <frederick.cheung@gmail.com>
35
+ * GitHub <noreply@github.com>
36
+ * Greg Burek <greg.burek@gmail.com>
37
+ * Grey Baker <greysteil@gmail.com>
38
+ * Huang Yaming <yumminhuang@gmail.com>
39
+ * ICHII Takashi <ichii386@schweetheart.jp>
40
+ * Jack Thomas <jack@scalefactory.com>
41
+ * Jacob Burkhart <jburkhart@engineyard.com>
42
+ * James Muscat <james.muscat@alces-software.com>
43
+ * James Myers <jfmyers9@gmail.com>
44
+ * James Rucker <james.rucker@legitscript.com>
45
+ * Jon-Erik Schneiderhan <jon-erik.schneiderhan@meyouhealth.com>
46
+ * Jonathan Hanson <jonathan@jonathan-hanson.org>
47
+ * Jose Luis Salas <josacar@gmail.com>
48
+ * Josh Lane & Michelle Noorali <jlane@engineyard.com>
49
+ * Josh Lane & Michelle Noorali <michellemolu@gmail.com>
50
+ * Josh Lane <jlane@engineyard.com>
2
51
  * Josh Lane <lanej@users.noreply.github.com>
3
52
  * Josh Lane <me@joshualane.com>
53
+ * Joshua Lane <me@joshualane.com>
54
+ * Kevin Loiseau <k.loiseauand@gmail.com>
55
+ * KevinLoiseau <k.loiseauand@gmail.com>
56
+ * Khoa Nguyen <khoan@Khoas-MacBook-Pro.local>
57
+ * Kirk Haines <khaines@engineyard.com>
58
+ * Kristoffer Roupé <kitofr@gmail.com>
59
+ * Liu zhitong <z.liu@linkbynet.com>
60
+ * Luciano Sousa <ls@lucianosousa.net>
61
+ * Martin Forssen <maf@recordedfuture.com>
62
+ * Mathew Kamkar <matkam@gmail.com>
63
+ * Matthew O'Riordan <matthew.oriordan@gmail.com>
64
+ * Michael Hale <mike@hales.ws>
65
+ * Michael Sawyer <michael.sawyer@veeva.com>
66
+ * Michal Tekel <mtekel@gmail.com>
67
+ * Michelle Noorali & Josh Lane <mnoorali@engineyard.com>
68
+ * Michelle Noorali <michellemolu@gmail.com>
69
+ * Miguel Landaeta <miguel@miguel.cc>
70
+ * Miguel Landaeta <miguel@restorando.com>
71
+ * Miguel Landaeta <nomadium@gmail.com>
72
+ * Milad Rastian <milad@sam-media.com>
73
+ * Moritz Siuts <m.siuts@emetriq.com>
74
+ * Nawaid Shamim <me@nawaidshamim.com>
75
+ * Neill Turner <neill.turner@immediate.co.uk>
76
+ * Nicholas Fowler <nbfowler@gmail.com>
77
+ * Nicholas Klick <nicholas.klick@gmail.com>
78
+ * Nilanjan Roy <nilanjan.roy@nosto.com>
79
+ * Paulo Henrique Lopes Ribeiro <plribeiro3000@gmail.com>
80
+ * Paulo Ribeiro <plribeiro3000@gmail.com>
81
+ * Pedro Matos Monteiro <pedro.matos.monteiro@gmail.com>
82
+ * Puneet Loya <ploya@Asperas-Master-MacBook-Pro.local>
83
+ * Robert von Massow <r.vonmassow@emetriq.com>
84
+ * Rocco Galluzzo <rocco@galluzzo.me>
85
+ * Rodrigo de Almeida Pereira <contato@rodrigo-pereira.net>
86
+ * Ryan Schlesinger <ryan@ryanschlesinger.com>
87
+ * Ryunosuke SATO <tricknotes.rs@gmail.com>
88
+ * Sergey Bahchissaraitsev <sergey@bahchis.com>
89
+ * Shai Rosenfeld <shai.rosenfeld@autodesk.com>
90
+ * Shuhei Kagawa <shuhei.kagawa@gmail.com>
91
+ * Suraj Shirvankar <surajshirvankar@gmail.com>
92
+ * Todd Willey <xtoddx@gmail.com>
93
+ * Ville Lautanala <lautis@gmail.com>
94
+ * Vlad Yarotsky <vlad@remind101.com>
95
+ * Vít Ondruch <vondruch@redhat.com>
4
96
  * Wesley Beary <geemus@gmail.com>
5
- * geemus <geemus@gmail.com>
97
+ * Yaming Huang <yumminhuang@gmail.com>
98
+ * Yusuke Ebihara <biibiebi1234@gmail.com>
99
+ * chanakya devraj <chanakya.devraj@cuelogic.co.in>
100
+ * chanakyad-cuelogic <chanakya.devraj@cuelogic.co.in>
101
+ * ddoc <bgalura@gmail.com>
102
+ * geemus <geemus@gmail.com>
103
+ * huming <humings@gmail.com>
104
+ * miliao <mliao@adobe.com>
105
+ * mrloop <ewan@mrloop.com>
106
+ * nob.murakita <nobmurakita@users.noreply.github.com>
107
+ * solud <jon@joncole.com>
108
+ * starbelly <starbelly@pobox.com>
data/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2014-2015 [CONTRIBUTORS.md](https://github.com/fog/fog/blob/master/CONTRIBUTORS.md)
3
+ Copyright (c) 2014-2017 [CONTRIBUTORS.md](https://github.com/fog/fog-aws/blob/master/CONTRIBUTORS.md)
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy of
6
6
  this software and associated documentation files (the "Software"), to deal in
@@ -19,10 +19,12 @@ Gem::Specification.new do |spec|
19
19
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
20
  spec.require_paths = ["lib"]
21
21
 
22
- spec.add_development_dependency 'bundler', '~> 1.6'
22
+ spec.required_ruby_version = '>= 2.0.0'
23
+
24
+ spec.add_development_dependency 'bundler', '~> 1.15'
23
25
  spec.add_development_dependency 'rake', '~> 10.0'
24
26
  spec.add_development_dependency 'shindo', '~> 0.3'
25
- spec.add_development_dependency 'rubyzip', '~> 0.9.9'
27
+ spec.add_development_dependency 'rubyzip', '~> 1.2.1'
26
28
 
27
29
  spec.add_dependency 'fog-core', '~> 1.38'
28
30
  spec.add_dependency 'fog-json', '~> 1.0'
@@ -27,6 +27,7 @@ module Fog
27
27
  autoload :CredentialFetcher, File.expand_path('../aws/credential_fetcher', __FILE__)
28
28
  autoload :Errors, File.expand_path('../aws/errors', __FILE__)
29
29
  autoload :Mock, File.expand_path('../aws/mock', __FILE__)
30
+ autoload :ServiceMapper, File.expand_path('../aws/service_mapper', __FILE__)
30
31
  autoload :SignatureV4, File.expand_path('../aws/signaturev4', __FILE__)
31
32
 
32
33
  # Services
@@ -196,6 +196,8 @@ module Fog
196
196
  'vpc' => 'vpc'
197
197
  }
198
198
 
199
+ VPC_BLANK_VALUE = 'none'
200
+
199
201
  include Fog::AWS::CredentialFetcher::ConnectionMethods
200
202
 
201
203
  def self.data
@@ -284,7 +286,7 @@ module Fog
284
286
  "attributeName" => "supported-platforms"
285
287
  },
286
288
  {
287
- "values" => ["none"],
289
+ "values" => [VPC_BLANK_VALUE],
288
290
  "attributeName" => "default-vpc"
289
291
  },
290
292
  {
@@ -375,6 +377,79 @@ module Fog
375
377
  self.data[:account_attributes].find { |h| h["attributeName"] == "supported-platforms" }["values"] = values
376
378
  end
377
379
 
380
+ def default_vpc
381
+ vpc_id = describe_account_attributes.body["accountAttributeSet"].find{ |h| h["attributeName"] == "default-vpc" }["values"].first
382
+ vpc_id == VPC_BLANK_VALUE ? nil : vpc_id
383
+ end
384
+
385
+ def default_vpc=(value)
386
+ self.data[:account_attributes].find { |h| h["attributeName"] == "default-vpc" }["values"] = [value]
387
+ end
388
+
389
+ def setup_default_vpc!
390
+ return if default_vpc.present?
391
+
392
+ disable_ec2_classic
393
+
394
+ vpc_id = Fog::AWS::Mock.default_vpc_for(region)
395
+ self.default_vpc = vpc_id
396
+
397
+ data[:vpcs] << {
398
+ 'vpcId' => vpc_id,
399
+ 'state' => 'available',
400
+ 'cidrBlock' => '172.31.0.0/16',
401
+ 'dhcpOptionsId' => Fog::AWS::Mock.dhcp_options_id,
402
+ 'tagSet' => {},
403
+ 'instanceTenancy' => 'default',
404
+ 'enableDnsSupport' => true,
405
+ 'enableDnsHostnames' => true,
406
+ 'isDefault' => true
407
+ }
408
+
409
+ internet_gateway_id = Fog::AWS::Mock.internet_gateway_id
410
+ data[:internet_gateways][internet_gateway_id] = {
411
+ 'internetGatewayId' => internet_gateway_id,
412
+ 'attachmentSet' => {
413
+ 'vpcId' => vpc_id,
414
+ 'state' => 'available'
415
+ },
416
+ 'tagSet' => {}
417
+ }
418
+
419
+ data[:route_tables] << {
420
+ 'routeTableId' => Fog::AWS::Mock.route_table_id,
421
+ 'vpcId' => vpc_id,
422
+ 'routes' => [
423
+ {
424
+ 'destinationCidrBlock' => '172.31.0.0/16',
425
+ 'gatewayId' => 'local',
426
+ 'state' => 'active',
427
+ 'origin' => 'CreateRouteTable'
428
+ },
429
+ {
430
+ 'destinationCidrBlock' => '0.0.0.0/0',
431
+ 'gatewayId' => internet_gateway_id,
432
+ 'state' => 'active',
433
+ 'origin' => 'CreateRoute'
434
+ }
435
+ ]
436
+ }
437
+
438
+ describe_availability_zones.body['availabilityZoneInfo'].map { |z| z['zoneName'] }.each_with_index do |zone, i|
439
+ data[:subnets] << {
440
+ 'subnetId' => Fog::AWS::Mock.subnet_id,
441
+ 'state' => 'available',
442
+ 'vpcId' => vpc_id,
443
+ 'cidrBlock' => "172.31.#{i}.0/16",
444
+ 'availableIpAddressCount' => '251',
445
+ 'availabilityZone' => zone,
446
+ 'tagSet' => {},
447
+ 'mapPublicIpOnLaunch' => true,
448
+ 'defaultForAz' => true
449
+ }
450
+ end
451
+ end
452
+
378
453
  def tagged_resources(resources)
379
454
  Array(resources).map do |resource_id|
380
455
  if match = resource_id.match(/^(\w+)-[a-z0-9]{8}/i)
@@ -560,7 +635,16 @@ module Fog
560
635
  Fog::Compute::AWS::NotFound.slurp(error, match[:message])
561
636
  when 'RequestLimitExceeded'
562
637
  if retries < max_retries
563
- sleep (2.0 ** (1.0 + retries) * 100) / 1000.0
638
+ jitter = rand(100)
639
+ waiting = true
640
+ start_time = Time.now
641
+ wait_time = ((2.0 ** (1.0 + retries) * 100) + jitter) / 1000.0
642
+ Fog::Logger.warning "Waiting #{wait_time} seconds to retry."
643
+ while waiting
644
+ if Time.now - start_time >= wait_time
645
+ waiting = false
646
+ end
647
+ end
564
648
  retries += 1
565
649
  retry
566
650
  else
@@ -23,8 +23,10 @@ module Fog
23
23
  credential_path = options[:credential_path] || ENV["AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"]
24
24
  role_data = connection.get(:path => credential_path, :idempotent => true, :expects => 200).body
25
25
 
26
- connection = options[:metadata_connection] || Excon.new(INSTANCE_METADATA_HOST)
27
- region ||= connection.get(:path => INSTANCE_METADATA_AZ, :idempotent => true, :expects => 200).body[0..-2]
26
+ if region.nil?
27
+ connection = options[:metadata_connection] || Excon.new(INSTANCE_METADATA_HOST)
28
+ region = connection.get(:path => INSTANCE_METADATA_AZ, :idempotent => true, :expects => 200).body[0..-2]
29
+ end
28
30
  else
29
31
  connection = options[:connection] || Excon.new(INSTANCE_METADATA_HOST)
30
32
  role_name = connection.get(:path => INSTANCE_METADATA_PATH, :idempotent => true, :expects => 200).body
@@ -145,6 +145,9 @@ module Fog
145
145
  def self.zone_id
146
146
  "zone-#{Fog::Mock.random_hex(8)}"
147
147
  end
148
+ def self.route_table_id
149
+ "rtb-#{Fog::Mock.random_hex(8)}"
150
+ end
148
151
  def self.change_id
149
152
  Fog::Mock.random_letters_and_numbers(14)
150
153
  end
@@ -181,6 +184,11 @@ module Fog
181
184
  'SUSE Linux'
182
185
  ]
183
186
  end
187
+
188
+ def self.default_vpc_for(region)
189
+ @default_vpcs ||= {}
190
+ @default_vpcs[region] ||= vpc_id
191
+ end
184
192
  end
185
193
  end
186
194
  end
@@ -14,6 +14,16 @@ module Fog
14
14
  :ebs_optimized_available => false,
15
15
  :instance_store_volumes => 0
16
16
  },
17
+ {
18
+ :id => 't2.nano',
19
+ :name => 'Nano Instance',
20
+ :bits => 64,
21
+ :cores => 1,
22
+ :disk => 0,
23
+ :ram => 512,
24
+ :ebs_optimized_available => false,
25
+ :instance_store_volumes => 0
26
+ },
17
27
  {
18
28
  :id => 't2.micro',
19
29
  :name => 'Micro Instance',
@@ -713,6 +723,36 @@ module Fog
713
723
  :disk => 0,
714
724
  :ebs_optimized_available => true,
715
725
  :instance_store_volumes => 0
726
+ },
727
+ {
728
+ :id => "p3.2xlarge",
729
+ :name => "Tesla GPU Two Extra Large",
730
+ :bits => 64,
731
+ :cores => 5120,
732
+ :ram => 6100,
733
+ :disk => 0,
734
+ :ebs_optimized_available => true,
735
+ :instance_store_volumes => 0
736
+ },
737
+ {
738
+ :id => "p3.8xlarge",
739
+ :name => "Tesla GPU Eight Extra Large",
740
+ :bits => 64,
741
+ :cores => 204080,
742
+ :ram => 244000,
743
+ :disk => 0,
744
+ :ebs_optimized_available => true,
745
+ :instance_store_volumes => 0
746
+ },
747
+ {
748
+ :id => "p3.16xlarge",
749
+ :name => "Tesla GPU Sixteen Extra Large",
750
+ :bits => 64,
751
+ :cores => 408160,
752
+ :ram => 488000,
753
+ :disk => 0,
754
+ :ebs_optimized_available => true,
755
+ :instance_store_volumes => 0
716
756
  }
717
757
  ]
718
758