Open zthacker opened 10 months ago
Hey All,
I couldn't find this answer anywhere, so I'd like to ask here.
Given the following code:
tf, err := tfexec.NewTerraform("./terraformexample", execPath) if err != nil { return err } err = tf.Init(context.Background(), tfexec.Upgrade(true)) if err != nil { return err }
I expect tf.Init to return an error as there are no terraform config files in the ./terraformexampole directory. However, this isn't the case.
tf.Init
./terraformexampole
If I were to run terraform init within that directory, it does error out in reference to not having any terraform config files.
terraform init
Am I doing anything wrong, or is this expected? My confusion comes from the tf.Init doc:
Init represents the terraform init subcommand.
Hey All,
I couldn't find this answer anywhere, so I'd like to ask here.
Given the following code:
I expect
tf.Init
to return an error as there are no terraform config files in the./terraformexampole
directory. However, this isn't the case.If I were to run
terraform init
within that directory, it does error out in reference to not having any terraform config files.Am I doing anything wrong, or is this expected? My confusion comes from the
tf.Init
doc:Init represents the terraform init subcommand.