tfoutputs 0.1.0 → 0.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ce846ca6bd7bd7b6f76e17ac3c1c7971cc92cda7
4
- data.tar.gz: 73e3495d3826861b05de0c388504b3c4d7533f52
3
+ metadata.gz: 0d1f519f69a2617bb93343edad27b1ebbc412363
4
+ data.tar.gz: 3c17ea150793faa27f730a015c89ca8e14fd3512
5
5
  SHA512:
6
- metadata.gz: fa5391c6e6c00f81d70d78be77dadf2d1731154d3a90617c2e88fc2fb611694bc54672f61dae86f8993144c2c3016fbfe9174e48e14b8dc9c41a2dcae225c0ca
7
- data.tar.gz: d5a317d6a4ecd5a094d49ccd3fae4bbf0a4ffb1d72ec0de25034da59996f3a4aed3ac4c7c7c6c9b7c171dd00f4af85038734b308b1824e1caec687f6faa2d797
6
+ metadata.gz: 74e2f00ce1c15b3393ef111e8a1a5fbb179a28669c52cdc7294f5e3bf8c56dd0ca45765bdfc2ac1b8c9c2646cd300d8f381c81c85b8f6997b3ebd17bc08063dc
7
+ data.tar.gz: d025fe9843ee9013bbf253344cfcb58c9bce597081de440a3ff6e930f94102c1a77167917eba62dedc4121077326b0e8555cec5b1b685319fb325f02de99aa96
data/.gitignore CHANGED
@@ -12,3 +12,4 @@
12
12
  bin/
13
13
  binaries/
14
14
  vendor/
15
+ .ruby_version
data/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
 
10
10
  # Ruby TF Outputs
11
11
 
12
- This gem takes your terraform outputs and imports them into ruby.
12
+ This gem is a ruby interface to access your terraform outputs.
13
13
 
14
14
  ## Installation
15
15
 
@@ -27,9 +27,63 @@ Or install it yourself as:
27
27
 
28
28
  $ gem install tfoutputs
29
29
 
30
+
31
+
32
+
33
+ ## Pre-requistes
34
+
35
+ Ruby >= 2.2.2
36
+ Your terraform state file also needs to be generated by terraform > 0.7.0 there are currently no plans to support terraform < 0.7.0
37
+
38
+
39
+
30
40
  ## Usage
31
41
 
32
- TODO: Write usage instructions here
42
+ Require the gem:
43
+
44
+ ```ruby
45
+ require 'tfoutputs'
46
+ ```
47
+
48
+ tfoutputs uses 'backends' as a means of retrieving the state files. A backend is a place where the terraform state file lives. Currently only two are supported: s3 and file.
49
+
50
+ Setting up an s3 backend:
51
+
52
+ ```ruby
53
+ config = {:backend => 's3',:options => {:bucket_name => 'my-bucket-name-goes-here',
54
+ :bucket_region => 'eu-west-1', :bucket_key => 'terraform.tfstate' }
55
+ }
56
+ state_reader = TfOutputs.configure(config)
57
+ puts(state_reader.my_output_name)
58
+
59
+ ```
60
+ Gives us:
61
+
62
+ ```
63
+ it works
64
+
65
+ ```
66
+
67
+ Setting up a file backend:
68
+ ```ruby
69
+ config = {:backend => 'file', :options => { :file_path => '/path/to/state/file/terraform.tfstate' } }
70
+ state_reader = TfOutputs.configure(config)
71
+ puts(state_reader.my_output_name)
72
+
73
+ ```
74
+
75
+
76
+ Using multiple states with multiple backends:
77
+
78
+ ```ruby
79
+ config = [{:backend => 's3',:options => {:bucket_name => 'my-bucket-name-goes-here',
80
+ :bucket_region => 'eu-west-1', :bucket_key => 'terraform.tfstate' }
81
+ },
82
+ {:backend => 'file', :options => { :file_path => '/path/to/state/file/terraform.tfstate' } }
83
+ ]
84
+ state_reader = TfOutputs.configure(config)
85
+ puts(state_reader.my_output_name)
86
+ ```
33
87
 
34
88
 
35
89
  ## Contributing
@@ -1,8 +1,6 @@
1
1
  module TfOutputs
2
2
  module Configurator
3
3
  class FileStateConfiguration
4
- attr_accessor :file_paths
5
-
6
4
  def initialize(options)
7
5
  @options = options
8
6
  end
@@ -13,6 +13,7 @@ module TfOutputs
13
13
  def initialize(states_array)
14
14
  @states_array = states_array
15
15
  end
16
+
16
17
  def file_list
17
18
  file_list = []
18
19
  @states_array.each do |state_hash|
@@ -41,7 +41,7 @@ module TfOutputs
41
41
  return output[name.to_s]['value']
42
42
  end
43
43
  super(name, *args, &block)
44
+ end
44
45
  end
45
46
  end
46
- end
47
47
  end
@@ -1,5 +1,5 @@
1
1
  module TfOutputs
2
2
  module Configurator
3
- VERSION = '0.1.0'.freeze
3
+ VERSION = '0.1.1'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tfoutputs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Edwards
@@ -131,7 +131,6 @@ extensions: []
131
131
  extra_rdoc_files: []
132
132
  files:
133
133
  - ".gitignore"
134
- - ".ruby-version"
135
134
  - CODE_OF_CONDUCT.md
136
135
  - Gemfile
137
136
  - LICENSE.txt
@@ -165,7 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
165
164
  version: '0'
166
165
  requirements: []
167
166
  rubyforge_project:
168
- rubygems_version: 2.5.1
167
+ rubygems_version: 2.4.5.1
169
168
  signing_key:
170
169
  specification_version: 4
171
170
  summary: Gem for grabbing variables from terraform
data/.ruby-version DELETED
@@ -1 +0,0 @@
1
- 2.3.0