terraform-wrapper 0.1.1 → 0.2.2

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: b0f59fe60b44165f5771d0e20fe31b8e6d9f4dd05646a7a32ee5cb41de1c94ce
4
- data.tar.gz: 268a408964acce9c9bc9745fea9c5ef154f7aee861f3245c4ea668a43548cc1c
3
+ metadata.gz: 66bb2630f4f5580fdf738902d4807b9584572ef131a01d685eecbe2a067f023c
4
+ data.tar.gz: efcd70b4c39b0870f2cce7461c03861425262347d565c80d3da90841f4eb6bf2
5
5
  SHA512:
6
- metadata.gz: a9f91604fe4042be3b34dcb59cc2049808a28dd0ccfef2f8998518fbb4d6ed3c62801472bd4e8c1d9e0d035697b9e9ec0542e464c9e15bafbe3ed6047d2c9177
7
- data.tar.gz: 5fc7cd614aa04419fa0a09c8843bd20e1b2a78f684926ddd5a98b4a1d4e429ceca8cee92be0ad0cbf837d8dc49b8dfd61faed176c547e3c2561676d8d2c0d9af
6
+ metadata.gz: fede831e98a731bf9145c90bd54d51cbabd51a76337d7360cec08fe59c3bc464d526584b0ea1dbaa34a1daab63137b8c7389c8c2d043ebb297a9bc47dadb4433
7
+ data.tar.gz: c6852721632b1fe7384127baecabd11d32cab7966f7ab40b804761211f18902118a7f966bdbdf78d0dc24c53374fa504d0f3bd77f8a63b105242dac51f14b878
data/.gitlab-ci.yml CHANGED
@@ -31,7 +31,7 @@ deploy:
31
31
  - hash gem
32
32
  - echo "-- Publishing Gem --"
33
33
  - rake release
34
- - echo "-- Listing Sums --
35
- - sha256sum *.gem
34
+ - echo "-- Listing Sums --"
35
+ - sha256sum "pkg"/*.gem
36
36
 
37
37
  ###############################################################################
data/Gemfile CHANGED
@@ -11,7 +11,3 @@ source "https://rubygems.org"
11
11
  gemspec
12
12
 
13
13
  ###############################################################################
14
-
15
- gem "rake", "~> 13.0"
16
-
17
- ###############################################################################
@@ -55,6 +55,7 @@ module TerraformWrapper
55
55
  tasks << TerraformWrapper::Tasks::Init.new(binary: binary, code: code, options: config_options)
56
56
  tasks << TerraformWrapper::Tasks::Plan.new(binary: binary, code: code, options: config_options)
57
57
  tasks << TerraformWrapper::Tasks::PlanDestroy.new(binary: binary, code: code, options: config_options)
58
+ tasks << TerraformWrapper::Tasks::Upgrade.new(binary: binary, code: code)
58
59
  tasks << TerraformWrapper::Tasks::Validate.new(binary: binary, code: code)
59
60
  return tasks
60
61
  end
@@ -78,7 +78,7 @@ module TerraformWrapper
78
78
  stdout = `#{cmdline}`
79
79
  code = $?.exitstatus
80
80
 
81
- logger.fatal("Failed to get secret: #{name} from key vault: #{vault}!") if (code != 0 and stdout.strip.empty?)
81
+ logger.fatal("Failed to get secret: #{name} from key vault: #{vault}!") if (code != 0 or stdout.strip.empty?)
82
82
 
83
83
  return(stdout.strip)
84
84
  end
@@ -97,11 +97,11 @@ module TerraformWrapper
97
97
  details = YAML.load(stdout.strip)
98
98
 
99
99
  logger.fatal("Returned details did not include the subscription ID!") unless details.key?("id")
100
- logger.fatal("Returned subscription ID is not a String!") unless details["id"].kind_of?(String)
100
+ logger.fatal("Returned subscription ID is not a string!") unless details["id"].kind_of?(String)
101
101
  logger.fatal("Returned subscription ID is empty!") if details["id"].strip.empty?
102
102
 
103
103
  logger.fatal("Returned details did not include the tenant ID!") unless details.key?("tenant")
104
- logger.fatal("Returned tenant ID is not a String!") unless details["tenant"].kind_of?(String)
104
+ logger.fatal("Returned tenant ID is not a string!") unless details["tenant"].kind_of?(String)
105
105
  logger.fatal("Returned tenant ID is empty!") if details["tenant"].strip.empty?
106
106
 
107
107
  details.transform_values! { |value| value.strip }
@@ -120,27 +120,34 @@ module TerraformWrapper
120
120
  logger.fatal("Azure CLI must be installed and accessible to use the Azure authenticator.") unless cli
121
121
 
122
122
  logger.fatal("Azure authenticator mandatory option 'subscription' has not been set!") unless @options.key?("subscription")
123
+ logger.fatal("Azure authenticator subscription must be a string!") unless @options["subscription"].kind_of?(String)
124
+ logger.fatal("Azure authenticator subscription must not be blank!") if @options["subscription"].strip.empty?
123
125
 
124
126
  subscription = @options["subscription"]
125
127
 
126
- logger.fatal("Azure authenticator subscription must be a String!") unless subscription.kind_of?(String)
127
- logger.fatal("Azure authenticator subscription must not be blank!") if subscription.strip.empty?
128
-
129
128
  if @options.key?("keyvault") then
130
- keyvault = @options["keyvault"]
129
+ logger.fatal("Azure authenticator keyvault name must be a string if specified!") unless @options["keyvault"].kind_of?(String)
130
+ logger.fatal("Azure authenticator keyvault name must not be blank if specified!") if @options["keyvault"].strip.empty?
131
131
 
132
- logger.fatal("Azure authenticator keyvault name must be a String if specified!") unless keyvault.kind_of?(String)
133
- logger.fatal("Azure authenticator keyvault name must not be blank if specified!") if keyvault.strip.empty?
132
+ keyvault = @options["keyvault"]
134
133
 
135
- username = @options.key?("username-secret") ? @options["username-secret"] : "terraform-username"
134
+ if @options.key?("username-secret") then
135
+ logger.fatal("Azure authenticator keyvault secret for username must be a string if keyvault name is specified!") unless @options["username-secret"].kind_of?(String)
136
+ logger.fatal("Azure authenticator keyvault secret for username must not be blank if keyvault name is specified!") if @options["username-secret"].strip.empty?
136
137
 
137
- logger.fatal("Azure authenticator keyvault secret for username must be a String if keyvault name is specified!") unless username.kind_of?(String)
138
- logger.fatal("Azure authenticator keyvault secret for username must not be blank if keyvault name is specified!") if username.strip.empty?
138
+ username = @options["username-secret"]
139
+ else
140
+ username = "terraform-username"
141
+ end
139
142
 
140
- password = @options.key?("username-password") ? @options["username-password"] : "terraform-password"
143
+ if @options.key?("password-secret") then
144
+ logger.fatal("Azure authenticator keyvault secret for password must be a string if keyvault name is specified!") unless @options["password-secret"].kind_of?(String)
145
+ logger.fatal("Azure authenticator keyvault secret for password must not be blank if keyvault name is specified!") if @options["password-secret"].strip.empty?
141
146
 
142
- logger.fatal("Azure authenticator keyvault secret for password must be a String if keyvault name is specified!") unless password.kind_of?(String)
143
- logger.fatal("Azure authenticator keyvault secret for password must not be blank if keyvault name is specified!") if password.strip.empty?
147
+ password = @options["password-secret"]
148
+ else
149
+ password = "terraform-password"
150
+ end
144
151
  end
145
152
 
146
153
  begin
@@ -70,17 +70,17 @@ module TerraformWrapper
70
70
 
71
71
  bucket = @options["bucket"]
72
72
 
73
- logger.fatal("AWS backend S3 bucket name must be a String!") unless bucket.kind_of?(String)
73
+ logger.fatal("AWS backend S3 bucket name must be a string!") unless bucket.kind_of?(String)
74
74
  logger.fatal("AWS backend S3 bucket name must not be blank!") if bucket.strip.empty?
75
75
 
76
76
  region = @options["region"]
77
77
 
78
- logger.fatal("AWS backend S3 bucket region must be a String!") unless region.kind_of?(String)
78
+ logger.fatal("AWS backend S3 bucket region must be a string!") unless region.kind_of?(String)
79
79
  logger.fatal("AWS backend S3 bucket region must not be blank!") if region.strip.empty?
80
80
 
81
81
  key = @options.key?("key") ? @options["key"] : File.join("%{service}", "%{config}", "%{component}" + @@ext)
82
82
 
83
- logger.fatal("AWS backend S3 bucket key must be a String!") unless key.kind_of?(String)
83
+ logger.fatal("AWS backend S3 bucket key must be a string!") unless key.kind_of?(String)
84
84
  logger.fatal("AWS backend S3 bucket key must not be blank!") if key.strip.empty?
85
85
 
86
86
  encrypt = @options.key?("encrypt") ? @options["encrypt"] : true
@@ -90,14 +90,14 @@ module TerraformWrapper
90
90
  if @options.key?("kms") then
91
91
  kms = @options["kms"]
92
92
 
93
- logger.fatal("AWS backend S3 bucket encryption KMS key ARN must be a String if specified!") unless kms.kind_of?(String)
93
+ logger.fatal("AWS backend S3 bucket encryption KMS key ARN must be a string if specified!") unless kms.kind_of?(String)
94
94
  logger.fatal("AWS backend S3 bucket encryption KMS key ARN must not be blank if specified!") if kms.strip.empty?
95
95
  end
96
96
 
97
97
  if @options.key?("role") then
98
98
  role = @options["role"]
99
99
 
100
- logger.fatal("AWS backend role to assume ARN must be a String if specified!") unless role.kind_of?(String)
100
+ logger.fatal("AWS backend role to assume ARN must be a string if specified!") unless role.kind_of?(String)
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
 
@@ -57,22 +57,22 @@ module TerraformWrapper
57
57
 
58
58
  group = @options["group"]
59
59
 
60
- logger.fatal("Azure backend group must be a String!") unless group.kind_of?(String)
60
+ logger.fatal("Azure backend group must be a string!") unless group.kind_of?(String)
61
61
  logger.fatal("Azure backend group must not be blank!") if group.strip.empty?
62
62
 
63
63
  account = @options.key?("account") ? @options["account"] : group + "tf"
64
64
 
65
- logger.fatal("Azure backend storage account must be a String!") unless account.kind_of?(String)
65
+ logger.fatal("Azure backend storage account must be a string!") unless account.kind_of?(String)
66
66
  logger.fatal("Azure backend storage account must not be blank!") if account.strip.empty?
67
67
 
68
68
  container = @options.key?("container") ? @options["container"] : "default"
69
69
 
70
- logger.fatal("Azure backend storage account container must be a String!") unless container.kind_of?(String)
70
+ logger.fatal("Azure backend storage account container must be a string!") unless container.kind_of?(String)
71
71
  logger.fatal("Azure backend storage account container must not be blank!") if container.strip.empty?
72
72
 
73
73
  key = @options.key?("key") ? @options["key"] : File.join("%{service}", "%{config}", "%{component}" + @@ext)
74
74
 
75
- logger.fatal("Azure backend storage account key must be a String!") unless key.kind_of?(String)
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
78
  logger.fatal("Azure backend container or key must include %{service}.") unless (container.include?("%{service}") or key.include?("%{service}"))
@@ -49,7 +49,7 @@ module TerraformWrapper
49
49
  def specific()
50
50
  path = @options.key?("path") ? @options["path"] : File.join(Dir.pwd, "state", "terraform", "%{config}", "%{component}" + @@ext)
51
51
 
52
- logger.fatal("Local backend path must be a String!") unless path.kind_of?(String)
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
55
  logger.fatal("Local backend path must include %{service} or the path to this repository.") unless (path.include?("%{service}") or path.include?(Dir.pwd))
@@ -28,12 +28,12 @@ module TerraformWrapper
28
28
  ###############################################################################
29
29
 
30
30
  def initialize(options:)
31
- logger.fatal("Binary base path must be a String!") unless options["base"].kind_of?(String)
31
+ logger.fatal("Binary base path must be a string!") unless options["base"].kind_of?(String)
32
32
  logger.fatal("Binary base path must not be blank!") if options["base"].strip.empty?
33
33
 
34
34
  @base = options["base"]
35
35
 
36
- logger.fatal("Binary version must be a String!") unless options["version"].kind_of?(String)
36
+ logger.fatal("Binary version must be a string!") unless options["version"].kind_of?(String)
37
37
  logger.fatal("Binary version must not be blank!") if options["version"].strip.empty?
38
38
 
39
39
  @version = options["version"]
@@ -23,12 +23,12 @@ module TerraformWrapper
23
23
  ###############################################################################
24
24
 
25
25
  def initialize(options:)
26
- logger.fatal("Code base path must be a String!") unless options["base"].kind_of?(String)
26
+ logger.fatal("Code base path must be a string!") unless options["base"].kind_of?(String)
27
27
  logger.fatal("Code base path must not be blank!") if options["base"].strip.empty?
28
28
 
29
29
  @base = options["base"]
30
30
 
31
- logger.fatal("Code component name must be a String!") unless options["name"].kind_of?(String)
31
+ logger.fatal("Code component name must be a string!") unless options["name"].kind_of?(String)
32
32
  logger.fatal("Code component name must not be blank!") if options["name"].strip.empty?
33
33
 
34
34
  @name = options["name"]
@@ -24,8 +24,8 @@ module TerraformWrapper
24
24
 
25
25
  ###############################################################################
26
26
 
27
- @@variable_files_name = "tfvars"
28
- @@variable_files_ext = ".tfvars"
27
+ @@variable_files_name = "tfvars"
28
+ @@variable_files_exts = [ ".tfvars" ]
29
29
 
30
30
  ###############################################################################
31
31
 
@@ -42,17 +42,17 @@ module TerraformWrapper
42
42
  ###############################################################################
43
43
 
44
44
  def initialize(code:, options:)
45
- logger.fatal("Configuration base path must be a String!") unless options["base"].kind_of?(String)
45
+ logger.fatal("Configuration base path must be a string!") unless options["base"].kind_of?(String)
46
46
  logger.fatal("Configuration base path must not be blank!") if options["base"].strip.empty?
47
47
 
48
48
  @base = options["base"]
49
49
 
50
- logger.fatal("Configuration service name must be a String!") unless options["service"].kind_of?(String)
50
+ logger.fatal("Configuration service name must be a string!") unless options["service"].kind_of?(String)
51
51
  logger.fatal("Configuration service name must not be blank!") if options["service"].strip.empty?
52
52
 
53
53
  @service = options["service"]
54
54
 
55
- logger.fatal("Configuration name must be a String!") unless options["name"].kind_of?(String)
55
+ logger.fatal("Configuration name must be a string!") unless options["name"].kind_of?(String)
56
56
  logger.fatal("Configuration name must not be blank!") if options["name"].strip.empty?
57
57
 
58
58
  @name = options["name"]
@@ -65,7 +65,7 @@ module TerraformWrapper
65
65
 
66
66
  auth_azure_options = options["auth-azure-options"]
67
67
 
68
- logger.fatal("Configuration backend name must be a String!") unless options["backend"].kind_of?(String)
68
+ logger.fatal("Configuration backend name must be a string!") unless options["backend"].kind_of?(String)
69
69
  logger.fatal("Configuration backend name must not be blank!") if options["backend"].strip.empty?
70
70
 
71
71
  backend = options["backend"]
@@ -75,10 +75,9 @@ module TerraformWrapper
75
75
  backend_options = options["backend-options"]
76
76
 
77
77
  @code = code
78
- @path = find
78
+ @path = find(base: @base, name: @name, exts: @@config_exts, description: "Configuration")
79
79
 
80
80
  yaml = YAML.load(File.read(@path))
81
-
82
81
  logger.fatal("Invalid YAML in configuration file: #{@path}") unless yaml.kind_of?(Hash)
83
82
 
84
83
  if yaml.key?("variables") then
@@ -110,13 +109,13 @@ module TerraformWrapper
110
109
 
111
110
  ###############################################################################
112
111
 
113
- def find
114
- @@config_exts.each do |config_ext|
115
- path = File.join(@base, @name + config_ext)
112
+ def find(base:, name:, exts:, description: "File")
113
+ exts.each do |ext|
114
+ path = File.join(base, name + ext)
116
115
  return path if File.file?(path)
117
116
  end
118
117
 
119
- logger.fatal("Terraform configuration name: #{@name} not found in location: #{@base}!")
118
+ logger.fatal("#{description} name: #{@name} not found in location: #{@base}!")
120
119
  end
121
120
 
122
121
  ###############################################################################
@@ -127,14 +126,9 @@ module TerraformWrapper
127
126
  result = Array.new
128
127
 
129
128
  variable_files.each do |variable_file|
130
- logger.fatal("All elements of 'variable_files' must be strings!") unless variable_file.kind_of?(String)
131
- logger.fatal("All elements of 'variable_files' must not be blank!") if variable_file.strip.empty?
132
- path = File.join(@base, @@variable_files_name, variable_file.strip + @@variable_files_ext)
133
- if File.file?(path) then
134
- result.append(path)
135
- else
136
- logger.fatal("Terraform variables file: #{variable_file}, path: #{path} does not exist!")
137
- end
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"))
138
132
  end
139
133
 
140
134
  return result
@@ -29,12 +29,11 @@ module TerraformWrapper
29
29
  @code = code
30
30
 
31
31
  @initialised = false
32
- @ready = false
33
32
  end
34
33
 
35
34
  ###############################################################################
36
35
 
37
- def download(upgrade: true)
36
+ def download(upgrade: false)
38
37
  parameters = Array.new
39
38
  parameters.append("-backend=false")
40
39
  parameters.append("-upgrade") if upgrade
@@ -48,29 +47,28 @@ module TerraformWrapper
48
47
  def import(address: nil, id: nil)
49
48
  logger.fatal("Cannot Terraform import before initialising backend!") unless initialised
50
49
 
51
- logger.fatal("Terraform state address for import must be a String!") unless address.kind_of?(String)
52
- logger.fatal("Terraform state address for import must be a String!") unless address.kind_of?(String)
50
+ logger.fatal("Terraform state address for import must be a string!") unless address.kind_of?(String)
51
+ logger.fatal("Terraform state address for import must be a string!") unless address.kind_of?(String)
53
52
  logger.fatal("Terraform state address for import must not be blank!") if address.strip.empty?
54
53
 
55
- logger.fatal("Identification for infrastructure to import must be a String!") unless id.kind_of?(String)
54
+ logger.fatal("Identification for infrastructure to import must be a string!") unless id.kind_of?(String)
56
55
  logger.fatal("Identification for infrastructure to import must not be blank!") if id.strip.empty?
57
56
 
58
57
  parameters = Array.new
59
58
  parameters.concat(variable_files)
60
59
  parameters.concat(variable_strings)
61
-
62
- parameters.append("\"#{address}\"")
63
- parameters.append("\"#{id}\"")
60
+
61
+ parameters.append("'#{address}'")
62
+ parameters.append("'#{id}'")
64
63
 
65
64
  logger.fatal("Terraform import failed!") unless run(action: "import", parameters: parameters)
66
65
  end
67
66
 
68
67
  ###############################################################################
69
68
 
70
- def init(config:, upgrade: true)
69
+ def init(config:)
71
70
  parameters = Array.new
72
71
  parameters.append("-reconfigure")
73
- parameters.append("-upgrade") if upgrade
74
72
 
75
73
  config.backend.hash.each do |key, value|
76
74
  parameters.append("-backend-config=\"#{key}=#{value}\"")
@@ -1,5 +1,9 @@
1
1
  ###############################################################################
2
2
 
3
+ require 'rake/tasklib'
4
+
5
+ ###############################################################################
6
+
3
7
  require_relative 'tasks/apply'
4
8
  require_relative 'tasks/binary'
5
9
  require_relative 'tasks/clean'
@@ -8,6 +12,7 @@ require_relative 'tasks/import'
8
12
  require_relative 'tasks/init'
9
13
  require_relative 'tasks/plan'
10
14
  require_relative 'tasks/plandestroy'
15
+ require_relative 'tasks/upgrade'
11
16
  require_relative 'tasks/validate'
12
17
 
13
18
  ###############################################################################
@@ -1,9 +1,5 @@
1
1
  ###############################################################################
2
2
 
3
- require 'rake/tasklib'
4
-
5
- ###############################################################################
6
-
7
3
  module TerraformWrapper
8
4
 
9
5
  ###############################################################################
@@ -3,7 +3,6 @@
3
3
  require 'digest'
4
4
  require 'fileutils'
5
5
  require 'net/http'
6
- require 'rake/tasklib'
7
6
  require 'uri'
8
7
  require 'zip'
9
8
 
@@ -134,7 +133,7 @@ module TerraformWrapper
134
133
  def extract(archive:, binary:, destination:)
135
134
  logger.info("Extracting: #{archive}")
136
135
 
137
- Zip::ZipFile.open(archive) do |zip|
136
+ Zip::File.open(archive) do |zip|
138
137
  zip.each do |file|
139
138
  zip.extract(file, destination) if file.name == binary
140
139
  end
@@ -1,9 +1,5 @@
1
1
  ###############################################################################
2
2
 
3
- require 'rake/tasklib'
4
-
5
- ###############################################################################
6
-
7
3
  module TerraformWrapper
8
4
 
9
5
  ###############################################################################
@@ -1,9 +1,5 @@
1
1
  ###############################################################################
2
2
 
3
- require 'rake/tasklib'
4
-
5
- ###############################################################################
6
-
7
3
  module TerraformWrapper
8
4
 
9
5
  ###############################################################################
@@ -1,9 +1,5 @@
1
1
  ###############################################################################
2
2
 
3
- require 'rake/tasklib'
4
-
5
- ###############################################################################
6
-
7
3
  module TerraformWrapper
8
4
 
9
5
  ###############################################################################
@@ -1,9 +1,5 @@
1
1
  ###############################################################################
2
2
 
3
- require 'rake/tasklib'
4
-
5
- ###############################################################################
6
-
7
3
  module TerraformWrapper
8
4
 
9
5
  ###############################################################################
@@ -1,9 +1,5 @@
1
1
  ###############################################################################
2
2
 
3
- require 'rake/tasklib'
4
-
5
- ###############################################################################
6
-
7
3
  module TerraformWrapper
8
4
 
9
5
  ###############################################################################
@@ -1,9 +1,5 @@
1
1
  ###############################################################################
2
2
 
3
- require 'rake/tasklib'
4
-
5
- ###############################################################################
6
-
7
3
  module TerraformWrapper
8
4
 
9
5
  ###############################################################################
@@ -0,0 +1,58 @@
1
+ ###############################################################################
2
+
3
+ module TerraformWrapper
4
+
5
+ ###############################################################################
6
+
7
+ module Tasks
8
+
9
+ ###############################################################################
10
+
11
+ class Upgrade < ::Rake::TaskLib
12
+
13
+ ###############################################################################
14
+
15
+ include TerraformWrapper::Shared::Logging
16
+
17
+ ###############################################################################
18
+
19
+ @binary
20
+ @code
21
+
22
+ ###############################################################################
23
+
24
+ def initialize(binary:, code:)
25
+ @binary = binary
26
+ @code = code
27
+
28
+ yield self if block_given?
29
+
30
+ upgrade_task
31
+ end
32
+
33
+ ###############################################################################
34
+
35
+ def upgrade_task
36
+ desc "Upgrades the Terraform infrastructure component modules, providers and lock file."
37
+ task :upgrade => :binary do |t, args|
38
+ runner = TerraformWrapper::Shared::Runner.new(binary: @binary, code: @code)
39
+
40
+ logger.info("Upgrading Terraform component: #{@code.name}...")
41
+
42
+ runner.download(upgrade: true)
43
+ end
44
+ end
45
+
46
+ ###############################################################################
47
+
48
+ end
49
+
50
+ ###############################################################################
51
+
52
+ end
53
+
54
+ ###############################################################################
55
+
56
+ end
57
+
58
+ ###############################################################################
@@ -1,9 +1,5 @@
1
1
  ###############################################################################
2
2
 
3
- require 'rake/tasklib'
4
-
5
- ###############################################################################
6
-
7
3
  module TerraformWrapper
8
4
 
9
5
  ###############################################################################
@@ -4,7 +4,7 @@ module TerraformWrapper
4
4
 
5
5
  ###############################################################################
6
6
 
7
- VERSION = "0.1.1"
7
+ VERSION = "0.2.2"
8
8
 
9
9
  ###############################################################################
10
10
 
@@ -31,6 +31,9 @@ Gem::Specification.new do |spec|
31
31
  spec.bindir = "exe"
32
32
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
33
33
  spec.require_paths = ["lib"]
34
+
35
+ spec.add_dependency 'rake', '~> 13.0'
36
+ spec.add_dependency 'rubyzip', '~> 2.3'
34
37
  end
35
38
 
36
39
  ###############################################################################
metadata CHANGED
@@ -1,15 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: terraform-wrapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.2
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-02-17 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2021-03-05 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rake
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '13.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '13.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rubyzip
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '2.3'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '2.3'
13
41
  description: A ruby wrapper for managing Terraform binaries and remote state. Each
14
42
  Terraform command (plan, apply, etc) is wrapped so that the correct binary is used
15
43
  and remote state referenced.
@@ -54,6 +82,7 @@ files:
54
82
  - lib/terraform-wrapper/tasks/init.rb
55
83
  - lib/terraform-wrapper/tasks/plan.rb
56
84
  - lib/terraform-wrapper/tasks/plandestroy.rb
85
+ - lib/terraform-wrapper/tasks/upgrade.rb
57
86
  - lib/terraform-wrapper/tasks/validate.rb
58
87
  - lib/terraform-wrapper/version.rb
59
88
  - terraform-wrapper.gemspec