terraform-provider-vault icon indicating copy to clipboard operation
terraform-provider-vault copied to clipboard

vague error 'argument "address" is required'

Open rjhornsby opened this issue 2 years ago • 3 comments

Terraform Version

Terraform: 1.3.7 Vault provider: 3.12.0

Affected Resource(s)

Not resource specific, but not necessarily a TF core issue.

Expected Behavior

When VAULT_ADDR is not set, expecting an error message that provides usable info to resolve

Actual Behavior

Running terraform plan, the error message "argument 'address' is required" has no context or other detail to suggest its origins:

<...plan output...>
<...unrelated aws_lb_target_group_attachment.my-cool-app["i-012345abcdef"]: Refreshing state...>
| Error: Missing required argument
|
| The argument "address" is required, but was not set.

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. unset VAULT_ADDR (or just never set it in the first place, but don't realize it)
  2. terraform plan

Important Factoids

Without knowing that VAULT_ADDR being unset is the problem, it's not possible to tell where the "missing argument" might be, or how to resolve this error. It's not at all clear that this message is even coming from the vault provider, until you set VAULT_ADDR and the error goes away.

This isn't a functional bug but rather an issue of messaging to the user. With only a few exceptions like this one, Terraform is overall excellent at providing detailed, clear diagnostic messages.

rjhornsby avatar Feb 22 '23 17:02 rjhornsby