ruby-terraform 0.31.0.pre.pre.2 → 0.31.0.pre.pre.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -1
- data/Gemfile.lock +1 -1
- data/README.md +103 -1
- data/lib/ruby_terraform/commands/show.rb +3 -1
- data/lib/ruby_terraform/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4de31f123edc9358c631bbb94022472b0173a6144008c06ccfe35f91e17b26c0
|
4
|
+
data.tar.gz: 5acaa7f8dd31c1e6c27658af497f1a0b82f20cc8fecab1542bdb3b404c95ff23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e36e65ce356902ce650c48c85e12567bdbb7ecfaca49e2b28c32b6e79608eb427b8f4d7cf737afde02dd46b0f5f243409df0accdd80696511aaf9e84286343d
|
7
|
+
data.tar.gz: 4660bed722de8637b49257ee7142d7f012f3d536dc747c3561e86462b7263fe58dffe3e4aec58b93b59870b6015925fcd6e2c5e8d119f1e4f342d987e8d4e746
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,13 @@
|
|
1
|
-
## 0.
|
1
|
+
## 0.31.0 (September 25th, 2019)
|
2
|
+
|
3
|
+
IMPROVEMENTS
|
4
|
+
|
5
|
+
* Add support for `target` and / or `targets` options to be passed to `apply`,
|
6
|
+
`plan`, `refresh` and `destroy` commands.
|
7
|
+
* Add support for `plan` option to `apply` command to be more clear when
|
8
|
+
applying a prebuilt plan.
|
9
|
+
|
10
|
+
## 0.30.0 (September 25th, 2019)
|
2
11
|
|
3
12
|
IMPROVEMENTS:
|
4
13
|
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -47,6 +47,7 @@ Currently, there is partial support for the following commands:
|
|
47
47
|
* `RubyTerraform::Commands::Show`: executes `terraform show`
|
48
48
|
* `RubyTerraform::Commands::Destroy`: executes `terraform destroy`
|
49
49
|
* `RubyTerraform::Commands::Output`: executes `terraform output`
|
50
|
+
* `RubyTerraform::Commands::Refresh`: executes `terraform refresh`
|
50
51
|
* `RubyTerraform::Commands::RemoteConfig`: executes `terraform remote config`
|
51
52
|
* `RubyTerraform::Commands::Validate`: executes `terraform validate`
|
52
53
|
* `RubyTerraform::Commands::Workspace`: executes `terraform workspace`
|
@@ -137,6 +138,10 @@ The plan command supports the following options passed as keyword arguments:
|
|
137
138
|
`var_files` are provided, all var files will be passed to terraform.
|
138
139
|
* `var_files`: an array of paths to terraform var files; if both `var_file` and
|
139
140
|
`var_files` are provided, all var files will be passed to terraform.
|
141
|
+
* `target`: the address of a resource to target; if both `target` and
|
142
|
+
`targets` are provided, all targets will be passed to terraform.
|
143
|
+
* `targets`: and array of resource addresses to target; if both `target` and
|
144
|
+
`targets` are provided, all targets will be passed to terraform.
|
140
145
|
* `state`: the path to the state file in which to store state; defaults to
|
141
146
|
terraform.tfstate in the working directory or the remote state if configured.
|
142
147
|
* `plan`: the name of the file in which to save the generated plan.
|
@@ -173,6 +178,10 @@ The apply command supports the following options passed as keyword arguments:
|
|
173
178
|
`var_files` are provided, all var files will be passed to terraform.
|
174
179
|
* `var_files`: an array of paths to terraform var files; if both `var_file` and
|
175
180
|
`var_files` are provided, all var files will be passed to terraform.
|
181
|
+
* `target`: the address of a resource to target; if both `target` and
|
182
|
+
`targets` are provided, all targets will be passed to terraform.
|
183
|
+
* `targets`: and array of resource addresses to target; if both `target` and
|
184
|
+
`targets` are provided, all targets will be passed to terraform.
|
176
185
|
* `state`: the path to the state file in which to store state; defaults to
|
177
186
|
terraform.tfstate in the working directory or the remote state if configured.
|
178
187
|
* `backup`: the path to the backup file in which to store the state backup.
|
@@ -185,6 +194,26 @@ The apply command supports the following options passed as keyword arguments:
|
|
185
194
|
confirm the changes; defaults to `false`.
|
186
195
|
|
187
196
|
|
197
|
+
### RubyTerraform::Commands::Show
|
198
|
+
|
199
|
+
The show command produces human-readable output from a state file or a plan
|
200
|
+
file. It can be called in the following ways:
|
201
|
+
|
202
|
+
```ruby
|
203
|
+
RubyTerraform.show(
|
204
|
+
path: 'infra/networking')
|
205
|
+
RubyTerraform::Commands::Apply.new.execute(
|
206
|
+
path: 'infra/networking')
|
207
|
+
```
|
208
|
+
|
209
|
+
The show command supports the following options passed as keyword arguments:
|
210
|
+
* `path`: the path to a state or plan file; required.
|
211
|
+
* `no_color`: whether or not the output from the command should be in color;
|
212
|
+
defaults to `false`.
|
213
|
+
* `module_depth`: the depth of modules to show in the output; defaults to
|
214
|
+
showing all modules.
|
215
|
+
|
216
|
+
|
188
217
|
### RubyTerraform::Commands::Destroy
|
189
218
|
|
190
219
|
The destroy command destroys all resources defined in the terraform
|
@@ -211,6 +240,10 @@ The destroy command supports the following options passed as keyword arguments:
|
|
211
240
|
`var_files` are provided, all var files will be passed to terraform.
|
212
241
|
* `var_files`: an array of paths to terraform var files; if both `var_file` and
|
213
242
|
`var_files` are provided, all var files will be passed to terraform.
|
243
|
+
* `target`: the address of a resource to target; if both `target` and
|
244
|
+
`targets` are provided, all targets will be passed to terraform.
|
245
|
+
* `targets`: and array of resource addresses to target; if both `target` and
|
246
|
+
`targets` are provided, all targets will be passed to terraform.
|
214
247
|
* `state`: the path to the state file containing the current state; defaults to
|
215
248
|
terraform.tfstate in the working directory or the remote state if configured.
|
216
249
|
* `force`: if `true`, the command destroys without prompting the user to confirm
|
@@ -240,10 +273,48 @@ The output command supports the following options passed as keyword arguments:
|
|
240
273
|
* `module`: the name of a module to retrieve output from.
|
241
274
|
|
242
275
|
|
276
|
+
### RubyTerraform::Commands::Refresh
|
277
|
+
|
278
|
+
The refresh command will reconcile state with resources found in the target
|
279
|
+
environment. It can be called in the following ways:
|
280
|
+
|
281
|
+
```ruby
|
282
|
+
RubyTerraform.refresh(
|
283
|
+
directory: 'infra/networking',
|
284
|
+
vars: {
|
285
|
+
region: 'eu-central'
|
286
|
+
})
|
287
|
+
RubyTerraform::Commands::Refresh.new.execute(
|
288
|
+
directory: 'infra/networking',
|
289
|
+
vars: {
|
290
|
+
region: 'eu-central'
|
291
|
+
})
|
292
|
+
```
|
293
|
+
|
294
|
+
The refresh command supports the following options passed as keyword arguments:
|
295
|
+
* `directory`: the directory containing terraform configuration; required.
|
296
|
+
* `vars`: a map of vars to be passed in to the terraform configuration.
|
297
|
+
* `var_file`: the path to a terraform var file; if both `var_file` and
|
298
|
+
`var_files` are provided, all var files will be passed to terraform.
|
299
|
+
* `var_files`: an array of paths to terraform var files; if both `var_file` and
|
300
|
+
`var_files` are provided, all var files will be passed to terraform.
|
301
|
+
* `target`: the address of a resource to target; if both `target` and
|
302
|
+
`targets` are provided, all targets will be passed to terraform.
|
303
|
+
* `targets`: and array of resource addresses to target; if both `target` and
|
304
|
+
`targets` are provided, all targets will be passed to terraform.
|
305
|
+
* `state`: the path to the state file in which to store state; defaults to
|
306
|
+
terraform.tfstate in the working directory or the remote state if configured.
|
307
|
+
* `input`: when `false`, will not ask for input for variables not directly set;
|
308
|
+
defaults to `true`.
|
309
|
+
* `no_color`: whether or not the output from the command should be in color;
|
310
|
+
defaults to `false`.
|
311
|
+
|
312
|
+
|
243
313
|
### RubyTerraform::Commands::RemoteConfig
|
244
314
|
|
245
315
|
The remote config command configures storage of state using a remote backend. It
|
246
|
-
|
316
|
+
has been deprecated and since removed from terraform but is retained in this
|
317
|
+
library for backwards compatibility. It can be called in the following ways:
|
247
318
|
|
248
319
|
```ruby
|
249
320
|
RubyTerraform.remote_config(
|
@@ -271,6 +342,37 @@ arguments:
|
|
271
342
|
defaults to `false`.
|
272
343
|
|
273
344
|
|
345
|
+
### RubyTerraform::Commands::Validate
|
346
|
+
|
347
|
+
The validate command validates terraform configuration in the provided terraform
|
348
|
+
configuration directory. It can be called in the following ways:
|
349
|
+
|
350
|
+
```ruby
|
351
|
+
RubyTerraform.validate(
|
352
|
+
directory: 'infra/networking',
|
353
|
+
vars: {
|
354
|
+
region: 'eu-central'
|
355
|
+
})
|
356
|
+
RubyTerraform::Commands::Validate.new.execute(
|
357
|
+
directory: 'infra/networking',
|
358
|
+
vars: {
|
359
|
+
region: 'eu-central'
|
360
|
+
})
|
361
|
+
```
|
362
|
+
|
363
|
+
The validate command supports the following options passed as keyword arguments:
|
364
|
+
* `directory`: the directory containing terraform configuration; required.
|
365
|
+
* `vars`: a map of vars to be passed in to the terraform configuration.
|
366
|
+
* `var_file`: the path to a terraform var file; if both `var_file` and
|
367
|
+
`var_files` are provided, all var files will be passed to terraform.
|
368
|
+
* `var_files`: an array of paths to terraform var files; if both `var_file` and
|
369
|
+
`var_files` are provided, all var files will be passed to terraform.
|
370
|
+
* `no_color`: whether or not the output from the command should be in color;
|
371
|
+
defaults to `false`.
|
372
|
+
* `check_variables`: if `true`, the command checks whether all variables have
|
373
|
+
been provided; defaults to `true`.
|
374
|
+
|
375
|
+
|
274
376
|
### RubyTerraform::Commands::Workspace
|
275
377
|
|
276
378
|
The `workspace` command configures
|
@@ -7,15 +7,17 @@ module RubyTerraform
|
|
7
7
|
module Commands
|
8
8
|
class Show < Base
|
9
9
|
def configure_command(builder, opts)
|
10
|
+
path = opts[:path] || opts[:directory]
|
10
11
|
no_color = opts[:no_color]
|
11
12
|
module_depth = opts[:module_depth]
|
13
|
+
|
12
14
|
builder
|
13
15
|
.with_subcommand('show') do |sub|
|
14
16
|
sub = sub.with_option('-module-depth', module_depth) if module_depth
|
15
17
|
sub = sub.with_flag('-no-color') if no_color
|
16
18
|
sub
|
17
19
|
end
|
18
|
-
.with_argument(
|
20
|
+
.with_argument(path)
|
19
21
|
end
|
20
22
|
end
|
21
23
|
end
|