sf-hiera-aws 0.0.1 → 0.0.2

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
  SHA1:
3
- metadata.gz: 443deac718f30bc09618c7d35f400447cee08790
4
- data.tar.gz: 8b68ef269097ba57cfb8cc8e2ba2aed0dfa45174
3
+ metadata.gz: 5158fadbf94eccfdfafaebf7b175d3c11f36a841
4
+ data.tar.gz: d69011bbc8cd91207d999bbcb1889b88171a29cf
5
5
  SHA512:
6
- metadata.gz: 3dc41f57aea0f60f7ad7f9c8f9e7c77efa993c4296df1660e8be1eff46633685ca68020f34ecedfb80874599a877af54d340ac07099c5abd9a03943a546fe678
7
- data.tar.gz: e6610c0c32a4e7dcb2c8421a38fb9b748d4a9651215c0d324f644460a174f83e8ed925c924cd8229cc08763c530a20264b3b39189a26dc12656a7ddc4081bbc4
6
+ metadata.gz: bca35ff02edb74348a7e3d5a85e3160f6841b553ae8a09fbf350b741344f052eb7f92c21621069bbf2e58f4d2d9b3d5365b75b99d2d925bc6fe8c47364bdf378
7
+ data.tar.gz: e6dd2449724903a05aa7b013868cd4237e02d6dc816ae126ce221a4a8d4af04a264f03fb6a2eaf24932685fa7c070a7c06574de1c873b6d100a37959294cba6a
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2015 Jon Topper
3
+ Copyright (c) 2015 The Scale Factory Ltd
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -7,8 +7,22 @@ class Hiera
7
7
  public
8
8
 
9
9
  def initialize
10
+
10
11
  require 'aws-sdk-resources'
12
+ require 'net/http'
13
+ require 'json'
14
+
15
+ begin
16
+ http = Net::HTTP.new('169.254.169.254', 80)
17
+ http.open_timeout = 1
18
+ http.read_timeout = 1
19
+ instance_identity = JSON.parse(http.request(Net::HTTP::Get.new("/latest/dynamic/instance-identity/document")).body)
20
+ Aws.config.update({ region: instance_identity['region'] })
21
+ rescue Exception
22
+ Hiera.warn('No link-local endpoint - can\'t calculate region')
23
+ end
11
24
  Hiera.debug('Hiera AWS SDK backend started')
25
+
12
26
  end
13
27
 
14
28
  def lookup (key, scope, order_override, resolution_type)
data/sf-hiera-aws.gemspec CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "sf-hiera-aws"
7
- spec.version = "0.0.1"
7
+ spec.version = "0.0.2"
8
8
  spec.authors = ["Jon Topper"]
9
9
  spec.email = ["jon@scalefactory.com"]
10
10
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sf-hiera-aws
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Topper
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-09-02 00:00:00.000000000 Z
11
+ date: 2015-09-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler