tflat 0.1.6 → 0.1.7

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
  SHA256:
3
- metadata.gz: 7eeff3124798111046d1d95a4c3ff5738205af0d27b85263125a669a3241ad90
4
- data.tar.gz: f66f32f0930e12211a15aada5a54cf040912cfd38b8735b62c229d1164a689b6
3
+ metadata.gz: 329791358e3d0b9aa452c4f36b81f1d885bff26a2da4a2e15c60df541bd36366
4
+ data.tar.gz: dde5a28faa85dd402d23aceca6b04940b08ba22a2b8ee8678b09883f6401f50f
5
5
  SHA512:
6
- metadata.gz: 94d3a0e2aba2a54f56e358737695c0361083e611686d9f69eaf1f214db78bc82f53f3b2d0f98c8438cff500bf9e9a9c90409d11700a857db6e2f8c1fbdffd8c2
7
- data.tar.gz: dbb516a07b5aa37c57874a6837a68dbdae879a392efcb6341ba02eaf6e4d92527064cd2490de82d3d22423a908d4a5a51eed521943ca395da4260762118c2479
6
+ metadata.gz: 3bf5ac8ca188c97e235e5cdcb0edf48c5fae3562d307b154d1548012a932da1ee4e9072e4e5d222742952b94c617fc58577947cf3a0f2e4c13ba73e300643237
7
+ data.tar.gz: 4584ab627c91b6c99748856d8c931655c8f1d8c15204ad61db333cf223312de9575b7daa2bfa14e5668b4f3ee4461b5443dd3169d96779cb70d3d6ea6891fc1c
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.7 - Nov 17 2018
4
+ - Environment variables `TF_VAR_*` are also loaded by Ruby and will overwrite a value set in the JSON file.
5
+
3
6
  ## 0.1.6 - Nov 17 2018
4
7
  - Folders or files with the character '#' on their names will be ignored. You can use that to comment several files at once by commenting their folder.
5
8
 
data/README.md CHANGED
@@ -146,6 +146,8 @@ services:
146
146
 
147
147
  That way you don't have to deal with Terraform templates!
148
148
 
149
+ **NOTE:** Environment variables like `TF_VAR_*` are also accessible in Ruby, and will take precedence if the same value is set in the JSON variables file.
150
+
149
151
  ## Ignoring certain folders
150
152
  If you want TFlat to ignore a file or folder, just add a '#' to its name. This is useful when you want to destroy a chunk of infrastructure really quick, or when you don't want to apply something that you have been working on yet.
151
153
 
@@ -41,6 +41,11 @@ module Tflat
41
41
  def read_variables
42
42
  return unless File.file?('terraform.tfvars.json')
43
43
  @variables = JSON.parse(File.read 'terraform.tfvars.json')
44
+ # Env vars TF_VAR_* will overwrite anything set on the JSON file.
45
+ ENV.select{|k,v| k =~ /^TF_VAR_.+$/}.each do |k,v|
46
+ name = k.sub('TF_VAR_', '')
47
+ @variables[name] = v
48
+ end
44
49
  end
45
50
 
46
51
  def flatten_directories
@@ -1,3 +1,3 @@
1
1
  module Tflat
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tflat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paulo Arruda
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-11-17 00:00:00.000000000 Z
11
+ date: 2018-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ptools