ruby-terraform 0.65.0.pre.15 → 1.0.0.pre.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +15 -15
- data/README.md +148 -397
- data/Rakefile +25 -0
- data/lib/ruby_terraform.rb +707 -45
- data/lib/ruby_terraform/commands.rb +0 -2
- data/lib/ruby_terraform/commands/apply.rb +7 -7
- data/lib/ruby_terraform/commands/base.rb +4 -1
- data/lib/ruby_terraform/commands/destroy.rb +6 -5
- data/lib/ruby_terraform/commands/force_unlock.rb +6 -4
- data/lib/ruby_terraform/commands/format.rb +8 -4
- data/lib/ruby_terraform/commands/get.rb +6 -4
- data/lib/ruby_terraform/commands/graph.rb +11 -3
- data/lib/ruby_terraform/commands/import.rb +8 -7
- data/lib/ruby_terraform/commands/init.rb +16 -6
- data/lib/ruby_terraform/commands/login.rb +2 -2
- data/lib/ruby_terraform/commands/logout.rb +2 -2
- data/lib/ruby_terraform/commands/output.rb +2 -2
- data/lib/ruby_terraform/commands/plan.rb +6 -3
- data/lib/ruby_terraform/commands/providers.rb +9 -3
- data/lib/ruby_terraform/commands/providers_lock.rb +10 -7
- data/lib/ruby_terraform/commands/providers_mirror.rb +3 -3
- data/lib/ruby_terraform/commands/providers_schema.rb +21 -2
- data/lib/ruby_terraform/commands/refresh.rb +70 -3
- data/lib/ruby_terraform/commands/show.rb +26 -3
- data/lib/ruby_terraform/commands/state_list.rb +54 -3
- data/lib/ruby_terraform/commands/state_move.rb +64 -6
- data/lib/ruby_terraform/commands/state_pull.rb +24 -2
- data/lib/ruby_terraform/commands/state_push.rb +49 -3
- data/lib/ruby_terraform/commands/state_remove.rb +55 -7
- data/lib/ruby_terraform/commands/state_replace_provider.rb +39 -6
- data/lib/ruby_terraform/commands/state_show.rb +26 -2
- data/lib/ruby_terraform/commands/taint.rb +63 -2
- data/lib/ruby_terraform/commands/untaint.rb +55 -2
- data/lib/ruby_terraform/commands/validate.rb +51 -6
- data/lib/ruby_terraform/commands/workspace_delete.rb +29 -7
- data/lib/ruby_terraform/commands/workspace_list.rb +21 -6
- data/lib/ruby_terraform/commands/workspace_new.rb +28 -7
- data/lib/ruby_terraform/commands/workspace_select.rb +23 -7
- data/lib/ruby_terraform/commands/workspace_show.rb +17 -2
- data/lib/ruby_terraform/options.rb +1 -1
- data/lib/ruby_terraform/options/definition.rb +3 -1
- data/lib/ruby_terraform/options/definitions.rb +12 -3
- data/lib/ruby_terraform/options/{common.rb → global.rb} +1 -1
- data/lib/ruby_terraform/options/types.rb +0 -1
- data/lib/ruby_terraform/options/types/flag.rb +8 -4
- data/lib/ruby_terraform/options/types/standard.rb +20 -6
- data/lib/ruby_terraform/version.rb +1 -1
- data/ruby_terraform.gemspec +2 -2
- metadata +9 -12
- data/lib/ruby_terraform/commands/clean.rb +0 -26
- data/lib/ruby_terraform/commands/remote_config.rb +0 -25
- data/lib/ruby_terraform/options/types/base.rb +0 -19
@@ -1,13 +1,35 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative 'base'
|
4
|
-
require_relative '../options/
|
4
|
+
require_relative '../options/global'
|
5
5
|
|
6
6
|
module RubyTerraform
|
7
7
|
module Commands
|
8
|
+
# Wraps the +terraform state pull+ command which pulls the state from its
|
9
|
+
# location, upgrades the local copy, and outputs it to stdout.
|
10
|
+
#
|
11
|
+
# This command "pulls" the current state and outputs it to stdout. As part
|
12
|
+
# of this process, Terraform will upgrade the state format of the local copy
|
13
|
+
# to the current version.
|
14
|
+
#
|
15
|
+
# The primary use of this is for state stored remotely. This command will
|
16
|
+
# still work with local state but is less useful for this.
|
17
|
+
#
|
18
|
+
# For options accepted on construction, see {#initialize}.
|
19
|
+
#
|
20
|
+
# When executing an instance of {StatePull} via {#execute}, the following
|
21
|
+
# options are supported:
|
22
|
+
#
|
23
|
+
# * +:chdir+: the path of a working directory to switch to before executing
|
24
|
+
# the given subcommand.
|
25
|
+
#
|
26
|
+
# @example Basic Invocation
|
27
|
+
# RubyTerraform::Commands::StatePull.new.execute
|
28
|
+
#
|
8
29
|
class StatePull < Base
|
9
|
-
include RubyTerraform::Options::
|
30
|
+
include RubyTerraform::Options::Global
|
10
31
|
|
32
|
+
# @!visibility private
|
11
33
|
def subcommands
|
12
34
|
%w[state pull]
|
13
35
|
end
|
@@ -1,21 +1,67 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative 'base'
|
4
|
-
require_relative '../options/
|
4
|
+
require_relative '../options/global'
|
5
5
|
|
6
6
|
module RubyTerraform
|
7
7
|
module Commands
|
8
|
+
# Wraps the +terraform state push+ command which updates remote state from
|
9
|
+
# a local state file.
|
10
|
+
#
|
11
|
+
# This command "pushes" a local state and overwrites remote state with a
|
12
|
+
# local state file. The command will protect you against writing
|
13
|
+
# an older serial or a different state file lineage unless you pass +true+
|
14
|
+
# for the +:force+ option.
|
15
|
+
#
|
16
|
+
# This command works with local state (it will overwrite the local state),
|
17
|
+
# but is less useful for this use case.
|
18
|
+
#
|
19
|
+
# If +:path+ is +"-"+, then this command will read the state to push from
|
20
|
+
# stdin. Data from stdin is not streamed to the backend: it is loaded
|
21
|
+
# completely (until pipe close), verified, and then pushed.
|
22
|
+
#
|
23
|
+
# For options accepted on construction, see {#initialize}.
|
24
|
+
#
|
25
|
+
# When executing an instance of {StatePush} via {#execute}, the following
|
26
|
+
# options are supported:
|
27
|
+
#
|
28
|
+
# * +:path+: the path to the state file to push; when passed +"-"+ will
|
29
|
+
# read state from standard input.
|
30
|
+
# * +:chdir+: the path of a working directory to switch to before executing
|
31
|
+
# the given subcommand.
|
32
|
+
# * +:force+: when +true+, writes the state even if lineages don't match or
|
33
|
+
# the remote serial is higher; defaults to +false+.
|
34
|
+
# * +:lock+: when +true+, locks the state file when locking is supported;
|
35
|
+
# when +false+, does not lock the state file; defaults to +true+.
|
36
|
+
# * +:lock_timeout+: the duration to retry a state lock; defaults to +"0s"+.
|
37
|
+
# * +:ignore_remote_version+: whether or not to continue even if remote and
|
38
|
+
# local Terraform versions are incompatible; this may result in an
|
39
|
+
# unusable workspace, and should be used with extreme caution; defaults to
|
40
|
+
# +false+.
|
41
|
+
#
|
42
|
+
# @example Basic Invocation
|
43
|
+
# RubyTerraform::Commands::StatePush.new.execute(
|
44
|
+
# path: 'some/statefile.tfstate')
|
45
|
+
#
|
8
46
|
class StatePush < Base
|
9
|
-
include RubyTerraform::Options::
|
47
|
+
include RubyTerraform::Options::Global
|
10
48
|
|
49
|
+
# @!visibility private
|
11
50
|
def subcommands
|
12
51
|
%w[state push]
|
13
52
|
end
|
14
53
|
|
54
|
+
# @!visibility private
|
15
55
|
def options
|
16
|
-
%w[
|
56
|
+
%w[
|
57
|
+
-force
|
58
|
+
-lock
|
59
|
+
-lock-timeout
|
60
|
+
-ignore-remote-version
|
61
|
+
] + super
|
17
62
|
end
|
18
63
|
|
64
|
+
# @!visibility private
|
19
65
|
def arguments(parameters)
|
20
66
|
[parameters[:path]]
|
21
67
|
end
|
@@ -1,31 +1,79 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative 'base'
|
4
|
-
require_relative '../options/
|
4
|
+
require_relative '../options/global'
|
5
5
|
|
6
6
|
module RubyTerraform
|
7
7
|
module Commands
|
8
|
+
# Wraps the +terraform state rm+ command which removes one or more items
|
9
|
+
# from the Terraform state, causing Terraform to "forget" those items
|
10
|
+
# without first destroying them in the remote system.
|
11
|
+
#
|
12
|
+
# This command removes one or more resource instances from the Terraform
|
13
|
+
# state based on the addresses given. You can view and list the available
|
14
|
+
# instances with {StateList}.
|
15
|
+
#
|
16
|
+
# If you give the address of an entire module then all of the instances in
|
17
|
+
# that module and any of its child modules will be removed from the state.
|
18
|
+
#
|
19
|
+
# If you give the address of a resource that has "count" or "for_each" set,
|
20
|
+
# all of the instances of that resource will be removed from the state.
|
21
|
+
#
|
22
|
+
# For options accepted on construction, see {#initialize}.
|
23
|
+
#
|
24
|
+
# When executing an instance of {StateRemove} via {#execute}, the following
|
25
|
+
# options are supported:
|
26
|
+
#
|
27
|
+
# * +:address+: the module address or absolute resource address of the
|
28
|
+
# resource instance to remove; required unless +:addresses+ is supplied;
|
29
|
+
# if both +:address+ and +:addresses+ are provided, all addresses will be
|
30
|
+
# passed to Terraform.
|
31
|
+
# * +:addresses+: an array of module addresses or absolute resource
|
32
|
+
# addresses of the resource instances to remove; required unless
|
33
|
+
# +:address+ is supplied; if both +:address+ and +:addresses+ are
|
34
|
+
# provided, all addresses will be passed to Terraform.
|
35
|
+
# * +:chdir+: the path of a working directory to switch to before executing
|
36
|
+
# the given subcommand.
|
37
|
+
# * +:dry+run+: when +true+, prints out what would've been removed but
|
38
|
+
# doesn't actually remove anything; defaults to +false+.
|
39
|
+
# * +:backup+: the path where Terraform should write the backup state.
|
40
|
+
# * +:lock+: when +true+, locks the state file when locking is supported;
|
41
|
+
# when +false+, does not lock the state file; defaults to +true+.
|
42
|
+
# * +:lock_timeout+: the duration to retry a state lock; defaults to +"0s"+.
|
43
|
+
# * +:state+: the path to the state file to update; defaults to the current
|
44
|
+
# workspace state.
|
45
|
+
# * +:ignore_remote_version+: whether or not to continue even if remote and
|
46
|
+
# local Terraform versions are incompatible; this may result in an
|
47
|
+
# unusable workspace, and should be used with extreme caution; defaults to
|
48
|
+
# +false+.
|
49
|
+
#
|
50
|
+
# @example Basic Invocation
|
51
|
+
# RubyTerraform::Commands::StateRemove.new.execute(
|
52
|
+
# address: 'packet_device.worker')
|
53
|
+
#
|
8
54
|
class StateRemove < Base
|
9
|
-
include RubyTerraform::Options::
|
55
|
+
include RubyTerraform::Options::Global
|
10
56
|
|
57
|
+
# @!visibility private
|
11
58
|
def subcommands
|
12
59
|
%w[state rm]
|
13
60
|
end
|
14
61
|
|
62
|
+
# @!visibility private
|
15
63
|
def options
|
16
64
|
%w[
|
65
|
+
-dry-run
|
17
66
|
-backup
|
67
|
+
-lock
|
68
|
+
-lock-timeout
|
18
69
|
-state
|
19
70
|
-ignore-remote-version
|
20
71
|
] + super
|
21
72
|
end
|
22
73
|
|
74
|
+
# @!visibility private
|
23
75
|
def arguments(parameters)
|
24
|
-
[parameters[:address]]
|
25
|
-
end
|
26
|
-
|
27
|
-
def parameter_overrides(parameters)
|
28
|
-
{ backup: parameters[:no_backup] ? '-' : parameters[:backup] }
|
76
|
+
[parameters[:address], parameters[:addresses]]
|
29
77
|
end
|
30
78
|
end
|
31
79
|
end
|
@@ -1,17 +1,53 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative 'base'
|
4
|
-
require_relative '../options/
|
4
|
+
require_relative '../options/global'
|
5
5
|
|
6
6
|
module RubyTerraform
|
7
7
|
module Commands
|
8
|
+
# Wraps the +terraform state replace-provider+ command which replaces
|
9
|
+
# provider for resources in the Terraform state.
|
10
|
+
#
|
11
|
+
# For options accepted on construction, see {#initialize}.
|
12
|
+
#
|
13
|
+
# When executing an instance of {StateReplaceProvider} via {#execute}, the
|
14
|
+
# following options are supported:
|
15
|
+
#
|
16
|
+
# * +:from+: the fully qualified name of the provider to be replaced;
|
17
|
+
# required.
|
18
|
+
# * +:to+: the fully qualified name of the provider to replace with;
|
19
|
+
# required.
|
20
|
+
# * +:chdir+: the path of a working directory to switch to before executing
|
21
|
+
# the given subcommand.
|
22
|
+
# * +:auto_approve+: if +true+, skips interactive approval; defaults to
|
23
|
+
# +false+.
|
24
|
+
# * +:backup+: the path where Terraform should write the backup for the
|
25
|
+
# state file; this can't be disabled; if not set, Terraform will write it
|
26
|
+
# to the same path as the state file with a ".backup" extension.
|
27
|
+
# * +:lock+: when +true+, locks the state file when locking is supported;
|
28
|
+
# when +false+, does not lock the state file; defaults to +true+.
|
29
|
+
# * +:lock_timeout+: the duration to retry a state lock; defaults to +"0s"+.
|
30
|
+
# * +:state+: the path to the state file to update; defaults to the current
|
31
|
+
# workspace state.
|
32
|
+
# * +:ignore_remote_version+: whether or not to continue even if remote and
|
33
|
+
# local Terraform versions are incompatible; this may result in an
|
34
|
+
# unusable workspace, and should be used with extreme caution; defaults to
|
35
|
+
# +false+.
|
36
|
+
#
|
37
|
+
# @example Basic Invocation
|
38
|
+
# RubyTerraform::Commands::StateReplaceProvider.new.execute(
|
39
|
+
# from: 'hashicorp/aws',
|
40
|
+
# to: 'registry.acme.corp/acme/aws')
|
41
|
+
#
|
8
42
|
class StateReplaceProvider < Base
|
9
|
-
include RubyTerraform::Options::
|
43
|
+
include RubyTerraform::Options::Global
|
10
44
|
|
45
|
+
# @!visibility private
|
11
46
|
def subcommands
|
12
47
|
%w[state replace-provider]
|
13
48
|
end
|
14
49
|
|
50
|
+
# @!visibility private
|
15
51
|
def options
|
16
52
|
%w[
|
17
53
|
-auto-approve
|
@@ -23,13 +59,10 @@ module RubyTerraform
|
|
23
59
|
] + super
|
24
60
|
end
|
25
61
|
|
62
|
+
# @!visibility private
|
26
63
|
def arguments(parameters)
|
27
64
|
[parameters[:from], parameters[:to]]
|
28
65
|
end
|
29
|
-
|
30
|
-
def parameter_overrides(parameters)
|
31
|
-
{ backup: parameters[:no_backup] ? '-' : parameters[:backup] }
|
32
|
-
end
|
33
66
|
end
|
34
67
|
end
|
35
68
|
end
|
@@ -1,21 +1,45 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative 'base'
|
4
|
-
require_relative '../options/
|
4
|
+
require_relative '../options/global'
|
5
5
|
|
6
6
|
module RubyTerraform
|
7
7
|
module Commands
|
8
|
+
# Wraps the +terraform state show+ command which shows the attributes of a
|
9
|
+
# resource in the Terraform state.
|
10
|
+
#
|
11
|
+
# This command shows the attributes of a single resource in the Terraform
|
12
|
+
# state. The +:address+ argument must be used to specify a single resource.
|
13
|
+
# You can view the list of available resources with {StateList}.
|
14
|
+
#
|
15
|
+
# For options accepted on construction, see {#initialize}.
|
16
|
+
#
|
17
|
+
# When executing an instance of {StateShow} via {#execute}, the following
|
18
|
+
# options are supported:
|
19
|
+
#
|
20
|
+
# * +:address+: the module address or absolute resource address of the
|
21
|
+
# resource instance to show; required.
|
22
|
+
# * +:chdir+: the path of a working directory to switch to before executing
|
23
|
+
# the given subcommand.
|
24
|
+
#
|
25
|
+
# @example Basic Invocation
|
26
|
+
# RubyTerraform::Commands::StateShow.new.execute(
|
27
|
+
# address: 'packet_device.worker')
|
28
|
+
#
|
8
29
|
class StateShow < Base
|
9
|
-
include RubyTerraform::Options::
|
30
|
+
include RubyTerraform::Options::Global
|
10
31
|
|
32
|
+
# @!visibility private
|
11
33
|
def subcommands
|
12
34
|
%w[state show]
|
13
35
|
end
|
14
36
|
|
37
|
+
# @!visibility private
|
15
38
|
def options
|
16
39
|
%w[-state] + super
|
17
40
|
end
|
18
41
|
|
42
|
+
# @!visibility private
|
19
43
|
def arguments(parameters)
|
20
44
|
[parameters[:address]]
|
21
45
|
end
|
@@ -1,17 +1,76 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative 'base'
|
4
|
-
require_relative '../options/
|
4
|
+
require_relative '../options/global'
|
5
5
|
|
6
6
|
module RubyTerraform
|
7
7
|
module Commands
|
8
|
+
# Wraps the +terraform taint+ command which marks a resource instance as not
|
9
|
+
# fully functional.
|
10
|
+
#
|
11
|
+
# Terraform uses the term "tainted" to describe a resource instance which
|
12
|
+
# may not be fully functional, either because its creation partially failed
|
13
|
+
# or because you've manually marked it as such using this command.
|
14
|
+
#
|
15
|
+
# This will not modify your infrastructure directly, but subsequent
|
16
|
+
# Terraform plans will include actions to destroy the remote object and
|
17
|
+
# create a new object to replace it.
|
18
|
+
#
|
19
|
+
# You can remove the "taint" state from a resource instance using the
|
20
|
+
# {Untaint} command.
|
21
|
+
#
|
22
|
+
# The address is in the usual resource address syntax, such as:
|
23
|
+
#
|
24
|
+
# * +aws_instance.foo+
|
25
|
+
# * <tt>aws_instance.bar[1]</tt>
|
26
|
+
# * +module.foo.module.bar.aws_instance.baz+
|
27
|
+
#
|
28
|
+
# Use your shell's quoting or escaping syntax to ensure that the address
|
29
|
+
# will reach Terraform correctly, without any special interpretation.
|
30
|
+
#
|
31
|
+
# For options accepted on construction, see {#initialize}.
|
32
|
+
#
|
33
|
+
# When executing an instance of {Taint} via {#execute}, the following
|
34
|
+
# options are supported:
|
35
|
+
#
|
36
|
+
# * +:address+: the module address or absolute resource address of the
|
37
|
+
# resource instance to taint; required.
|
38
|
+
# * +:chdir+: the path of a working directory to switch to before executing
|
39
|
+
# the given subcommand.
|
40
|
+
# * +:allow_missing+: if +true+, the command will succeed (i.e., will not
|
41
|
+
# throw an {RubyTerraform::Errors::ExecutionError}) even if the resource
|
42
|
+
# is missing; defaults to +false+.
|
43
|
+
# * +:backup+: the path to backup the existing state file before modifying;
|
44
|
+
# defaults to the +:state_out+ path with +".backup"+ extension; set
|
45
|
+
# +:no_backup+ to +true+ to skip backups entirely.
|
46
|
+
# * +:lock+: when +true+, locks the state file when locking is supported;
|
47
|
+
# when +false+, does not lock the state file; defaults to +true+.
|
48
|
+
# * +:lock_timeout+: the duration to retry a state lock; defaults to +"0s"+.
|
49
|
+
# * +:no_backup+: when +true+, no backup file will be written; defaults to
|
50
|
+
# +false+.
|
51
|
+
# * +:state+: the path to the state file from which to read state and in
|
52
|
+
# which to store state (unless +:state_out+ is specified); defaults to
|
53
|
+
# +"terraform.tfstate"+.
|
54
|
+
# * +:state_out+: the path to write state to that is different than
|
55
|
+
# +:state+; this can be used to preserve the old state.
|
56
|
+
# * +:ignore_remote_version+: whether or not to continue even if remote and
|
57
|
+
# local Terraform versions are incompatible; this may result in an
|
58
|
+
# unusable workspace, and should be used with extreme caution; defaults to
|
59
|
+
# +false+.
|
60
|
+
#
|
61
|
+
# @example Basic Invocation
|
62
|
+
# RubyTerraform::Commands::Taint.new.execute(
|
63
|
+
# address: 'aws_security_group.allow_all')
|
64
|
+
#
|
8
65
|
class Taint < Base
|
9
|
-
include RubyTerraform::Options::
|
66
|
+
include RubyTerraform::Options::Global
|
10
67
|
|
68
|
+
# @!visibility private
|
11
69
|
def subcommands
|
12
70
|
%w[taint]
|
13
71
|
end
|
14
72
|
|
73
|
+
# @!visibility private
|
15
74
|
def options
|
16
75
|
%w[
|
17
76
|
-allow-missing
|
@@ -24,10 +83,12 @@ module RubyTerraform
|
|
24
83
|
] + super
|
25
84
|
end
|
26
85
|
|
86
|
+
# @!visibility private
|
27
87
|
def arguments(parameters)
|
28
88
|
[parameters[:address]]
|
29
89
|
end
|
30
90
|
|
91
|
+
# @!visibility private
|
31
92
|
def parameter_overrides(parameters)
|
32
93
|
{ backup: parameters[:no_backup] ? '-' : parameters[:backup] }
|
33
94
|
end
|
@@ -1,17 +1,68 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative 'base'
|
4
|
-
require_relative '../options/
|
4
|
+
require_relative '../options/global'
|
5
5
|
|
6
6
|
module RubyTerraform
|
7
7
|
module Commands
|
8
|
+
# Wraps the +terraform untaint+ command which removes the 'tainted' state
|
9
|
+
# from a resource instance.
|
10
|
+
#
|
11
|
+
# Terraform uses the term "tainted" to describe a resource instance
|
12
|
+
# which may not be fully functional, either because its creation partially
|
13
|
+
# failed or because you've manually marked it as such using the {Taint}
|
14
|
+
# command.
|
15
|
+
#
|
16
|
+
# This command removes that state from a resource instance, causing
|
17
|
+
# Terraform to see it as fully-functional and not in need of replacement.
|
18
|
+
#
|
19
|
+
# This will not modify your infrastructure directly. It only avoids
|
20
|
+
# Terraform planning to replace a tainted instance in a future operation.
|
21
|
+
#
|
22
|
+
# For options accepted on construction, see {#initialize}.
|
23
|
+
#
|
24
|
+
# When executing an instance of {Untaint} via {#execute}, the following
|
25
|
+
# options are supported:
|
26
|
+
#
|
27
|
+
# * +:name+: the name of the resource instance to untaint; required.
|
28
|
+
# * +:chdir+: the path of a working directory to switch to before executing
|
29
|
+
# the given subcommand.
|
30
|
+
# * +:allow_missing+: if +true+, the command will succeed (i.e., will not
|
31
|
+
# throw an {RubyTerraform::Errors::ExecutionError}) even if the resource
|
32
|
+
# is missing; defaults to +false+.
|
33
|
+
# * +:backup+: the path to backup the existing state file before modifying;
|
34
|
+
# defaults to the +:state_out+ path with +".backup"+ extension; set
|
35
|
+
# +:no_backup+ to +true+ to skip backups entirely.
|
36
|
+
# * +:lock+: when +true+, locks the state file when locking is supported;
|
37
|
+
# when +false+, does not lock the state file; defaults to +true+.
|
38
|
+
# * +:lock_timeout+: the duration to retry a state lock; defaults to +"0s"+.
|
39
|
+
# * +:no_backup+: when +true+, no backup file will be written; defaults to
|
40
|
+
# +false+.
|
41
|
+
# * +:no_color+: whether or not the output from the command should be in
|
42
|
+
# color; defaults to +false+.
|
43
|
+
# * +:state+: the path to the state file from which to read state and in
|
44
|
+
# which to store state (unless +:state_out+ is specified); defaults to
|
45
|
+
# +"terraform.tfstate"+.
|
46
|
+
# * +:state_out+: the path to write state to that is different than
|
47
|
+
# +:state+; this can be used to preserve the old state.
|
48
|
+
# * +:ignore_remote_version+: whether or not to continue even if remote and
|
49
|
+
# local Terraform versions are incompatible; this may result in an
|
50
|
+
# unusable workspace, and should be used with extreme caution; defaults to
|
51
|
+
# +false+.
|
52
|
+
#
|
53
|
+
# @example Basic Invocation
|
54
|
+
# RubyTerraform::Commands::Untaint.new.execute(
|
55
|
+
# name: 'aws_security_group.allow_all')
|
56
|
+
#
|
8
57
|
class Untaint < Base
|
9
|
-
include RubyTerraform::Options::
|
58
|
+
include RubyTerraform::Options::Global
|
10
59
|
|
60
|
+
# @!visibility private
|
11
61
|
def subcommands
|
12
62
|
%w[untaint]
|
13
63
|
end
|
14
64
|
|
65
|
+
# @!visibility private
|
15
66
|
def options
|
16
67
|
%w[
|
17
68
|
-allow-missing
|
@@ -25,10 +76,12 @@ module RubyTerraform
|
|
25
76
|
] + super
|
26
77
|
end
|
27
78
|
|
79
|
+
# @!visibility private
|
28
80
|
def arguments(parameters)
|
29
81
|
[parameters[:name]]
|
30
82
|
end
|
31
83
|
|
84
|
+
# @!visibility private
|
32
85
|
def parameter_overrides(parameters)
|
33
86
|
{ backup: parameters[:no_backup] ? '-' : parameters[:backup] }
|
34
87
|
end
|