Skip to content

Commit

Permalink
faet(terraform): impl new terraform
Browse files Browse the repository at this point in the history
  • Loading branch information
jigsaw373 committed Apr 21, 2023
1 parent 5e29cea commit e159884
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions pkg/terraform/terraform.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package terraform

import (
"fmt"

"github.com/hashicorp/terraform-exec/tfexec"
)

type Terraform struct {
WorkingDir string
ExecDir string
Exec *tfexec.Terraform
}

func NewTerraform(workingDir string, execDir string) (*Terraform, error) {
tf, err := tfexec.NewTerraform(workingDir, execDir)
if err != nil {
return nil, fmt.Errorf("error new terraform: %w", err)
}

return &Terraform{
WorkingDir: workingDir,
ExecDir: execDir,
Exec: tf,
}, nil
}

0 comments on commit e159884

Please sign in to comment.