tfoutputs 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +56 -2
- data/lib/tfoutputs/configurator/file_state_configuration.rb +0 -2
- data/lib/tfoutputs/configurator/state_configurator.rb +1 -0
- data/lib/tfoutputs/configurator/state_reader.rb +1 -1
- data/lib/tfoutputs/configurator/version.rb +1 -1
- metadata +2 -3
- data/.ruby-version +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d1f519f69a2617bb93343edad27b1ebbc412363
|
4
|
+
data.tar.gz: 3c17ea150793faa27f730a015c89ca8e14fd3512
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74e2f00ce1c15b3393ef111e8a1a5fbb179a28669c52cdc7294f5e3bf8c56dd0ca45765bdfc2ac1b8c9c2646cd300d8f381c81c85b8f6997b3ebd17bc08063dc
|
7
|
+
data.tar.gz: d025fe9843ee9013bbf253344cfcb58c9bce597081de440a3ff6e930f94102c1a77167917eba62dedc4121077326b0e8555cec5b1b685319fb325f02de99aa96
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
|
10
10
|
# Ruby TF Outputs
|
11
11
|
|
12
|
-
This gem
|
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
|
-
|
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
|
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.
|
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
|