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
A function address would be useful and interesting to expose the absolute address of a variable or resource, especially when using in a module.
Suppose a resource vpc in a vcp module with the address module.vpc.aws_vpc.main, then calling the function address(aws_vpc.main) inside the module VPC returns a string "module.vpc.aws_vpc.main".
In different module instances, the result of calling address would be different. Like "module.vpc_one.aws_vpc.main" and "module.vpc_two.aws_vpc.main" for two usages of the VPC module.
This functionality would make a great difference in tag-based tracing, i.e. encode the absolute address in the resource tag, and many other use cases.
Attempted Solutions
The implementation is non-trivial and even this issue #2771 does not help implement this feature.
Proposal
It would be challenging to implement with the current Function interface because this function applies to a reference instead of a value.
References
No response
The text was updated successfully, but these errors were encountered:
Terraform Version
Use Cases
A function
address
would be useful and interesting to expose the absolute address of a variable or resource, especially when using in a module.Suppose a resource vpc in a vcp module with the address
module.vpc.aws_vpc.main
, then calling the functionaddress(aws_vpc.main)
inside the module VPC returns a string"module.vpc.aws_vpc.main"
.In different module instances, the result of calling
address
would be different. Like"module.vpc_one.aws_vpc.main"
and"module.vpc_two.aws_vpc.main"
for two usages of the VPC module.This functionality would make a great difference in tag-based tracing, i.e. encode the absolute address in the resource tag, and many other use cases.
Attempted Solutions
The implementation is non-trivial and even this issue #2771 does not help implement this feature.
Proposal
It would be challenging to implement with the current Function interface because this function applies to a reference instead of a value.
References
No response
The text was updated successfully, but these errors were encountered: