terraform-wrapper 0.2.2 → 1.1.0

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
  SHA256:
3
- metadata.gz: 66bb2630f4f5580fdf738902d4807b9584572ef131a01d685eecbe2a067f023c
4
- data.tar.gz: efcd70b4c39b0870f2cce7461c03861425262347d565c80d3da90841f4eb6bf2
3
+ metadata.gz: 757e953e25e4899b35a17e556123581ab077a84769a144f51db286a6b56f8608
4
+ data.tar.gz: 25d70f9f0132157ccc738bf0c459f35d1e777f5760bae6177bc202e92bc1c95c
5
5
  SHA512:
6
- metadata.gz: fede831e98a731bf9145c90bd54d51cbabd51a76337d7360cec08fe59c3bc464d526584b0ea1dbaa34a1daab63137b8c7389c8c2d043ebb297a9bc47dadb4433
7
- data.tar.gz: c6852721632b1fe7384127baecabd11d32cab7966f7ab40b804761211f18902118a7f966bdbdf78d0dc24c53374fa504d0f3bd77f8a63b105242dac51f14b878
6
+ metadata.gz: a0399939f5522c2ffb3fcee4e0dded13c09b7731e0025de5d92bdab8afe63e9b3506eba6bf99d345323ea4f77f7a9096e18203f975127eb29729b60379036144
7
+ data.tar.gz: 9a8ef1ea51a121cd85a5a4334cda520f8a4246c2125510054c047f7d29e004cae8bf30a4eb200aae71321d0ccf1748b385449735d5e1bc00b65cf67b3f624c15
@@ -22,7 +22,7 @@ module TerraformWrapper
22
22
 
23
23
  ###############################################################################
24
24
 
25
- def self.define_tasks(component:, options: Hash.new, service:)
25
+ def self.deployment_tasks(component:, options: Hash.new, service:)
26
26
  @logger.info("Building tasks for service: #{service}, component: #{component}...")
27
27
 
28
28
  @logger.fatal("Options must be specified as a hash!") unless options.kind_of?(Hash)
@@ -4,7 +4,7 @@ module TerraformWrapper
4
4
 
5
5
  ###############################################################################
6
6
 
7
- def self.create_directory(directory:, purpose: nil, exists: true)
7
+ def self.create_directory(directory:, exists: true, purpose: nil)
8
8
  return exists if File.directory?(directory)
9
9
 
10
10
  result = false
@@ -20,6 +20,17 @@ module TerraformWrapper
20
20
  result = File.directory?(directory)
21
21
  end
22
22
 
23
+ ###############################################################################
24
+
25
+ def self.find(base:, name:, exts:, description: "File")
26
+ exts.each do |ext|
27
+ path = File.join(base, name + ext)
28
+ return path if File.file?(path)
29
+ end
30
+
31
+ @logger.fatal("#{description} name: #{name} not found in location: #{base}!")
32
+ end
33
+
23
34
  ###############################################################################
24
35
 
25
36
  end
@@ -25,27 +25,34 @@ module TerraformWrapper
25
25
 
26
26
  ###############################################################################
27
27
 
28
- @password = nil
28
+ @keyvault = nil
29
+ @secret_username = nil
30
+ @secret_password = nil
29
31
 
30
32
  ###############################################################################
31
33
 
32
- attr_reader :subscription
33
- attr_reader :tenant
34
- attr_reader :username
34
+ @subscription
35
35
 
36
36
  ###############################################################################
37
37
 
38
- def initialize(code:, config:, options:, service:, variables:)
39
- construct(code: code, config: config, options: options, service: service, variables: variables)
38
+ def initialize(options:, variables:)
39
+ construct(options: options, variables: variables)
40
40
  end
41
41
 
42
42
  ###############################################################################
43
43
 
44
44
  def auth()
45
- ENV["ARM_SUBSCRIPTION_ID"] = @subscription
46
- ENV["ARM_TENANT_ID"] = @tenant
47
- ENV["ARM_CLIENT_ID"] = @username unless @username.nil?
48
- ENV["ARM_CLIENT_SECRET"] = @password unless @password.nil?
45
+ details = subscription_details(subscription: @subscription)
46
+
47
+ subscription = details["id"]
48
+ tenant = details["tenant"]
49
+ username = @keyvault.nil? ? nil : secret(vault: @keyvault, name: @secret_username)
50
+ password = @keyvault.nil? ? nil : secret(vault: @keyvault, name: @secret_password)
51
+
52
+ ENV["ARM_SUBSCRIPTION_ID"] = subscription
53
+ ENV["ARM_TENANT_ID"] = tenant
54
+ ENV["ARM_CLIENT_ID"] = username unless username.nil?
55
+ ENV["ARM_CLIENT_SECRET"] = password unless password.nil?
49
56
  logger.success("Azure authenticator environment variables set!")
50
57
  end
51
58
 
@@ -151,20 +158,13 @@ module TerraformWrapper
151
158
  end
152
159
 
153
160
  begin
154
- subscription = subscription % @variables
155
- keyvault = keyvault % @variables unless keyvault.nil?
156
- username = username % @variables unless keyvault.nil?
157
- password = password % @variables unless keyvault.nil?
161
+ @subscription = subscription % @variables.identifiers
162
+ @keyvault = keyvault % @variables.identifiers unless keyvault.nil?
163
+ @secret_username = username % @variables.identifiers unless keyvault.nil?
164
+ @secret_password = password % @variables.identifiers unless keyvault.nil?
158
165
  rescue
159
- logger.fatal("Azure authenticator options contain variables that are not included in the configuration file!")
166
+ logger.fatal("Azure authenticator options contain identifiers that are not included in the configuration file!")
160
167
  end
161
-
162
- details = subscription_details(subscription: subscription)
163
-
164
- @subscription = details["id"]
165
- @tenant = details["tenant"]
166
- @username = keyvault.nil? ? nil : secret(vault: keyvault, name: username)
167
- @password = keyvault.nil? ? nil : secret(vault: keyvault, name: password)
168
168
  end
169
169
 
170
170
  ###############################################################################
@@ -29,7 +29,7 @@ module TerraformWrapper
29
29
 
30
30
  ###############################################################################
31
31
 
32
- def initialize(code:, config:, options:, service:, variables:)
32
+ def initialize(options:, variables:)
33
33
  logger.fatal("This class should not be used directly! Please create an authenticator-specific class instead!")
34
34
  end
35
35
 
@@ -59,13 +59,9 @@ module TerraformWrapper
59
59
 
60
60
  ###############################################################################
61
61
 
62
- def construct(code:, config:, options:, service:, variables:)
62
+ def construct(options:, variables:)
63
63
  @options = options
64
- @variables = variables.values.merge({
65
- component: code.name,
66
- config: config,
67
- service: service
68
- })
64
+ @variables = variables
69
65
 
70
66
  specific
71
67
  end
@@ -35,8 +35,8 @@ module TerraformWrapper
35
35
 
36
36
  ###############################################################################
37
37
 
38
- def initialize(code:, config:, options:, service:, variables:)
39
- construct(code: code, config: config, options: options, service: service, variables: variables)
38
+ def initialize(options:, variables:)
39
+ construct(options: options, variables: variables)
40
40
  end
41
41
 
42
42
  ###############################################################################
@@ -101,18 +101,18 @@ module TerraformWrapper
101
101
  logger.fatal("AWS backend role to assume ARN must not be blank if specified!") if role.strip.empty?
102
102
  end
103
103
 
104
- logger.fatal("AWS backend S3 bucket name or key must include %{service}.") unless (bucket.include?("%{service}") or key.include?("%{service}"))
105
- logger.fatal("AWS backend S3 bucket name or key must include %{config}.") unless (bucket.include?("%{config}") or key.include?("%{config}"))
106
- logger.fatal("AWS backend S3 bucket name or key must include %{component}.") unless (bucket.include?("%{component}") or key.include?("%{component}"))
104
+ @variables.core.keys.map{ |sym| sym.to_s }.each do |core|
105
+ logger.fatal("AWS backend S3 bucket name or key must include %{#{core}}.") unless (bucket.include?("%{#{core}}") or key.include?("%{#{core}}"))
106
+ end
107
107
 
108
108
  begin
109
- bucket = bucket % @variables
110
- region = region % @variables
111
- key = key % @variables
112
- kms = kms % @variables unless kms.nil?
113
- role = role % @variables unless role.nil?
109
+ bucket = bucket % @variables.identifiers
110
+ region = region % @variables.identifiers
111
+ key = key % @variables.identifiers
112
+ kms = kms % @variables.identifiers unless kms.nil?
113
+ role = role % @variables.identifiers unless role.nil?
114
114
  rescue
115
- logger.fatal("AWS backend options contain variables that are not included in the configuration file!")
115
+ logger.fatal("AWS backend options contain identifiers that are not included in the configuration file!")
116
116
  end
117
117
 
118
118
  logger.fatal("Key: #{key} is too long for backend of type: #{@@type}") if key.length > 1024
@@ -31,8 +31,8 @@ module TerraformWrapper
31
31
 
32
32
  ###############################################################################
33
33
 
34
- def initialize(code:, config:, options:, service:, variables:)
35
- construct(code: code, config: config, options: options, service: service, variables: variables)
34
+ def initialize(options:, variables:)
35
+ construct(options: options, variables: variables)
36
36
  end
37
37
 
38
38
  ###############################################################################
@@ -75,17 +75,17 @@ module TerraformWrapper
75
75
  logger.fatal("Azure backend storage account key must be a string!") unless key.kind_of?(String)
76
76
  logger.fatal("Azure backend storage account key must not be blank!") if key.strip.empty?
77
77
 
78
- logger.fatal("Azure backend container or key must include %{service}.") unless (container.include?("%{service}") or key.include?("%{service}"))
79
- logger.fatal("Azure backend container or key must include %{config}.") unless (container.include?("%{config}") or key.include?("%{config}"))
80
- logger.fatal("Azure backend container or key must include %{component}.") unless (container.include?("%{component}") or key.include?("%{component}"))
78
+ @variables.core.keys.map{ |sym| sym.to_s }.each do |core|
79
+ logger.fatal("Azure backend container or key must include %{#{core}}.") unless (container.include?("%{#{core}}") or key.include?("%{#{core}}"))
80
+ end
81
81
 
82
82
  begin
83
- group = group % @variables
84
- account = account % @variables
85
- container = container % @variables
86
- key = key % @variables
83
+ group = group % @variables.identifiers
84
+ account = account % @variables.identifiers
85
+ container = container % @variables.identifiers
86
+ key = key % @variables.identifiers
87
87
  rescue
88
- logger.fatal("Azure backend options contain variables that are not included in the configuration file!")
88
+ logger.fatal("Azure backend options contain identifiers that are not included in the configuration file!")
89
89
  end
90
90
 
91
91
  if key.length > 1024 then
@@ -30,7 +30,7 @@ module TerraformWrapper
30
30
 
31
31
  ###############################################################################
32
32
 
33
- def initialize(code:, config:, options:, service:, variables:)
33
+ def initialize(options:, variables:)
34
34
  logger.fatal("This class should not be used directly! Please create a backend-specific class instead!")
35
35
  end
36
36
 
@@ -54,13 +54,9 @@ module TerraformWrapper
54
54
 
55
55
  ###############################################################################
56
56
 
57
- def construct(code:, config:, options:, service:, variables:)
57
+ def construct(options:, variables:)
58
58
  @options = options
59
- @variables = variables.values.merge({
60
- component: code.name,
61
- config: config,
62
- service: service
63
- })
59
+ @variables = variables
64
60
 
65
61
  specific
66
62
  end
@@ -28,8 +28,8 @@ module TerraformWrapper
28
28
 
29
29
  ###############################################################################
30
30
 
31
- def initialize(code:, config:, options:, service:, variables:)
32
- construct(code: code, config: config, options: options, service: service, variables: variables)
31
+ def initialize(options:, variables:)
32
+ construct(options: options, variables: variables)
33
33
  end
34
34
 
35
35
  ###############################################################################
@@ -52,14 +52,15 @@ module TerraformWrapper
52
52
  logger.fatal("Local backend path must be a string!") unless path.kind_of?(String)
53
53
  logger.fatal("Local backend path must not be blank!") if path.strip.empty?
54
54
 
55
- logger.fatal("Local backend path must include %{service} or the path to this repository.") unless (path.include?("%{service}") or path.include?(Dir.pwd))
56
- logger.fatal("Local backend path must include %{config}") unless path.include?("%{config}")
57
- logger.fatal("Local backend path must include %{component}") unless path.include?("%{component}")
55
+ @variables.core.keys.map{ |sym| sym.to_s }.each do |core|
56
+ next if (core == "service") and (path.include?(Dir.pwd))
57
+ logger.fatal("Local backend path must include %{#{core}}.") unless path.include?("%{#{core}}")
58
+ end
58
59
 
59
60
  begin
60
- path = path % @variables
61
+ path = path % @variables.identifiers
61
62
  rescue
62
- logger.fatal("Local backend options contain variables that are not included in the configuration file!")
63
+ logger.fatal("Local backend options contain identifiers that are not included in the configuration file!")
63
64
  end
64
65
 
65
66
  directory = File.dirname(path)
@@ -34,8 +34,6 @@ module TerraformWrapper
34
34
  @name = options["name"]
35
35
 
36
36
  @path = File.join(@base, @name)
37
-
38
- logger.fatal("Terraform code location: #{@path} does not exist!") unless exists
39
37
  end
40
38
 
41
39
  ###############################################################################
@@ -22,11 +22,6 @@ module TerraformWrapper
22
22
 
23
23
  @@config_exts = [ "", ".yaml", ".yml" ]
24
24
 
25
- ###############################################################################
26
-
27
- @@variable_files_name = "tfvars"
28
- @@variable_files_exts = [ ".tfvars" ]
29
-
30
25
  ###############################################################################
31
26
 
32
27
  attr_reader :auths
@@ -36,7 +31,6 @@ module TerraformWrapper
36
31
  attr_reader :name
37
32
  attr_reader :path
38
33
  attr_reader :service
39
- attr_reader :variable_files
40
34
  attr_reader :variables
41
35
 
42
36
  ###############################################################################
@@ -75,65 +69,50 @@ module TerraformWrapper
75
69
  backend_options = options["backend-options"]
76
70
 
77
71
  @code = code
78
- @path = find(base: @base, name: @name, exts: @@config_exts, description: "Configuration")
72
+ @path = ::TerraformWrapper.find(base: @base, name: @name, exts: @@config_exts, description: "Configuration")
79
73
 
80
74
  yaml = YAML.load(File.read(@path))
81
75
  logger.fatal("Invalid YAML in configuration file: #{@path}") unless yaml.kind_of?(Hash)
82
76
 
83
- if yaml.key?("variables") then
84
- logger.fatal("Key 'variables' is not a hash in configuration file: #{@path}") unless yaml["variables"].kind_of?(Hash)
85
- @variables = TerraformWrapper::Shared::Variables.new(values: yaml["variables"])
86
- else
87
- @variables = TerraformWrapper::Shared::Variables.new()
77
+ identifiers = yaml.key?("identifiers") ? yaml["identifiers"] : Hash.new
78
+ @variables = TerraformWrapper::Shared::Variables.new(config: @name, component: @code.name, service: @service, identifiers: identifiers)
79
+
80
+ if yaml.key?("globals") then
81
+ logger.fatal("Key 'globals' is not a hash in configuration file: #{@path}") unless yaml["globals"].kind_of?(Hash)
82
+ globals = yaml["globals"]
83
+
84
+ @variables.add_variables(variables: globals["variables"]) if globals.key?("variables")
88
85
  end
89
86
 
90
- @variable_files = yaml.key?("terraform") ? validate(variable_files: yaml["terraform"]) : Array.new
87
+ if yaml.key?("terraform") then
88
+ logger.fatal("Key 'terraform' is not a hash in configuration file: #{@path}") unless yaml["terraform"].kind_of?(Hash)
89
+ terraform = yaml["terraform"]
90
+
91
+ [ "globals", @code.name ].each do |extra|
92
+ if terraform.key?(extra) then
93
+ logger.fatal("Key '#{extra}' under 'terraform' is not a hash in configuration file: #{@path}") unless terraform[extra].kind_of?(Hash)
94
+ section = terraform[extra]
95
+
96
+ @variables.add_variables(variables: section["variables"]) if section.key?("variables")
97
+ @variables.add_files(base: @base, files: section["files"]) if section.key?("files")
98
+ end
99
+ end
100
+ end
91
101
 
92
102
  @auths = Array.new
93
- @auths.append(TerraformWrapper::Shared::Auths::Azure.new(code: @code, config: @name, options: auth_azure_options, service: @service, variables: @variables)) if auth_azure
103
+ @auths.append(TerraformWrapper::Shared::Auths::Azure.new(options: auth_azure_options, variables: @variables)) if auth_azure
94
104
 
95
105
  if backend == "local" then
96
- @backend = TerraformWrapper::Shared::Backends::Local.new(code: @code, config: @name, options: backend_options, service: @service, variables: @variables)
106
+ @backend = TerraformWrapper::Shared::Backends::Local.new(options: backend_options, variables: @variables)
97
107
  elsif backend == "aws" then
98
- @backend = TerraformWrapper::Shared::Backends::AWS.new(code: @code, config: @name, options: backend_options, service: @service, variables: @variables)
108
+ @backend = TerraformWrapper::Shared::Backends::AWS.new(options: backend_options, variables: @variables)
99
109
  elsif backend == "azure" then
100
- @backend = TerraformWrapper::Shared::Backends::Azure.new(code: @code, config: @name, options: backend_options, service: @service, variables: @variables)
110
+ @backend = TerraformWrapper::Shared::Backends::Azure.new(options: backend_options, variables: @variables)
101
111
  else
102
112
  logger.fatal("Backend: #{backend} is not valid!")
103
113
  end
104
114
  end
105
115
 
106
- ###############################################################################
107
-
108
- private
109
-
110
- ###############################################################################
111
-
112
- def find(base:, name:, exts:, description: "File")
113
- exts.each do |ext|
114
- path = File.join(base, name + ext)
115
- return path if File.file?(path)
116
- end
117
-
118
- logger.fatal("#{description} name: #{@name} not found in location: #{@base}!")
119
- end
120
-
121
- ###############################################################################
122
-
123
- def validate(variable_files:)
124
- logger.fatal("Optional key 'variable_files' must be a list of strings!") unless variable_files.kind_of?(Array)
125
-
126
- result = Array.new
127
-
128
- variable_files.each do |variable_file|
129
- logger.fatal("All elements of 'terraform' must be strings!") unless variable_file.kind_of?(String)
130
- logger.fatal("All elements of 'terraform' must not be blank!") if variable_file.strip.empty?
131
- result.append(find(base: File.join(@base, @@variable_files_name), name: variable_file.strip, exts: @@variable_files_exts, description: "Terraform values file"))
132
- end
133
-
134
- return result
135
- end
136
-
137
116
  ###############################################################################
138
117
 
139
118
  end
@@ -25,6 +25,8 @@ module TerraformWrapper
25
25
  ###############################################################################
26
26
 
27
27
  def initialize(binary:, code:)
28
+ logger.fatal("Terraform code location: #{code.path} does not exist!") unless code.check
29
+
28
30
  @binary = binary
29
31
  @code = code
30
32
 
@@ -151,8 +153,8 @@ module TerraformWrapper
151
153
 
152
154
  result = Array.new
153
155
 
154
- @config.variable_files.each do |variable_file|
155
- result.append("-var-file=\"#{variable_file}\"")
156
+ @config.variables.files.each do |file|
157
+ result.append("-var-file=\"#{file}\"")
156
158
  end
157
159
 
158
160
  return result
@@ -165,10 +167,6 @@ module TerraformWrapper
165
167
 
166
168
  result = Array.new
167
169
 
168
- result.append("-var=\"component=#{@code.name}\"")
169
- result.append("-var=\"config=#{@config.name}\"")
170
- result.append("-var=\"service=#{@config.service}\"")
171
-
172
170
  @config.variables.values.each do |key, value|
173
171
  result.append("-var=\"#{key.to_s}=#{value}\"")
174
172
  end
@@ -16,17 +16,80 @@ module TerraformWrapper
16
16
 
17
17
  ###############################################################################
18
18
 
19
- @@reserved = [ "component", "config", "service" ]
19
+ @@variable_files_name = "tfvars"
20
+ @@variable_files_exts = [ ".tfvars" ]
20
21
 
21
22
  ###############################################################################
22
23
 
24
+ attr_reader :core
25
+ attr_reader :files
26
+ attr_reader :identifiers
23
27
  attr_reader :values
24
28
 
25
29
  ###############################################################################
26
30
 
27
- def initialize(values: Hash.new, sort: true)
28
- cleansed = cleanse(values: values)
29
- @values = sort ? cleansed.sort.to_h : cleansed
31
+ def initialize(component:, config:, service:, identifiers: Hash.new, sort: false)
32
+ logger.fatal("Identifiers provided must be a hash!") unless identifiers.kind_of?(Hash)
33
+
34
+ @core = Hash.new()
35
+ @core[:component] = component
36
+ @core[:config] = config
37
+ @core[:service] = service
38
+
39
+ user = cleanse(variables: identifiers, reserved: @core.keys)
40
+ merged = @core.merge(user)
41
+
42
+ @identifiers = sort ? merged.sort.to_h : merged
43
+ @values = @identifiers
44
+ @files = Array.new
45
+ end
46
+
47
+ ###############################################################################
48
+
49
+ def add_files(base:, files:)
50
+ logger.fatal("Variable files provided must be an array!") unless files.kind_of?(Array)
51
+
52
+ files.each do |file|
53
+ logger.fatal("All provided variable file names must be strings!") unless file.kind_of?(String)
54
+ logger.fatal("All provided variable file names must not be blank!") if file.strip.empty?
55
+
56
+ path = ::TerraformWrapper.find(base: File.join(base, @@variable_files_name), name: file.strip, exts: @@variable_files_exts, description: "Terraform values file")
57
+
58
+ if @files.include?(path) then
59
+ logger.warn("Terraform variables file is included more than once: #{file.strip}")
60
+ else
61
+ @files.append(path)
62
+ end
63
+ end
64
+ end
65
+
66
+ ###############################################################################
67
+
68
+ def add_variables(variables:, sort: false)
69
+ logger.fatal("Variables provided must be a hash!") unless variables.kind_of?(Hash)
70
+
71
+ cleansed = cleanse(variables: variables, reserved: @values.keys)
72
+
73
+ begin
74
+ cleansed = cleansed.map{ |key, value| [ key, value % @identifiers ] }.to_h
75
+ rescue
76
+ logger.fatal("Variables contain identifiers that are not included in the configuration file!")
77
+ end
78
+
79
+ merged = @values.merge(cleansed)
80
+ @values = sort ? merged.sort.to_h : merged
81
+ end
82
+
83
+ ###############################################################################
84
+
85
+ def clear_files()
86
+ @files = Array.new
87
+ end
88
+
89
+ ###############################################################################
90
+
91
+ def clear_variables()
92
+ @values = @identifers
30
93
  end
31
94
 
32
95
  ###############################################################################
@@ -35,17 +98,17 @@ module TerraformWrapper
35
98
 
36
99
  ###############################################################################
37
100
 
38
- def cleanse(values:)
101
+ def cleanse(variables:, reserved:)
39
102
  result = Hash.new
40
103
 
41
- values.keys.each do |key|
104
+ variables.keys.each do |key|
42
105
  logger.fatal("Could not clean variables hash. All keys MUST be strings!") unless key.kind_of?(String)
43
- logger.fatal("Could not clean variables hash, key: #{key.downcase} is reserved and cannot be used!") if @@reserved.include?(key.downcase)
106
+ logger.fatal("Could not clean variables hash, key: #{key.downcase} is reserved or already in use and cannot be used!") if reserved.include?(key.downcase.to_sym)
44
107
  logger.fatal("Could not clean variables hash, duplicate key found: #{key.downcase}!") if result.key?(key.downcase.to_sym)
45
- logger.fatal("Could not clean variables hash, value for: #{key.downcase} is not a string!") unless values[key].kind_of?(String)
46
- logger.fatal("Could not clean variables hash, value for: #{key.downcase} is empty!") if values[key].strip.empty?
108
+ logger.fatal("Could not clean variables hash, value for: #{key.downcase} is not a string!") unless variables[key].kind_of?(String)
109
+ logger.fatal("Could not clean variables hash, value for: #{key.downcase} is empty!") if variables[key].strip.empty?
47
110
 
48
- result[key.downcase.to_sym] = values[key].strip
111
+ result[key.downcase.to_sym] = variables[key].strip
49
112
  end
50
113
 
51
114
  return result
@@ -34,7 +34,7 @@ module TerraformWrapper
34
34
 
35
35
  def upgrade_task
36
36
  desc "Upgrades the Terraform infrastructure component modules, providers and lock file."
37
- task :upgrade => :binary do |t, args|
37
+ task :upgrade => [:binary, :clean] do |t, args|
38
38
  runner = TerraformWrapper::Shared::Runner.new(binary: @binary, code: @code)
39
39
 
40
40
  logger.info("Upgrading Terraform component: #{@code.name}...")
@@ -4,7 +4,7 @@ module TerraformWrapper
4
4
 
5
5
  ###############################################################################
6
6
 
7
- VERSION = "0.2.2"
7
+ VERSION = "1.1.0"
8
8
 
9
9
  ###############################################################################
10
10
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: terraform-wrapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Lees
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-03-05 00:00:00.000000000 Z
11
+ date: 2021-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake