Terraform error not correctly displayed when using bbl in debug mode
Hi bbl developers,
when we run bbl in debug mode and a Terraform subcommand fails, the output is not correctly formatted. We see a long list of numbers which should be converted into a string. Example:
bbl --debug up --lb-type=cf --lb-cert=/tmp/bbl-cert --lb-key=/tmp/bbl-key (...)
╷
│ Error: attaching policy arn:aws:iam::537913301405:policy/perf-test-rails_bosh_policy to IAM Role perf-test-rails_bosh_role: NoSuchEntity: The role with name perf-test-rails_bosh_role cannot be found.
│ status code: 404, request id: 132f6022-c5b9-46b5-a117-2d0c4e0c6ee8
│
│ with aws_iam_role_policy_attachment.bosh[0],
│ on bbl-template.tf line 653, in resource "aws_iam_role_policy_attachment" "bosh":
│ 653: resource "aws_iam_role_policy_attachment" "bosh" {
│
╵
(...)
Executor apply: command execution failed got: exit status 1 stderr:
&{[%!s(*os.File=&{0xc000118120}) %!s(*bytes.Buffer=&{[10 27 91 48 109 27 91 49 109 73 110 105 116 105 97 108 105 122 105 110 103 32 116 104 101 (...)
I guess that somewhere here a (string) conversion is missing: https://github.com/cloudfoundry/bosh-bootloader/blob/1e9223250ced84616cc15ae3f83eb9813453a5d9/terraform/cli.go#L44 I haven't found a test that provokes an error and validates the output conversion.
Thanks for handling this issue!
well before it would swallow all errors :) as noted in this commit https://github.com/cloudfoundry/bosh-bootloader/commit/b386086a84c56391fb635bdf810efc98164a5099 but when i have some time i will take a look
as this still relevant?
It's currently not a problem for us as our bbl setups are running fine (ARD WG).