Skip to content

Commit

Permalink
fix terraform apply for errorsMap passing
Browse files Browse the repository at this point in the history
ErrorsMap configruation was ignored.
Remove commented function.
Move struct closer to the implementation.
  • Loading branch information
ianic committed Sep 27, 2021
1 parent 54d2a74 commit c594063
Showing 1 changed file with 10 additions and 17 deletions.
27 changes: 10 additions & 17 deletions terraform/terraform.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (t *Terraform) apply(destroy bool) error {
}
// retry on ConflictException
for {
err := t.shellExec(args)
err := shell.Exec(opt)
if err == nil || err != conflictException {
return err
}
Expand Down Expand Up @@ -220,22 +220,6 @@ func (t *Terraform) ApplyForProject(projectName string, stage *config.Stage, aws
return nil
}

type SetupTemplateData struct {
Bucket string
BucketPrefix string
FunctionsBucket string
FunctionsPath string
Region string
PublicKey string
}

// func (t *Terraform) RenderSetupTemplate(data SetupTemplateData) error {
// if err := t.RenderTemplate("terraform/templates/setup.tf", &data); err != nil {
// return fmt.Errorf("could not render terraform template for setup - %v", err)
// }
// return nil
// }

func (t *Terraform) Apply(destroy bool) error {
if err := t.init(); err != nil {
return err
Expand Down Expand Up @@ -282,6 +266,15 @@ const (
mainTf = "main.tf"
)

type SetupTemplateData struct {
Bucket string
BucketPrefix string
FunctionsBucket string
FunctionsPath string
Region string
PublicKey string
}

func Setup(data SetupTemplateData) (*Terraform, error) {
if err := extractModules(); err != nil {
return nil, err
Expand Down

0 comments on commit c594063

Please sign in to comment.