idlc-sdk-deploy 1.0.27 → 1.0.28

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c0ef3d550ff2b2db32412de5bb99f4c86b570edf22405b718e64bf78aa6c1f55
4
- data.tar.gz: f2c6aeace2a6143358b2a412ced041c3786da1fffe7f04b24d818c5e990316d0
3
+ metadata.gz: e32fbb181f7a6f8c2eb7928b2891e6eb1cec9655adcc666f0cdb7d111bd0079a
4
+ data.tar.gz: ccaeae4f19cbdcbd59bfc755beef5623a4a1f23d1a6432b1cbb4b376991b7857
5
5
  SHA512:
6
- metadata.gz: b84f26d67f4ce296df120695efa00b615a953f52fca3d79a48231cdbc6874a8774c34fa37312749cfaadb58c2a553e304a3ac961be58d54f10cf526d4453f34d
7
- data.tar.gz: 4519243edfeeed69511fa2bc99669777f324bc02e3043fb78a12d4cb48ee2773b0e03c2b34f6e570bee1cdff7d49f8794d021770c02cd307bbc980130dc22a2a
6
+ metadata.gz: 31b1e60df40195f6fb5088617b94a1eda5a54543aaf261709168279849d490efb7b76a42cadf8263d5db468291c7f9c78a22c5165718da9d6df2f086f67ba38e
7
+ data.tar.gz: cd8859dde5433905066a5e220ca02b6d0e12978f5e398be5367978e6159158a9340c7da6612e1b2d916e9dc9eff6c33a95194b9711c3a689d2eda0a972453b15
@@ -26,7 +26,7 @@ module Idlc
26
26
  # This method is meant to be run on an instance inside of a chef run to
27
27
  # provision instance and environment metadata.
28
28
 
29
- ENV['AWS_REGION'] = 'us-east-1' if ENV['AWS_REGION'].nil?
29
+ ENV['AWS_REGION'] = get_region
30
30
 
31
31
  # Get the current instance id from the instance metadata.
32
32
  instance = get_instance
@@ -89,6 +89,15 @@ module Idlc
89
89
  metadata
90
90
  end
91
91
 
92
+ def get_region
93
+ # Get the current az from the instance metadata.
94
+ metadata_endpoint = 'http://169.254.169.254/latest/meta-data/'
95
+ az = Net::HTTP.get( URI.parse( metadata_endpoint + 'placement/availability-zone' ) )
96
+
97
+ # return
98
+ az[0..-2]
99
+ end
100
+
92
101
  def get_instance
93
102
  # Get the current instance id from the instance metadata.
94
103
  metadata_endpoint = 'http://169.254.169.254/latest/meta-data/'
@@ -1,5 +1,5 @@
1
1
  module Idlc
2
2
  module Deploy
3
- VERSION = '1.0.27'.freeze
3
+ VERSION = '1.0.28'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: idlc-sdk-deploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.27
4
+ version: 1.0.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Cazell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-23 00:00:00.000000000 Z
11
+ date: 2018-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler