diff --git a/lib/ruby_terraform/commands/apply.rb b/lib/ruby_terraform/commands/apply.rb index cb32357..6be60ed 100644 --- a/lib/ruby_terraform/commands/apply.rb +++ b/lib/ruby_terraform/commands/apply.rb @@ -47,6 +47,10 @@ module Commands # * +:refresh+: when +true+, updates state prior to checking for # differences; when +false+ uses locally available state; defaults to # +true+; this has no effect when +:plan+ is provided. + # * +:refresh_only+: when +true+, checks whether remote objects still + # match the outcome of the most recent Terraform apply but does not + # propose any actions to undo any changes made outside of Terraform; this + # has no effect when +:plan+ is provided # * +:replace+: force replacement of a particular resource instance using # its resource address. If the apply would've normally produced an update # or no-op action for this instance, Terraform will replace it instead. @@ -105,6 +109,7 @@ def options -no-color -parallelism -refresh + -refresh-only -replace -state -state-out diff --git a/lib/ruby_terraform/commands/plan.rb b/lib/ruby_terraform/commands/plan.rb index 056d554..ce00c96 100644 --- a/lib/ruby_terraform/commands/plan.rb +++ b/lib/ruby_terraform/commands/plan.rb @@ -45,6 +45,9 @@ module Commands # * +:refresh+: when +true+, updates state prior to checking for # differences; when +false+ uses locally available state; defaults to # +true+; this has no effect when +:plan+ is provided. + # * +:refresh_only+: when +true+, checks whether remote objects still + # match the outcome of the most recent Terraform apply but does not + # propose any actions to undo any changes made outside of Terraform # * +:replace+: force replacement of a particular resource instance using # its resource address. If the plan would've normally produced an update # or no-op action for this instance, Terraform will plan to replace it @@ -100,6 +103,7 @@ def options -out -parallelism -refresh + -refresh-only -replace -state -target diff --git a/lib/ruby_terraform/options/definitions.rb b/lib/ruby_terraform/options/definitions.rb index 30c88ba..a627d05 100644 --- a/lib/ruby_terraform/options/definitions.rb +++ b/lib/ruby_terraform/options/definitions.rb @@ -39,6 +39,7 @@ module Options -list -lock -refresh + -refresh-only -upgrade -verify-plugins -write diff --git a/spec/ruby_terraform/commands/apply_spec.rb b/spec/ruby_terraform/commands/apply_spec.rb index 87bebb1..7997a74 100644 --- a/spec/ruby_terraform/commands/apply_spec.rb +++ b/spec/ruby_terraform/commands/apply_spec.rb @@ -90,6 +90,11 @@ described_class, 'apply', :refresh ) + it_behaves_like( + 'a command with a boolean option', + described_class, 'apply', :refresh_only + ) + it_behaves_like( 'a command with an option', described_class, 'apply', :state diff --git a/spec/ruby_terraform/commands/plan_spec.rb b/spec/ruby_terraform/commands/plan_spec.rb index f69c097..eadae79 100644 --- a/spec/ruby_terraform/commands/plan_spec.rb +++ b/spec/ruby_terraform/commands/plan_spec.rb @@ -169,6 +169,11 @@ described_class, 'plan', :refresh ) + it_behaves_like( + 'a command with a boolean option', + described_class, 'plan', :refresh_only + ) + it_behaves_like( 'a command with an option', described_class, 'plan', :state