-
Notifications
You must be signed in to change notification settings - Fork 9.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
path.module and path.root still return absolute paths in terraform console #21438
Comments
Hi @rjullman! Thanks for reporting this. The error messages here are coming from the AWS provider itself, but as you said this might be because the In your case I think the situation is that identifier = ".-db" Using the name of the containing directory is not a pattern we expected but we've seen a similar usage (for a different purpose) in #21400. While using the name of the containing directory feels a little "magical" for my tastes, I can see that you were using it to avoid writing the module name again in here, and so I'd like to find a different way to meet that use-case. It's likely that a new identifier = "${basename(abspath(path.module))}-db" |
Thanks for the help! I did not realize that the I agree that using the directory name in this way is (as you put it) magical. I've been eliminating this construct where possible (I removed all dependencies in the toy example above) and should be able to unblock myself here. |
Indeed, I think |
Since we already have #21400 open, I think I'm going to repurpose this one to represent the fact that |
Confirmed this is now working as expected in current releases. Thanks! |
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. |
Terraform Version
Terraform Configuration Files
Crash Output
N/A
Expected Behavior
Passes validation.
Actual Behavior
Steps to Reproduce
terraform init
terraform apply
Additional Context
Replacing the
basename
function with variables or locals works fine (as long as they do not in turn usebasename
). I imagine the issue is related tobasename
not being evaluated before the validation logic applies.The text was updated successfully, but these errors were encountered: