Hi there,
I have difficulties at applying with terraform cloud using a cli driven approach.
My ci cd script step, running on ubuntu :
terraform fmt -check
terraform init
terraform validate -no-color
terraform apply
From a terraform cloud UI perspective, everything is ok I can see the following message :
Apply pending
Needs Confirmation: Check the plan and confirm to apply it, or discard the run.
Confirm & Apply Discard Run Add Comment
but on my cicd log, I have an error :
[09:00:49] Do you want to perform these actions in workspace âmyWorkspaceâ?
[09:00:49] Terraform will perform the actions described above.
[09:00:49] Only âyesâ will be accepted to approve.
[09:00:49]â Error: Error asking approve: EOF
[09:00:49]â
[09:00:49]â
[09:00:50] Enter a value:
[09:00:50] Process exited with code 1
[09:00:50] Process exited with code 1 (Step: terraform via remote (Command Line))
[09:00:50] Step terraform via remote (Command Line) failed
I have looked upon adding -input=false, but it did not do the trick. I would have loved to see a kind of terraform apply -cloud-automation=true
so that the terraform apply does not end in error but rather ends gracefully knowing the end of the process will be assured by the terraform cloud webapp.
As a side note, I have tried with both backend , and it is the same issue :
terraform {
backend âremoteâ {
organization = âmyOrganizationâ
workspaces {
name = âmyWSâ
}
}
}
and
terraform {
cloud {
organization = âmyOrganizationâ
workspaces {
name = âmyWSâ
}
}
}