Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apply: allow use of -destroy flag for compatible terraform versions #292

Merged
merged 1 commit into from
Aug 31, 2023

Conversation

rstandt
Copy link
Contributor

@rstandt rstandt commented Apr 15, 2022

Implement the ApplyOption interface for the DestroyFlagOption
struct which enables the user to run terraform apply -destroy
as they would using the terraform binary directly by calling
func (tf *Terraform) Apply.

@hashicorp-cla
Copy link

hashicorp-cla commented Apr 15, 2022

CLA assistant check
All committers have signed the CLA.

@rstandt
Copy link
Contributor Author

rstandt commented Apr 15, 2022

Resolves #293

Copy link
Member

@kmoe kmoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fab, thank you. Just one change so the min version var matches our naming convention.

@@ -9,6 +9,10 @@ import (
"github.com/hashicorp/terraform-exec/tfexec"
)

var (
validateMinApplyDestroyVersion = version.Must(version.NewVersion("0.15.2"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
validateMinApplyDestroyVersion = version.Must(version.NewVersion("0.15.2"))
applyDestroyMinVersion = version.Must(version.NewVersion("0.15.2"))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be great to merge this, i can fork the author's branch if that's helpful

Implement the ApplyOption interface for the DestroyFlagOption
struct which enables the user to run `terraform apply -destroy`
as they would using the terraform binary directly by calling
`func (tf *Terraform) Apply`.
@rstandt rstandt force-pushed the apply-destroy-op branch from 65fea9e to 8e043bf Compare June 14, 2023 16:47
@kmoe kmoe merged commit 2210f68 into hashicorp:main Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants