You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve error-reporting when depends_on, which has a somewhat special syntax, is used incorrectly. This is to provide helpful hint to the editor as to how depends_on must be used. I know I stared at this blankly for a bit before I realized my mistake.
The depends_on syntax is unusual in that it requires un-interpolated values. It's one of the few places that references another resource by it's literal name.
This request is that the error message be improved to something like:
$ terraform apply
Error: aws_lb.foo: resource depends on non-existent value '${aws_s3_bucket.lb-access-logs}'. Note, interpolated values cannot be used in depends_on, did you mean 'aws_s3_bucket.lb-access-logs'?
This is covered by the configuration enhancements in the next release.
The new error output would look like this if you attempt to reference an attribute:
Error: Invalid depends_on reference
on main.tf line 5, in resource "aws_lb" "foo":
5: depends_on = [aws_s3_bucket.lb-access-logs.id]
References in depends_on must be to a whole object (resource, etc), not to an
attribute of an object.
Since the "${} interpolation strings are no longer needed, and there shouldn't be any existing working configuration with that value, the exact case above shouldn't be encountered in the new version or by the upgrade tool.
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
ghost
locked and limited conversation to collaborators
Aug 13, 2019
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Current Terraform Version
Use-cases
Improve error-reporting when
depends_on
, which has a somewhat special syntax, is used incorrectly. This is to provide helpful hint to the editor as to howdepends_on
must be used. I know I stared at this blankly for a bit before I realized my mistake.Proposal
Given an input like ...
We encounter the following error during apply:
The
depends_on
syntax is unusual in that it requires un-interpolated values. It's one of the few places that references another resource by it's literal name.This request is that the error message be improved to something like:
References
None.
The text was updated successfully, but these errors were encountered: