aws_metadata 0.2.2 → 0.2.3
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/aws_metadata/cfn_stack_output.rb +4 -2
- data/lib/aws_metadata/instance_metadata.rb +4 -1
- data/lib/aws_metadata/version.rb +1 -1
- data/test/fixtures/aws_identity_stubs.yml +9 -9
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7c957b357c731b61055f94f0b0a04007dc9c2604
|
|
4
|
+
data.tar.gz: 8cc7ec5df4c18c59e8e488f8e45283d3bd80599e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0eae4f8fd0f40365fce03a7be2107554e0746fb2fd52f24701144d1cdab02970d8645af14e2916f4f9ce8cf7e92e7e00b2cebf8aa4587bc57146f4d6ca019c20
|
|
7
|
+
data.tar.gz: d668184d6063c38688adf08a47a0c6e17741f0ec894c7b161e2820814faf558da39605b8342ccd7741ff4985b0dabd5c84a47cf83eb8fd835c8acf80aad2b550
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -38,7 +38,7 @@ You can alternatively pass the relative endpoint to `metadata` and `dynamic`
|
|
|
38
38
|
|
|
39
39
|
```ruby
|
|
40
40
|
puts AWS::Instance.metadata(path: 'instance-id')
|
|
41
|
-
puts AWS::Instance.dynamic(
|
|
41
|
+
puts AWS::Instance.dynamic(path: 'instance-identity/document').account_id
|
|
42
42
|
```
|
|
43
43
|
|
|
44
44
|
This has the added benefit of reducing the number of HTTP calls even further if needed/desired. For instance `AWS::Instance.metadata.instance_id`
|
|
@@ -16,22 +16,23 @@ module AWS
|
|
|
16
16
|
end
|
|
17
17
|
end
|
|
18
18
|
|
|
19
|
-
private_class_method
|
|
20
|
-
|
|
21
19
|
# @private
|
|
22
20
|
def self.client
|
|
23
21
|
@client ||= Aws::CloudFormation::Client.new(region: AWS::Instance.dynamic.instance_identity.document.region, stub_responses: AWS::Metadata.stub_responses)
|
|
24
22
|
end
|
|
23
|
+
private_class_method :client
|
|
25
24
|
|
|
26
25
|
# @private
|
|
27
26
|
def self.stack
|
|
28
27
|
@stack ||= client.describe_stacks(stack_name: AWS::Metadata.cfn_stack_name).first.stacks.first
|
|
29
28
|
end
|
|
29
|
+
private_class_method :stack
|
|
30
30
|
|
|
31
31
|
# @private
|
|
32
32
|
def self.stack_outputs
|
|
33
33
|
@outputs ||= AWS::Metadata.stub_responses ? dev_outputs : stack.outputs
|
|
34
34
|
end
|
|
35
|
+
private_class_method :stack_outputs
|
|
35
36
|
|
|
36
37
|
# @private
|
|
37
38
|
def self.dev_outputs
|
|
@@ -48,5 +49,6 @@ module AWS
|
|
|
48
49
|
puts "#{yaml} not found AWS::StackOutput will not be available."
|
|
49
50
|
[]
|
|
50
51
|
end
|
|
52
|
+
private_class_method :dev_outputs
|
|
51
53
|
end
|
|
52
54
|
end
|
|
@@ -82,12 +82,12 @@ module AWS
|
|
|
82
82
|
end
|
|
83
83
|
end
|
|
84
84
|
|
|
85
|
-
private_class_method
|
|
86
85
|
|
|
87
86
|
# @private
|
|
88
87
|
def self.http(host, port)
|
|
89
88
|
@http ||= Net::HTTP.new host, port
|
|
90
89
|
end
|
|
90
|
+
private_class_method :http
|
|
91
91
|
|
|
92
92
|
# @private
|
|
93
93
|
def self.query(http, path)
|
|
@@ -104,6 +104,7 @@ module AWS
|
|
|
104
104
|
tries += 1
|
|
105
105
|
retry
|
|
106
106
|
end
|
|
107
|
+
private_class_method :query
|
|
107
108
|
|
|
108
109
|
# Helper method to provide "stubs" for non aws environments, ie. development and test
|
|
109
110
|
# @private
|
|
@@ -115,6 +116,7 @@ module AWS
|
|
|
115
116
|
@user_data ||= @responses[:user_data]
|
|
116
117
|
@dynamic ||= Hashish.new @responses[:dynamic]
|
|
117
118
|
end
|
|
119
|
+
private_class_method :load_stubs
|
|
118
120
|
|
|
119
121
|
def self.value_by_path(path, obj)
|
|
120
122
|
if AWS::Metadata.stub_responses
|
|
@@ -125,5 +127,6 @@ module AWS
|
|
|
125
127
|
yield
|
|
126
128
|
end
|
|
127
129
|
end
|
|
130
|
+
private_class_method :value_by_path
|
|
128
131
|
end
|
|
129
132
|
end
|
data/lib/aws_metadata/version.rb
CHANGED
|
@@ -13,15 +13,15 @@
|
|
|
13
13
|
LastUpdated: 2016-08-26T13:06:48Z
|
|
14
14
|
InstanceProfileArn: arn:aws:iam::account:instance-profile/Role
|
|
15
15
|
InstanceProfileId: Profile ID
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
security-credentials:
|
|
17
|
+
Role:
|
|
18
|
+
Code: Success
|
|
19
|
+
LastUpdated: 2016-08-26T13:08:20Z
|
|
20
|
+
Type: AWS-HMAC
|
|
21
|
+
AccessKeyId: access id
|
|
22
|
+
SecretAccessKey: secret key
|
|
23
|
+
Token: token
|
|
24
|
+
Expiration: 2016-08-26T19:21:06Z
|
|
25
25
|
instance-action: none
|
|
26
26
|
instance-id: i-id
|
|
27
27
|
instance-type: c3.xlarge
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: aws_metadata
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Evident.io
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2017-02-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|